[OpenLayers-Users] MapServer OpenLayers Layer fails to load

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Thu Oct 16 09:50:33 EDT 2008


Jeff,
I think that is another good place to check.  You did not include your options variable in the code you posted, are you saying this does not have a projection specified? 

Also, make sure that the countries layer has it's projection specified in the mapserver layer.  You might want to go ahead and post up your mapfile as well.

r.b.

Robert W. Burgholzer
Surface Water Modeler
Office of Water Supply and Planning
Virginia Department of Environmental Quality
rwburgholzer at deq.virginia.gov
804-698-4405
Open Source Modeling Tools:
http://sourceforge.net/projects/npsource/

-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of jeffcopes
Sent: Thursday, October 16, 2008 8:27 AM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] MapServer OpenLayers Layer fails to load


Arnd and Robert,

The problem may not be the number of layers being rendered, and it may not
be the projection information. Commenting out "rivers" and "cities" layers
and running only the "countries" layer had, as expected, only the
"countries" layer in the layer switcher, but when selected, the "countries"
layer does not display. 

The projection information passed in with the "countries" layer matches the
MAP projection information as well as the base raster layer projection
information. Oddly, the "rivers" and "cities" layers have different
projections than both the base raster layer and the "countries" layer.

All these layers display when MapServer combines the layers together. I may
need to pass in a projection parameter with OpenLayers, yes? 

Thanks,

Jeff



Arnd Wippermann wrote:
> 
> I don't think, it's an issue with OpenLayers, but with the projection in
> the
> mapfile.
> 
> Arnd Wippermann 
> 
> -----Ursprüngliche Nachricht-----
> Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
> Auftrag von jeffcopes
> Gesendet: Dienstag, 14. Oktober 2008 23:55
> An: users at openlayers.org
> Betreff: [OpenLayers-Users] MapServer OpenLayers Layer fails to load
> 
> 
> All,
> 
> I have three layers I am loading through OpenLayers. One is a raster layer
> with two sets of global imagery. That is being created as an
> "OpenLayers.Layer.MapServer" object. This layer loads fine. Another layer
> "rivers" is a vector layer and is created as an "OpenLayers.Layer.WMS"
> object; it loads fine also. The remaining vector layers ("cities" and
> "countries" do not load, even their mapfiles are from the same mapfile
> template, their metadata is nearly identical, and their OpenLayers layer
> definitions and MapServer layer definitions are similar. The results are
> the
> same regardless of the order of the object creation and layer adding to
> the
> map. I also know the mapfiles are seen because when I make these layers
> the
> only layers, the result is a gray background, and when I munge the mapfile
> names, I get pink tiles.
> 
> Both vector layers load when added to the "OpenLayers.Layer.MapServer"
> object by appending the layer definition to the WMS map call, so I am
> working under the assumption the layer definitions are OK. Where should I
> begin troubleshooting this problem?
> 
> Here is the OpenLayers application:
> 
>         map = new OpenLayers.Map('map',options );
>         var landsat =
>            new OpenLayers.Layer.MapServer("LandSat",
>                "http://dnocc8067:8090/cgi-bin/harrismaps?map="
>               +
> "/usr/local/mapserver/www/htdocs/maps/world_highres_experimental.map"
>               + "&layer=blue_marble_world"
>               + "&layer=landsat"
>               ,{layers: "blue_marble_world,landsat"}
>               ,{'displayInLayerSwitcher':"false"}
>          );
> 
>         var countries =
>            new OpenLayers.Layer.WMS("Country Borders",
>                "http://dnocc8067:8090/cgi-bin/harrismaps?map="
>               + "/usr/local/mapserver/www/htdocs/maps/countries.map"
>               ,{layers: "countries", 'isBaseLayer': "false", transparent:
> "true"});
> 
>         var rivers =
>            new OpenLayers.Layer.WMS("Rivers",
>                "http://dnocc8067:8090/cgi-bin/harrismaps?map="
>               + "/usr/local/mapserver/www/htdocs/maps/rivers.map"
>               ,{layers: "rivers", 'isBaseLayer': "false", transparent:
> "true"});
> 
>         var cities =
>            new OpenLayers.Layer.WMS("Cities",
>                "http://dnocc8067:8090/cgi-bin/harrismaps?map="
>               + "/usr/local/mapserver/www/htdocs/maps/cities.map"
>               ,{layers: "largecities,cities", 'isBaseLayer': "false",
> transparent: "true"});
> 
>          map.addLayer(landsat);
>          map.addLayer(countries);
>          map.addLayer(rivers);
>          map.addLayer(cities);
>          countries.setVisibility(false);
>          rivers.setVisibility(false);
>          cities.setVisibility(false);
> 
> 
> Thanks,
> 
> Jeff
> --
> View this message in context:
> http://www.nabble.com/MapServer-OpenLayers-Layer-fails-to-load-tp19982976p19
> 982976.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/MapServer-OpenLayers-Layer-fails-to-load-tp19982976p20012686.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list