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

Reply via email to