[mapserver-commits] r12079 - sandbox/inspire_soc2011/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Aug 19 11:09:17 EDT 2011
Author: stefanl
Date: 2011-08-19 08:09:17 -0700 (Fri, 19 Aug 2011)
New Revision: 12079
Modified:
sandbox/inspire_soc2011/mapserver/mapwms.c
sandbox/inspire_soc2011/mapserver/rfc73.rst
Log:
msWMSGetMap also requires requested_language for %language% substitution
Modified: sandbox/inspire_soc2011/mapserver/mapwms.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapwms.c 2011-08-19 14:59:12 UTC (rev 12078)
+++ sandbox/inspire_soc2011/mapserver/mapwms.c 2011-08-19 15:09:17 UTC (rev 12079)
@@ -2190,7 +2190,7 @@
char **tokens = NULL;
int numtokens = 0;
char *validated_language = NULL;
-
+
updatesequence = msOWSLookupMetadata(&(map->web.metadata), "MO", "updatesequence");
sldenabled = msOWSLookupMetadata(&(map->web.metadata), "MO", "sld_enabled");
@@ -3161,19 +3161,34 @@
** msWMSGetMap()
*/
int msWMSGetMap(mapObj *map, int nVersion, char **names, char **values, int numentries,
- char *wms_exception_format, owsRequestObj *ows_request)
+ char *wms_exception_format, owsRequestObj *ows_request, const char *requested_language)
{
imageObj *img;
int i = 0;
int sldrequested = MS_FALSE, sldspatialfilter = MS_FALSE;
const char *http_max_age;
+ char *validated_language = NULL;
+ /* This function owns validated_language, so remember to free it later*/
+ validated_language = msOWSGetInspireLanguage(map, "MO", requested_language);
+
+ if (validated_language != NULL)
+ {
+ for(i=0; i<map->numlayers; i++)
+ {
+ layerObj *layer = GET_LAYER(map, i);
+ if(layer->data) layer->data = msCaseReplaceSubstring(layer->data, "%language%", validated_language);
+ if(layer->connection) layer->connection = msCaseReplaceSubstring(layer->connection, "%language%", validated_language);
+ }
+ }
+
+ msFree(validated_language);
+
/* __TODO__ msDrawMap() will try to adjust the extent of the map */
/* to match the width/height image ratio. */
/* The spec states that this should not happen so that we can deliver */
/* maps to devices with non-square pixels. */
-
/* If there was an SLD in the request, we need to treat it */
/* diffrently : some SLD may contain spatial filters requiring */
/* to do a query. While parsing the SLD and applying it to the */
@@ -4520,7 +4535,7 @@
if (strcasecmp(request, "map") == 0 || strcasecmp(request, "GetMap") == 0)
- return msWMSGetMap(map, nVersion, req->ParamNames, req->ParamValues, req->NumParams, wms_exception_format, ows_request);
+ return msWMSGetMap(map, nVersion, req->ParamNames, req->ParamValues, req->NumParams, wms_exception_format, ows_request, language);
else if (strcasecmp(request, "feature_info") == 0 || strcasecmp(request, "GetFeatureInfo") == 0)
return msWMSFeatureInfo(map, nVersion, req->ParamNames, req->ParamValues, req->NumParams, wms_exception_format, ows_request);
else if (strcasecmp(request, "DescribeLayer") == 0)
Modified: sandbox/inspire_soc2011/mapserver/rfc73.rst
===================================================================
--- sandbox/inspire_soc2011/mapserver/rfc73.rst 2011-08-19 14:59:12 UTC (rev 12078)
+++ sandbox/inspire_soc2011/mapserver/rfc73.rst 2011-08-19 15:09:17 UTC (rev 12079)
@@ -307,6 +307,7 @@
[S] int msDumpLayer(.., const char *validated_language)
[S] void msWMSPrintNestedGroups(.., const char *validated_language)
[S] int msWMSGetCapabilities(.., const char *requested_language)
+ [S] int msWMSGetMap(.., const char *requested_language)
[C] int msWMSLoadGetMapParams(..)
[C] int msWMSLoadGetMapParams(..)
[C] int msWMSDescribeLayer(..)
More information about the mapserver-commits
mailing list