You're welcome ;)<div><br></div><div><br><div><div>Le 13 août 09 à 15:52, eoinyp (via Nabble) a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">Perfect! :)<br>Thank you Jerome.<br><br>--- On <b>Thu, 13/8/09, Jerome Freyre (via Nabble) <i><<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3438091&i=0" target="_top" rel="nofollow">[hidden email]</a>></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Jerome Freyre (via Nabble) <<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3438091&i=1" target="_top" rel="nofollow">[hidden email]</a>><br>Subject: Re: [OpenLayers-Users] Disappearing layers<br>To: "eoinyp" <<a href="http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3438091&i=2" target="_top" rel="nofollow">[hidden email]</a>><br>Date: Thursday, 13 August, 2009, 12:40 PM<br><br><div id="yiv179255503"> Hi Eoinyp, <br><br>I watched your code. I think you made a mistake with the zoom level on the function map.setCenter(). <br><br>Try to modify the line like that: <br>map.setCenter(new OpenLayers.LonLat(17, 43), 12); <br><br>It should work ;) <br><br>Here is the copy of your code that I used and modify: <br> map = new OpenLayers.Map("map"); <br> map.addControl(new OpenLayers.Control.LayerSwitcher()); <br> <br> //create layer <br> var velayer = new OpenLayers.Layer.VirtualEarth( <br> "Roads Layer", <br> { <br> 'type': VEMapStyle.Road <br> } <br> ); <br> <br> var velayer2 = new OpenLayers.Layer.VirtualEarth( <br> "Aerial Layer", <br> { <br> 'type': VEMapStyle.Aerial <br> } <br> ); <br><br> map.addLayers([velayer, velayer2]); <br><br><br> map.addControl(new OpenLayers.Control.PanZoomBar()); <br> map.addControl(new OpenLayers.Control.ScaleLine()); <br> map.addControl(new OpenLayers.Control.MousePosition()); <br><br><br> map.setCenter(new OpenLayers.LonLat(17, 43), 12); <br><br>Sincerly, <br>Jérome <br><br><br><blockquote class="quote light-black dark-border-color"><div class="quote light-border-color"> <div class="quote-author" style="font-weight: bold;">eoinyp wrote:</div> <div class="quote-message shrinkable-quote">Im a newbie, having problem with my map layers. Which ever layer I add first is visible when the map loads, but when I try to switch layers they both disappear. I seem to be missing something fundamental, though I cant figure out what!! <br>I am creating the layers and map as follows: <br><br> init(){ <br>create layer 1 <br>create layer 2 <br>add([layer1,layer2]) <br>add[map controls] <br>} <br><br>The map can be seen at: <a rel="nofollow" target="_blank" href="http://www.eoinmaca.com/maps/OpenLayers/mymap.htm">http://www.eoinmaca.com/maps/OpenLayers/mymap.htm</a><br><br>Any help greatly appreciated, <br>Thanks, <br><br>Eoinyp </div> </div></blockquote> <br><br> <hr size="1" color="#cccccc" noshade="noshade"> <div style="color: rgb(102, 102, 102); font-family: tahoma,geneva,helvetica,arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none;"> View message @ <a rel="nofollow" target="_blank" href="http://n2.nabble.com/Disappearing-layers-tp3436866p3437329.html">http://n2.nabble.com/Disappearing-layers-tp3436866p3437329.html</a> <br>To unsubscribe from Disappearing layers, <a rel="nofollow" target="_blank">click here</a>. </div> <br> </div></blockquote></td></tr></tbody></table><br> </blockquote></div><br></div>
<br><hr align="left" width="300">
View this message in context: <a href="http://n2.nabble.com/Disappearing-layers-tp3436866p3438116.html">Re: [OpenLayers-Users] Disappearing layers</a><br>
Sent from the <a href="http://n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br>