[OpenLayers-Users] Display Map from MapServer with OpenLayers

Stephen Woodbridge woodbri at swoodbridge.com
Thu May 10 08:12:55 EDT 2007


You can do this with the OpenLayers.Layer.MapServer.Untiled(...) object. 
THere might be a WMS.Untiled() layer also that you can use.

-Steve

Pfirter Lukas wrote:
> 
> 
> 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 * 
> <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 
> <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>
>  >< 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> < 
> 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 
> <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> < 
> 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 
> <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 
> <http://openlayers.org/mailman/listinfo/users>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list