[OpenLayers-Users] Zoom to a region using drop down selection box

Josh Livni mailing_lists at umbrellaconsulting.com
Sat Feb 2 16:14:37 EST 2008


Sindile,

Are you asking how to create the data to fill in the dropdowns, or do 
you already have this all figured out and are asking how to have 
OpenLayers zoom to a location that you already have extents for?

And if you are asking how to create the dropdowns themselves, then do 
you have source data that would let you do this dynamically (eg GIS data 
for all municipalities and towns?)

Assuming you have the data, and have created the dropdowns, one general 
method would be to have the VALUE of the dropdown item be the bounding 
box of the municipality or town.  Then you could have an onChange event 
set for the dropdown that called a function to center the map 
appropriately (map.zoomToExtent).

Assuming you don't have the dropdowns and/or data, then it's probably 
not an OpenLayers question yet...

Hope this helps.
 -Josh


Intengu Technologies wrote:
> I live is South Africa and the geocoding service offered by Google,
> Yahoo, Geonames are not comprehensive.  What I would like to do is the
> following from a drop down selection box is for Province,
> Municipality, Town:
> 1. Select a province (have lat long of province - centroid) , google
> maps zooms to that province (this is similar to a State in USA)
> 2. The next drop down selection box only shows municipalities that
> fall within that province (have lat long of municipalities -
> centroids).  Then on selection of municipality zoom to that
> municipality.  Municipalities (list) should show once a province has
> been selected.
> 3. The next drop down selection box only shows towns that fall within
> that municipality (have lat long of towns).  Then on selection of town
> zoom to that town.  Town (list)should show once a municipality has
> been selected.
>
> Thank you in advance for your assistance I am still newbie in openlayers.
>
>
>
> -- 
> Sindile Bidla
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   



More information about the Users mailing list