<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:D="DAV:" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 6 6 2 2 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmailquote
        {mso-style-name:gmail_quote;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Arial Narrow","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'>Sindile<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'>The filtering of your dropdowns would have to be done in the backend
outside of openlayers. That is, in your database design you would need to associate
municipalities with specific provinces, and towns with specific municipalities.
When a user selects a province the dropdown would then only display those municipalities
associated with the province. The same goes for the selection of a municipality.
Your markers would then also be associated with a particular town. When a
particular town is selected you would display those associated markers. With
regards to zoom to the extents of each of the provinces and municipalities, You
would need to associate a Centroid and Zoom level with each of these items.
Openlayers will not assist you in “zooming to an polygon extent” (except
for vectors of course).<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'>Hope that helps<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'>Andrew<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Arial Narrow","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <b>On Behalf
Of </b>Intengu Technologies<br>
<b>Sent:</b> 04 February 2008 09:09 AM<br>
<b>To:</b> Users@openlayers.org<br>
<b>Subject:</b> Re: [OpenLayers-Users] Zoom to a region using drop down
selection box<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>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>
<o:p></o:p></p>
<div>
<p class=MsoNormal><span class=gmailquote>On 02/02/2008, <b>Josh Livni</b> <<a
href="mailto:mailing_lists@umbrellaconsulting.com">mailing_lists@umbrellaconsulting.com</a>>
wrote:</span><o:p></o:p></p>
<p class=MsoNormal>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. 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't have the dropdowns and/or data, then it's probably<br>
not an OpenLayers question yet...<br>
<br>
Hope this helps.<br>
<br>
-Josh<br>
<br>
Intengu Technologies wrote:<br>
> I live is South Africa and the geocoding service offered by Google,<br>
> Yahoo, Geonames are not comprehensive. What I would like to do
is the<br>
> following from a drop down selection box is for Province,<br>
> Municipality, Town:<br>
> 1. Select a province (have lat long of province - centroid) , google<br>
> maps zooms to that province (this is similar to a State in USA)<br>
> 2. The next drop down selection box only shows municipalities that<br>
> fall within that province (have lat long of municipalities -<br>
> centroids). Then on selection of municipality zoom to that<br>
> municipality. Municipalities (list) should show once a province
has<br>
> been selected.<br>
> 3. The next drop down selection box only shows towns that fall within<br>
> that municipality (have lat long of towns). Then on selection
of town<br>
> zoom to that town. Town (list)should show once a municipality has<br>
> been selected.<br>
><br>
> Thank you in advance for your assistance I am still newbie in openlayers.<br>
><br>
><br>
><br>
> --<br>
> Sindile Bidla<br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
> <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br>
><o:p></o:p></p>
</div>
<p class=MsoNormal><br>
<br clear=all>
<br>
-- <br>
Sindile Bidla <o:p></o:p></p>
<p><span style='font-size:10.0pt'>No virus found in this incoming message.<br>
Checked by AVG Free Edition.<br>
Version: 7.5.516 / Virus Database: 269.17.0/1257 - Release Date: 2008/02/03
05:49 PM</span><o:p></o:p></p>
</div>
</body>
</html>