Arnd is correct about the layer name list being enclosed in a single string. sorry for any confusion.
The "OpenLayers WMS" or "OpenLayers Mapserver" is simply a label for the layer in the layer switch box and should actually probably be something more meaningful that either of these titles. Matt Priour -------------------------------------------------- From: "Arnd Wippermann" <[EMAIL PROTECTED]> Sent: Wednesday, February 13, 2008 4:38 PM To: "'Matt Priour'" <[EMAIL PROTECTED]> Cc: <[email protected]> Subject: AW: [OpenLayers-Users] How do you represent multiple layers > Hi, > > i would think, it must look > > layers:'states_poly,states_line' as one string. > > Also I would suggest, because it is a MapServer layer the title should be > OpenLayers Mapserver. > > > Mit freundlichen GrĂ¼ssen > > Arnd Wippermann > http://gis.ibbeck.de/ginfo/ > > > ________________________________ > > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im > Auftrag von Matt Priour > Gesendet: Dienstag, 12. Februar 2008 23:41 > An: [email protected] > Betreff: Re: [OpenLayers-Users] How do you represent multiple layers > > > Actually that is not a very good idea and bad coding practice. > Your problem was including {layers:'basic'} the word basic is not some > variable relating to type or styule of layers it is an actual layer name > in > the example WMS. Instead of "basic" you should have your layer names > listed > there. So your code should be: > var loadedMap = new OpenLayers.Layer.MapServer( "OpenLayers WMS", > "http://localhost:8085/cgi-bin/mapserv.exe? > <http://localhost:8085/cgi-bin/mapserv.exe?layer=states_poly&layer=states_li > ne> ", > {map: '/ms4w/apps/app/test.map', mode:'map', format: 'png', > transparent:'false', layers: 'states_poly','states_line'}, > {gutter: 15}); > > hope that helps > Matt Priour > > A variation on your theme worked. I put the multiple layers in the URL > > this > http://localhost:8085/cgi-bin/mapserv.exe?map=/ms4w/apps/app/test.map&layer= > states_poly&layer=states_line&mode=map > <http://localhost:8085/cgi-bin/mapserv.exe?map=/ms4w/apps/app/test.map&layer > =states_poly&layer=states_line&mode=map> > > seems to equal this > > var loadedMap = new OpenLayers.Layer.MapServer( "OpenLayers WMS", > "http://localhost:8085/cgi-bin/mapserv.exe?layer=states_poly&layer=states_li > ne > <http://localhost:8085/cgi-bin/mapserv.exe?layer=states_poly&layer=states_li > ne> ", > {map: '/ms4w/apps/app/test.map', mode:'map', format: 'png', > transparent:'false'}, > {layers: 'basic'}, > {gutter: 15}); > > Thanks! > > _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
