Josh,<br><br>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.<br>
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:<br>1. select from the drop down menu a specific province and zoom to its extent<br>
1(a). once zoomed to a province only show municipalities that fall in that province in the municipality drop down box<br><br>2. select from the drop down menu a specific municipality and zoom to its extent<br>2(a). once zoomed to a municipality only show towns that fall in that municipality in the municipality drop down box<br>
<br>3. select from the drop down menu a specific town and zoom to its extent<br><br>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.)<br>
<br>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.<br><br>Regards,<br><br><br><br><div><span class="gmail_quote">On 02/02/2008, <b class="gmail_sendername">Josh Livni</b> &lt;<a href="mailto:mailing_lists@umbrellaconsulting.com">mailing_lists@umbrellaconsulting.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sindile,<br><br>Are you asking how to create the data to fill in the dropdowns, or do<br>you already have this all figured out and are asking how to have<br>OpenLayers zoom to a location that you already have extents for?<br>
<br>And if you are asking how to create the dropdowns themselves, then do<br>you have source data that would let you do this dynamically (eg GIS data<br>for all municipalities and towns?)<br><br>Assuming you have the data, and have created the dropdowns, one general<br>
method would be to have the VALUE of the dropdown item be the bounding<br>box of the municipality or town.&nbsp;&nbsp;Then you could have an onChange event<br>set for the dropdown that called a function to center the map<br>appropriately (map.zoomToExtent).<br>
<br>Assuming you don&#39;t have the dropdowns and/or data, then it&#39;s probably<br>not an OpenLayers question yet...<br><br>Hope this helps.<br><br>&nbsp;&nbsp;-Josh<br><br>Intengu Technologies wrote:<br>&gt; I live is South Africa and the geocoding service offered by Google,<br>
&gt; Yahoo, Geonames are not comprehensive.&nbsp;&nbsp;What I would like to do is the<br>&gt; following from a drop down selection box is for Province,<br>&gt; Municipality, Town:<br>&gt; 1. Select a province (have lat long of province - centroid) , google<br>
&gt; maps zooms to that province (this is similar to a State in USA)<br>&gt; 2. The next drop down selection box only shows municipalities that<br>&gt; fall within that province (have lat long of municipalities -<br>&gt; centroids).&nbsp;&nbsp;Then on selection of municipality zoom to that<br>
&gt; municipality.&nbsp;&nbsp;Municipalities (list) should show once a province has<br>&gt; been selected.<br>&gt; 3. The next drop down selection box only shows towns that fall within<br>&gt; that municipality (have lat long of towns).&nbsp;&nbsp;Then on selection of town<br>
&gt; zoom to that town.&nbsp;&nbsp;Town (list)should show once a municipality has<br>&gt; been selected.<br>&gt;<br>&gt; Thank you in advance for your assistance I am still newbie in openlayers.<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>
&gt; Sindile Bidla<br>&gt; ------------------------------------------------------------------------<br>&gt;<br>&gt; _______________________________________________<br>&gt; Users mailing list<br>&gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
&gt; <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br>&gt;<br></blockquote></div><br><br clear="all"><br>-- <br>Sindile Bidla