OK - still having some trouble understanding this. Starting small - I'm trying to do map.getBounds() as soon as the map is ready. i.e. the bounds required are the bounds the user first sees when the maps are loaded. But everywhere I use map.getBounds() - unless its within the drag event handler - I'm getting undefined.
According to the docs, I need to make sure that the map is initialized, which they describe as making sure that mapType, center, and zoom are not null. As far as I can tell though, there is no "map ready" or "map initialized" event. I actually use the maptypeid_changed handler before I set the map for doing some actions on my custom map type. I've made sure that within that handler, all of the above are not null. But, when I do map.getBounds() within that handler, I'm still getting undefined as the result. Sort of hard to do a comparison without the original bounds. Any thoughts? On Apr 14, 4:30 pm, midimid <[email protected]> wrote: > Thanks - makes sense! > > On Apr 12, 6:16 pm, Esa <[email protected]> wrote: > > > Construct a 'drag' event listener that stores the position > > > var previousCenter = map.getCenter(); > > > and tests if > > > certainBounds == certainBounds.union(map.getBounds()) > > > if not, > > > map.setCenter(previousCenter); -- 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.
