hmm.. you could try using 
...map.addLayers([layer1 , layer2 , layer3]);...
but I don't know for sure if that'll solve your problem...


Frederick Löbig
Röderichstraße 59
60489 Frankfurt am Main
---
E:: [email protected]
P: +49 (0) 69 - 78 99 52 41
M: +49 (0) 174 - 70 89 296
---
Office:
euNetworks GmbH
Ludwig-Landmann-Straße 40560486 Frankfurt am MainP: +49 (0) 69 - 90 554 - 532
E: [email protected]
S: floebig

This email and any attachments may contain confidential and/or legally 
privileged information. If you are not the intended recipient, please delete 
the email without reading it and notify the sender.



> Date: Sun, 16 Jan 2011 12:55:26 +0100
> From: [email protected]
> To: [email protected]
> Subject: [OpenLayers-Users] Error: layer.div is undefined
> 
> Hello,
> 
> I am trying to follow basic steps for learning,
> I managed to show a map, but now I am facing a problem for showing
> more layers. In my HTML file I have:
> 
>            map = new OpenLayers.Map( 'map', {maxResolution: 'auto'} );
> 
>                  var layer0 = new OpenLayers.Layer.WMS(
>                      "L1",
>                      "http://localhost/cgi-bin/mapserv.exe";,
>                      {
>                          map: "C:/ms4w/apps/myGIS/mymap0.map",
>                          layers: "lay0",
>                      format: "image/png"
>                   },
>                  { isBaseLayer: true }                   );
> 
>                  var layer1 = new OpenLayers.Layer.WMS(
>                      "L2",
>                      "http://localhost/cgi-bin/mapserv.exe";,
>                      {
>                          map: "C:/ms4w/apps/myGIS/mymap1.map",
>                          layers: "lay1",
>                      format: "image/png"
>                   },
>                  { isBaseLayer: true }                   );
> 
>             map.addLayer([layer0, layer1]);
> 
> to show each layer alone (map.addLayer(layer0), or
> map.addLayer(layer1)) doesn't give any error, instead adding both
> layers at the same time I get the following error:
> 
> Error: layer.div is undefined
> Source file: http://localhost/myGIS/OpenLayers-2.10/OpenLayers.js
> Row: 839
> 
> I have realized also that I get the same error even if I write
> map.addLayer([layer0]).
> 
> Is it a bug or I am making some mistakes?
> 
> thanks
> 
> f
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
                                          
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to