On Oct 3, 12:59 pm, Bryan Richardson <[email protected]> wrote:
> Hi Larry,
>
> Thanks for responding. Sorry it took me so long to get back to
> this, hopefully you're still willing to help!
>
> You're right, I did have the zoom levels backwards. I've changed
> my code to reflect the correct way, and have posted an example
> at the following link.
>
> http://erum-staging.heroku.com/mapfix.html
>
> Let me know what you think!
The v3 google maps API is event based. Most of the properties of the
map (like zoom, projection, bounds,...) aren't available until the map
initialization is complete.
You need to do something like:
google.maps.event.addListener(map, "zoom_changed", function() {
if (map.getZoom() > 12) {
map.setZoom(12);
}
});
-- Larry
(still lobbying for a "map initialization complete event...)
>
> --
> Thanks!
> Bryan
>
> On Aug 20, 11:38 pm, "[email protected]" <[email protected]>
> wrote:
>
>
>
> > On Aug 20, 3:48 pm, Bryan Richardson <[email protected]> wrote:
>
> > > Hello All,
>
> > > I'm adding LatLng objects to a LatLngBounds object via the extend()
> > > method such that I can have my Google map include all the LatLng
> > > objects via map.fitBounds(). However, my problem is when the
> > > LatLngBounds object just includes a few points that are very close
> > > together. I want my minimum zoom level to be 4, but there's times when
> > > the points are so close together that the zoom level is 1 or 2.
>
> > That sounds wrong, zoom level 0 is the whole world.
>
> > > I
> > > tried checking the zoom level via getZoom after fillBounds is called,
> > > but it returns undefined.
>
> > Sounds like your map variable needs to be global.
>
> > > I've now been trying to figure out how to
> > > set the minZoom property for MapType, but can't figure out how to do
> > > that either... :(
>
> > > Any suggestions on how to address my problem?!
>
> > Post a link to your map that exhibits the problem.
>
> > -- Larry
>
> > > --
> > > Thanks!
> > > Bryan
--
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.