<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><font style="font-size:10pt;" color="#366092" face="Arial" size="2">Hello folks,<br><br>Yesterday I <font style="font-size: 10pt;" size="2">got a n<font style="font-size: 10pt;" size="2">ice trick from Arnd about zooming all features (<font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">po<font style="font-size: 10pt;" size="2">ints/polylines/polygons)<font style="font-size: 10pt;" size="2">.</font></font></font> No<font style="font-size: 10pt;" size="2">w I</font> wou<font style="font-size: 10pt;" size="2">ld like to ask <font style="font-size: 10pt;" size="2">about zooming fea<font style="font-size: 10pt;" size="2">tures <font style="font-size: 10pt;" size="2">according to their <font style="font-size: 10pt;" size="2">sizes. Imagine this case, I have a point and<font style="font-size: 10pt;" size="2"> a big polygon that I want to zoo<font style="font-size: 10pt;" size="2">m in <font style="font-size: 10pt;" size="2">(also center i<font style="font-size: 10pt;" size="2">n the map)</font></font>, </font></font></font></font></font></font></font></font></font></font>the point is too smaill so<font style="font-size: 10pt;" size="2"> I need to set <font style="font-size: 10pt;" size="2">a s<font style="font-size: 10pt;" size="2">pecific zoom level for this<font style="font-size: 10pt;" size="2">,<font style="font-size: 10pt;" size="2"> this works <font style="font-size: 10pt;" size="2">well for the point case</font><font style="font-size: 10pt;" size="2"> inside my variable "myfeat<font style="font-size: 10pt;" size="2">ures"</font>:<br></font></font></font></font></font></font></font><font style="font-size:10pt;" color="#366092" face="Arial" size="2"></font><br><font style="font-size:10pt;" color="#366092" face="Arial" size="2"><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2"><font style="font-size: 10pt;" size="2">var myfea<font style="font-size: 10pt;" size="2">tures<font style="font-size: 10pt;" size="2"> </font></font>= feature.geometry.bounds;<br></font></font></font></font></font></font></font></font></font></font>map.setCenter(myfeatures.getCenterLonLat(),10);<br><br></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2">where 10 is the zoom level. However,<font style="font-size: 10pt;" size="2"> </font>this doesn'<font style="font-size: 10pt;" size="2">t work wh<font style="font-size: 10pt;" size="2">en the s<font style="font-size: 10pt;" size="2">tore<font style="font-size: 10pt;" size="2">d </font></font><font style="font-size: 10pt;" size="2">feature is a big polygon for instance<font style="font-size: 10pt;" size="2">. </font></font></font></font>I was <font style="font-size: 10pt;" size="2">think<font style="font-size: 10pt;" size="2">ing about a simpl<font style="font-size: 10pt;" size="2">e if/else <font style="font-size: 10pt;" size="2">to do this, b<font style="font-size: 10pt;" size="2">ut how can I <font style="font-size: 10pt;" size="2">differentia<font style="font-size: 10pt;" size="2">te b<font style="font-size: 10pt;" size="2">etween points<font style="font-size: 10pt;" size="2">, polylines<font style="font-size: 10pt;" size="2"> and pol<font style="font-size: 10pt;" size="2">ygons</font></font>?<font style="font-size: 10pt;" size="2"> a cou<font style="font-size: 10pt;" size="2">ple of thi<font style="font-size: 10pt;" size="2">ngs I tried<font style="font-size: 10pt;" size="2">:</font></font></font></font><br><br>map.zoomToExtent(myfeat<font style="font-size: 10pt;" size="2">ures</font>);<br>map.zoomToScale(216672);<br><br>but this is kind of a static z<font style="font-size: 10pt;" size="2">ooming, so <font style="font-size: 10pt;" size="2">it fails when the<font style="font-size: 10pt;" size="2"> fea<font style="font-size: 10pt;" size="2">ture is too big and <font style="font-size: 10pt;" size="2">goes beyo<font style="font-size: 10pt;" size="2">nd this zoom <font style="font-size: 10pt;" size="2">of 216672.<br><br><font style="font-size: 10pt;" size="2">Any ide<font style="font-size: 10pt;" size="2">a is much appreciated,<br><br><font style="font-size: 10pt;" size="2">Bes<font style="font-size: 10pt;" size="2">t regards,<br><br><font style="font-size: 10pt;" size="2">Gery</font></font></font></font></font></font></font></font></font></font></font> </font><br><br></font></font></font></font></font></font></font></font></font>__________________________________________________________________________________________<br>Piensa en el medio ambie<font style="" face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><br></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" class="ecxshort_text" lang="de"><span class="ecxhps">Denken Sie an</span> <span class="ecxhps">die Umwelt</span></span></font><font style="font-size:10pt;" color="#1F497D" face="Arial" size="2"><span id="ecxresult_box" lang="de"><span class="ecxhps"></span> <span class="ecxhps">-</span> <span class="ecxhps">bewahren Sie es</span> <span class="ecxhps">auf dem Bildschirm.</span> <span class="ecxhps">Drucken Sie es NICHT</span><span>, wenn</span> <span class="ecxhps">es NICHT notwendig ist</span><span>.</span></span></font><br> </div></body>
</html>