changeset 334:2e445968851f

* src/java/de/intevation/mxd/reader/WMSLayerReader.java: Do not write WMS Verstions in the map file that mapserver can not support
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 26 Oct 2012 12:45:42 +0200
parents 84ab3afc5610
children 4cf94b919725
files ChangeLog src/java/de/intevation/mxd/reader/WMSLayerReader.java
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 22 18:03:15 2012 +0200
+++ b/ChangeLog	Fri Oct 26 12:45:42 2012 +0200
@@ -1,3 +1,9 @@
+2012-10-26  Andre Heinecke <aheinecke@intevation.de>
+
+	* src/java/de/intevation/mxd/reader/WMSLayerReader.java:
+	Do not write WMS Verstions in the map file that mapserver
+	can not support
+
 2012-10-22  Andre Heinecke <aheinecke@intevation.de>
 
 	* contrib/installer/example/example/epsg/epsg:
--- a/src/java/de/intevation/mxd/reader/WMSLayerReader.java	Mon Oct 22 18:03:15 2012 +0200
+++ b/src/java/de/intevation/mxd/reader/WMSLayerReader.java	Fri Oct 26 12:45:42 2012 +0200
@@ -161,8 +161,14 @@
                 layerElement.setAttribute("projection", wmsconn.getSRS(0));
                 logger.debug(wmsconn.getSRS(0));
             }
-            layerElement.setAttribute("wms_server_version", wmsconn.getWMSVersion());
-            logger.debug(wmsconn.getWMSVersion());
+            String wms_version = wmsconn.getWMSVersion();
+            if (wms_version != "1.0.0" && wms_version != "1.0.7" &&
+                wms_version != "1.1.0" && wms_version != "1.1.1") {
+                logger.warn("WMS Version " + wms_version + " not supported by" +
+                        "Mapserver. Falling back to Version 1.1.1");
+                wms_version = "1.1.1";
+            }
+            layerElement.setAttribute("wms_server_version", wms_version);
         }
         catch(Exception e) {
             logger.debug(e);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)