[mapserver-dev] Issue on STYLES parameter in WMS requests
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Wed Jun 20 10:41:53 PDT 2012
Can you create a ticket?
-----Original Message-----
From: mapserver-dev-bounces at lists.osgeo.org [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Eichner, Andreas - SID-NLKM
Sent: Wednesday, June 20, 2012 7:19 AM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] Issue on STYLES parameter in WMS requests
Hi devs,
we're using named styles and found an issue when retrieving multiple layers. Using a request with ...&layers=a,b,c&styles=a,,&... fails with "[...] Mapserver is expecting an empty string for the STYLES [...]".
According to the WMS spec using an empty style name in the STYLES parameter should be treated as "default".
The problem seems to be in msWMSLoadGetMapParams() where the
msStringSplit() is used which throws empty tokens away. The following patch solves this by using msStringSplitComplex() but I'm not sure if it causes side effects. Would be nice if someone could have a look at it...
diff --git a/mapwms.c b/mapwms.c
index d02c667..037441b 100644
--- a/mapwms.c
+++ b/mapwms.c
@@ -1108,7 +1108,7 @@ int msWMSLoadGetMapParams(mapObj *map, int nVersion,
int numlayers =0;
layerObj *lp = NULL;
- tokens = msStringSplit(styles, ',' ,&n);
+ tokens = msStringSplitComplex(styles, ","
,&n,MS_ALLOWEMPTYTOKENS);
for (i=0; i<n; i++)
{
if (tokens[i] && strlen(tokens[i]) > 0 &&
Greets
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev
More information about the mapserver-dev
mailing list