[OpenLayers-Users] Automatic zooming to map points based on
elements selected from drop-down lists
Jerome Freyre
jerome.freyre at hispeed.ch
Thu Aug 13 07:49:57 EDT 2009
Hi Surya,
If you can recover coordinates of your elements in drop-down list, you can
call the function :
map.setCenter(new OpenLayers.LonLat(selectedElementLongitude,
selectedElementLatitude));
And if there is multiple element selected, you have to create a bounding box
and zoom to the extent:
// Create a bounds
bounds = new OpenLayers.Bounds();
// You can use a loop for for each selected eleement and assign their
lon/lat
bounds.extend(new OpenLayers.LonLat(4,5));
bounds.extend(new OpenLayers.LonLat(5,6));
// Zoom to the extent
map.zoomToExtent(bounds);
Sincerly,
Jérome
Surya Tarigan wrote:
>
> Dear list,
>
> would somebody give hints or share javascript codes on how to
> automatically zooming to map points based on elements selected from
> drop-down lists.
>
> best regards,
>
> surya
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://n2.nabble.com/Automatic-zooming-to-map-points-based-on-elements-selected-from-drop-down-lists-tp3436326p3437384.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list