I am working on a somewhat complex google map and have run into an issue with fitbounds. It works perfectly... most of the time, but occasionally ignores my bounds and loads the map in the middle of the ocean.
My markers still appear and had loaded correctly if i zoom out and search for them.
Any thoughts?
Markers from json string
Code (stripped out 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);**
}); // end .each
**map.fitBounds(mybounds);**
Please also note: I don't get any js errors on the page.