[OpenLayers-Users] Disappearing layers

Jerome Freyre jerome.freyre at hispeed.ch
Thu Aug 13 09:56:54 EDT 2009


You're welcome ;)


Le 13 août 09 à 15:52, eoinyp (via Nabble) a écrit :

> Perfect! :)
> Thank you Jerome.
>
> --- On Thu, 13/8/09, Jerome Freyre (via Nabble) <[hidden email]>  
> wrote:
>
> From: Jerome Freyre (via Nabble) <[hidden email]>
> Subject: Re: [OpenLayers-Users] Disappearing layers
> To: "eoinyp" <[hidden email]>
> Date: Thursday, 13 August, 2009, 12:40 PM
>
> Hi Eoinyp,
>
> I watched your code. I think you made a mistake with the zoom level  
> on the function map.setCenter().
>
> Try to modify the line like that:
> map.setCenter(new OpenLayers.LonLat(17, 43), 12);
>
> It should work ;)
>
> Here is the copy of your code that I used and modify:
>                 map = new OpenLayers.Map("map");
>                 map.addControl(new  
> OpenLayers.Control.LayerSwitcher());
>
>                 //create layer
>                 var  velayer = new OpenLayers.Layer.VirtualEarth(
>                         "Roads Layer",
>                         {
>                                 'type': VEMapStyle.Road
>                         }
>                 );
>
>                 var velayer2 = new OpenLayers.Layer.VirtualEarth(
>                         "Aerial Layer",
>                         {
>                                 'type': VEMapStyle.Aerial
>                         }
>                 );
>
>                 map.addLayers([velayer, velayer2]);
>
>
>                 map.addControl(new OpenLayers.Control.PanZoomBar());
>                 map.addControl(new OpenLayers.Control.ScaleLine());
>                 map.addControl(new  
> OpenLayers.Control.MousePosition());
>
>
>                 map.setCenter(new OpenLayers.LonLat(17, 43), 12);
>
> Sincerly,
> Jérome
>
>
> eoinyp wrote:
> 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!!
> I am creating the layers and map as follows:
>
>  init(){
> create layer 1
> create layer 2
> add([layer1,layer2])
> add[map controls]
> }
>
> The map can be seen at: http://www.eoinmaca.com/maps/OpenLayers/mymap.htm
>
> Any help greatly appreciated,
> Thanks,
>
> Eoinyp
>
>
> View message @ http://n2.nabble.com/Disappearing-layers-tp3436866p3437329.html
> To unsubscribe from Disappearing layers, click here.
>
>
>
>
> View message @ http://n2.nabble.com/Disappearing-layers-tp3436866p3438091.html
> To unsubscribe from Re: Disappearing layers, click here.
>


-- 
View this message in context: http://n2.nabble.com/Disappearing-layers-tp3436866p3438116.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090813/c7e23b6d/attachment.html


More information about the Users mailing list