forgive me for asking a question that has been asked before. I am having an unusual problem with Google Maps that started about 3 days ago. No one has touched any code for this section and it just started to stop working. At first it was hit and miss and by today it is consistent. When I put in some breakpoints I see that google.maps.LatLng
comes up as 'undefined'
in javascript. This causes the entire map to not load.
Here is how I am calling for the library
<script src="https://maps.googleapis.com/maps/api/js?key=xxx&loading=async&v=weekly&callback=Function.prototype" defer></script>
Here is an example of me initializing the map
myMap = new google.maps.Map(document.getElementById(control),
{
center: new google.maps.LatLng(32.7828, -96.8039),
mapTypeId: google.maps.MapTypeId.SATELLITE,
zoom: 4,
maxZoom: 19,
minZoom: 3
}
);
Any thoughts or suggestions would be greatly appreciated. And again, this was all working code that no one has touched and it just suddenly stopped.
3
After much troubleshooting and going back several releases I found the issue. The issue was adding the load async in the script tag. I still can’t figure out why it was working for months then suddenly just stopped.