[OpenLayers-Users] Display Map from MapServer with OpenLayers
Pfirter Lukas
lp at rpag.ch
Thu May 10 03:07:07 EDT 2007
I just got this work, thank you!
I needed to implement the following code:
var wmslayer = new OpenLayers.Layer.WMS( "WMS Layer", "http://domain.com/cgi-bin/mapserv?map=/path/to/file.map", {layers: 'Layername'} );
map.addLayers([wmslayer]);
Now, the only problem I have left is, that the distance measuring bar, sended by the mapserver, is displayed a few times inside the OL window. Is it possible to still use this dynamically generated bar with OL but have it displayed only once (for example in a corner)? Or do I have to disable this bar in the ".map"-File and can not use it in OL?
Lucas
-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im Auftrag von Barend Köbben
Gesendet: Mittwoch, 9. Mai 2007 16:57
An: Users at openlayers.org
Betreff: Re: [OpenLayers-Users] Display Map from MapServer with OpenLayers
>Try this instead:
>
>layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
>"http://domain/cgi-bin/mapserv?map=/path/to/project.map
><http://domain/cgi-bin/mapserv?map=/path/to/project.map> ", {layers:
>'basic'} );
...or, if you need SLD based stylings (as I did):
"http://domain/cgi-bin/mapserv?map=/path/to/project.map <http://domain/cgi-bin/mapserv?map=/path/to/project.map> ",
{layers: "landcover",
SLD: "url-to-your-SLD <http://geoserver.itc.nl/mapserver/sld/galicia.xml> "}
);
...and if you want the layer to be an overlay iso. a base layer:
"http://domain/cgi-bin/mapserv?map=/path/to/project.map <http://domain/cgi-bin/mapserv?map=/path/to/project.map> ",
{layers: "landcover",
SLD: "url-to-your-SLD <http://geoserver.itc.nl/mapserver/sld/galicia.xml> ",
format: "image/png",
transparent: "true"}
);
--
Barend Köbben
International Institute for Geo-information Sciences and Earth Observation (ITC) PO Box 6, 7500AA Enschede (The Netherlands)
ph: +31-(0)534874253; mobile: +31-(0)622344955
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070510/d53cd43f/attachment.html
More information about the Users
mailing list