[OpenLayers-Users] Zoom to object

Lorenzo Becchi lorenzo at ominiverdi.com
Thu Jul 5 12:21:04 EDT 2007


> Hi!
>
> Is some solution,example how to realize zoom to object using OpenLayers.
> Something similar like in Ka-map! search used (
> http://www.ominiverdi.org/ka-map/ka-map/htdocs/
> )
>
> Thanks!
>
> RKarru

Hi Raivo,
I've wrote that ka-map code.

things are not that different in OL.

to make it easy, you can create an onclick function for each geo-object 
you have and use this two lines:
--------------------------------------------
var bbox = new OpenLayers.Bounds(minx, miny, maxx, maxy);
map.zoomToExtent(bbox);
--------------------------------------------

where
- minx, miny, maxy, maxy are the values of your object extent
- map is your OL map object

hope I've understood your needing

ciao
Lorenzo



More information about the Users mailing list