Documentation for map.setCenter omits zoom level

238 views
Skip to first unread message

bkizzy

unread,
Jun 9, 2011, 7:19:11 PM6/9/11
to google-map...@googlegroups.com
All,

Looks like the api v3 docs omit the zoom level from the map.setCenter() method. Should be:

map.setCenter(latlng, zoom)

If this is omitted the map will return to the default zoom level specified during instantiation. Just lost a bunch of time messing with this, I hope google employees are monitoring and that docs will be revised.

Good luck!

geoco...@gmail.com

unread,
Jun 9, 2011, 7:34:07 PM6/9/11
to Google Maps JavaScript API v3
On Jun 9, 4:19 pm, bkizzy <boris.kizelsht...@popcha.com> wrote:
> All,
>
> Looks like the api v3 docs omit the zoom level from the map.setCenter()
> method. Should be:
>
> map.setCenter(*latlng, zoom)

Unless things have changed, the setCenter method of the GMap class in
v3 only takes one parameter. The documentation is correct. It is
different from v2.

http://code.google.com/apis/maps/documentation/javascript/reference.html#Map
getCenter() LatLng

Note that you can set the center and zoom in one method by using the
GMap.setOptions method.

-- Larry

>
> *If this is omitted the map will return to the default zoom level specified

Chris Broadfoot

unread,
Jun 9, 2011, 10:41:52 PM6/9/11
to google-map...@googlegroups.com
Sorry no, this is not correct. Please re-read the reference documentation:


setCenter(latlng:LatLng)

There is no 'zoom' parameter.

Your experience leads me to believe there's probably something else wrong with your code.

Chris

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/MyCQex-RZQYJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.



--
http://twitter.com/broady
Reply all
Reply to author
Forward
0 new messages