[OpenLayers-Users] SetCenter() API, how to use it?

JK Chen jk.chen at sdl.usu.edu
Tue Jul 5 11:18:20 EDT 2011


The API document says the 2nd argument (the one for zoom), is optional. However, there are 3rd and fouth arguments. How to invoke such an API call?

Anyone please provide a correct syntax, thanks. Would it be like map.setCenter(lonlat)? Or like map.setCenter(lonlat, undefined)?  ....



setCenter
setCenter: function(

lonlat,


zoom,


dragging,


forceZoomChange

)



Set the map center (and optionally, the zoom level).

Parameters
lonlat

{OpenLayers.LonLat<http://dev.openlayers.org/docs/files/OpenLayers/BaseTypes/LonLat-js.html#OpenLayers.LonLat>} The new center location.

zoom

{Integer} Optional zoom level.

dragging

{Boolean} Specifies whether or not to trigger movestart/end events

forceZoomChange

{Boolean} Specifies whether or not to trigger zoom change events (needed on baseLayer change)


TBD: reconsider forceZoomChange in 3.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110705/943d32bd/attachment.html


More information about the Users mailing list