I was wondering why does the 'idle' event fire when fitBounds() is called on a
new "bound-less" map? This happens before the 'tilesloaded' event.
I was under the impression that 'idle' was designed to respond to only DOM
interactions (drag, zoom, resize), not the programatic setting of bounds.
My code:
this.Map = new google.maps.Map(document.getElementById("map"), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
draggable: false
});
var swlatlng = new google.maps.LatLng(this.get('latsw'),
this.get('longsw')),
nelatlng = new google.maps.LatLng(this.get('latne'),
this.get('longne')),
bounds = new google.maps.LatLngBounds(swlatlng, nelatlng);
this.Map.fitBounds(bounds);
google.maps.event.addListener(this.Map, 'idle', function(e) {
// Do something
});
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.