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

Intengu Technologies sindile.bidla at gmail.com
Mon Feb 4 02:09:21 EST 2008


Josh,

I have the data, what I had done was to get the centroids of the polygons,
perhaps I need to get their bounding boxes and also indicate a specific zoom
level depending on whether province or municipality or town.
I know how to create the drop down menus, essentially I will have three drop
down boxes - province, municipality and province, but what I do not know how
to do is:
1. select from the drop down menu a specific province and zoom to its extent
1(a). once zoomed to a province only show municipalities that fall in that
province in the municipality drop down box

2. select from the drop down menu a specific municipality and zoom to its
extent
2(a). once zoomed to a municipality only show towns that fall in that
municipality in the municipality drop down box

3. select from the drop down menu a specific town and zoom to its extent

The reason I want to do this is to have markers linked to towns (examples of
markers are hotels, types of restaurants, bed and breakfast, bars, shopping
centers, tourist attraction facilities.)

Sorry for the long narration I am a newbie in openlayers and javascript,
examples of implementation would help or suggestion on how to better
implement my application.

Regards,



On 02/02/2008, Josh Livni <mailing_lists at umbrellaconsulting.com> wrote:
>
> 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
> >
>



-- 
Sindile Bidla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080204/38a04948/attachment.html


More information about the Users mailing list