[Mapbender-commits] r9084 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Sep 25 03:16:51 PDT 2014


Author: armin11
Date: 2014-09-25 03:16:51 -0700 (Thu, 25 Sep 2014)
New Revision: 9084

Modified:
   trunk/mapbender/http/plugins/mb_metadata_layerPreview.php
   trunk/mapbender/http/plugins/mb_metadata_saveLayerPreview.js
Log:
Bugfix for storing layer previews if layername is 0 - as it is normal for argis servers :-(

Modified: trunk/mapbender/http/plugins/mb_metadata_layerPreview.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layerPreview.php	2014-09-22 15:19:35 UTC (rev 9083)
+++ trunk/mapbender/http/plugins/mb_metadata_layerPreview.php	2014-09-25 10:16:51 UTC (rev 9084)
@@ -14,7 +14,6 @@
 $legendUrl =  $ajaxResponse->getParameter("legendUrl");
 $wmsId =  $ajaxResponse->getParameter("wmsId");
 $layerId = $ajaxResponse->getParameter("layerId");
-
 $layerPreviewMapFileName = PREVIEW_DIR ."/".$layerId."_layer_map_preview.jpg";
 $layerPreviewLegendFileName = PREVIEW_DIR ."/".$layerId."_layer_legend_preview.jpg";
 
@@ -38,7 +37,7 @@
 	$ajaxResponse->setMessage('wmsId not set');
 	$ajaxResponse->send();
 }
-if (!$layerName) {
+if (!$layerName &&  $layerName !== "0") {
 	$ajaxResponse->setSuccess(false);
 	$ajaxResponse->setMessage('layerName not set');
 	$ajaxResponse->send();
@@ -46,7 +45,7 @@
 
 switch ($ajaxResponse->getMethod()) {
 	case "saveLayerPreview":
-		$e = new mb_exception("plugins/mb_metadatalayerPreview.php: weld map");
+		$e = new mb_notice("plugins/mb_metadatalayerPreview.php: weld map");
 		$mapImg = new weldMaps2JPEG($mapurl, $layerPreviewMapFileName);
 		if(!$mapImg) {
 			$ajaxResponse->setSuccess(false);
@@ -54,7 +53,7 @@
 			$ajaxResponse->send();
 		} 
 		if ($legendUrl) {
-			$e = new mb_exception("plugins/mb_metadatalayerPreview.php: weld legend");
+			$e = new mb_notice("plugins/mb_metadatalayerPreview.php: weld legend");
 			$legendImg = new weldMaps2JPEG($legendUrl, $layerPreviewLegendFileName);
 			if(!$legendImg) {
 				$ajaxResponse->setSuccess(false);

Modified: trunk/mapbender/http/plugins/mb_metadata_saveLayerPreview.js
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_saveLayerPreview.js	2014-09-22 15:19:35 UTC (rev 9083)
+++ trunk/mapbender/http/plugins/mb_metadata_saveLayerPreview.js	2014-09-25 10:16:51 UTC (rev 9084)
@@ -22,7 +22,9 @@
 			}
 			var layerId = layer.layer_id;
 			var layerName = layer.layer_name;
-			
+			if (layerName == 0) {
+				layerName == '0';
+			}
 			var layerParent = wms.checkLayerParentByLayerName(layerName); 
 			var layerTitle = wms.getTitleByLayerName(layerName);
 			var layerStyle = wms.getCurrentStyleByLayerName(layerName);



More information about the Mapbender_commits mailing list