[OpenLayers-Users] mergeNewParams and MapServer DATA

Arnd Wippermann arnd.wippermann at web.de
Mon Mar 30 18:30:52 EDT 2009


OpenLayers sets the parameter to uppercase

MY.MAP.LAYER[MYLAYER]=DATA+shapefiles/shp2
 
Perhaps thats the problem

Arnd


-----Ursprüngliche Nachricht-----
Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von Ian
Gesendet: Montag, 30. März 2009 22:15
An: users at openlayers.org
Betreff: [OpenLayers-Users] mergeNewParams and MapServer DATA

I'm using MapServer 5.0 and OpenLayers 2.7 to display WMS maps. I am trying
to dynamically change a layer's data source via url, specifically changing
the DATA parameter in the MapServer map file. So for two spatially-indexed
shapefiles (shp1, shp2):

Manually changing the url works:

http://host/cgi-bin/mapserv?map=my.map&LAYERS=myLayer&TRANSPARENT=true&SERVI
CE=WMS&VERSION=1.1.1&REQUEST=GetMap&...&map.layer[myLayer]=DATA+shapefiles/s
hp2

However when I use mergeNewParams:

myLayer.mergeNewParams({"my.map.layer[myLayer]" : "DATA+shapefiles/shp2"});

or:

myLayer.mergeNewParams({"myLayer" : "DATA+shapefiles/shp2"});


I get the error "msUpdateMapFromURL(): General error message. Layer to be
modified not valid." From Firebug it looks like the layer name is converted
to all caps which may be causing a mismatch, but copying and manually
editing the OpenLayers request's layer name gives a different
error:

getString(): Symbol definition error. Parsing error near (+):(line 1)


Any ideas?

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




More information about the Users mailing list