I am working on a somewhat complicated google map and ran into a problem with fitbounds. It works great ... most of the time, but sometimes ignores my borders and loads a map in the middle of the ocean.
My markers are still displayed and loading correctly if I zoom out and looked for them.
Any thoughts?
Json string markers
Code (deleted for simplicity):
**var mybounds = new google.maps.LatLngBounds();** $.getJSON(callRoot + JSON.stringify(mapSearchParams), function(data) { $.each(data.markers, function (i, marker) { **var position = new google.maps.LatLng(marker.latitude, marker.longitude);** addMarker(position, findIcon(marker.category, "marker"), marker.category, marker.title, marker.subtitle, marker.destNodeGUID, marker.documentURL, marker.primaryImageURL, marker.isFeatured); **mybounds.extend(position);** });
Also note: I am not getting any js errors on the page.
source share