[Mapbender-commits] r9106 - trunk/mapbender/http/extensions/mobilemap/mod_mapbender

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Oct 27 23:49:55 PDT 2014


Author: armin11
Date: 2014-10-27 23:49:54 -0700 (Mon, 27 Oct 2014)
New Revision: 9106

Modified:
   trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
Log:
Show always dem query when using featureInfo in mobile client

Modified: trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js	2014-10-21 11:41:11 UTC (rev 9105)
+++ trunk/mapbender/http/extensions/mobilemap/mod_mapbender/search.js	2014-10-28 06:49:54 UTC (rev 9106)
@@ -28,7 +28,6 @@
 
 
 */
-var templayer;
 var maxlayers = 5;
 var maxresults = 40;
 
@@ -92,8 +91,10 @@
 			}
 			//SP: Reset Feature List
 			$("#featurelist").empty();
-			//
-	 		if(querylayer.length>0) {
+			//SP: DHM Höhe in Ergebnisliste
+			getHeight(lonlat.lon, lonlat.lat, actuallang);
+			// Query Layer
+	 		if(querylayer.length > 0) {
 				//SP: alle queryable layers iterieren
 				for (var i = 0; i < querylayer.length; i++) {
 					//SP: bei nur einem Feature direkte Referenz, ansonsten array
@@ -147,8 +148,7 @@
 			// Standardabfrage, falls keiner ausgewählt ist
 			//d.h. dhm!
 			var featureurl = 'query/rasterqueryWms.php?coord='+lonlat.lon+ ', '+lonlat.lat+'&lang='+actuallang;
-			//alert(featureurl);
-				loadFeature(featureurl);	
+			loadFeature(featureurl);	
 		}
 	 },
 
@@ -195,7 +195,40 @@
 	$('#featurelist').append(feature.html);
 	refreshFeatureResults();
 }
-
+//SP: DHM Höhe abfragen
+function getHeight(lon, lat, lang)
+{
+	var dhm_url = 'query/rasterqueryWms.php?coord=' + lon + ', ' + lat + '&lang=' + lang;
+	$.ajax(
+	{
+		type: 'GET',
+		url: dhm_url,
+		success: function(data)
+		{
+			if (data)
+			{
+				//alert(data);
+				if(data.length < 5)
+				{
+					data = window.lang.convert('Kein Ergebnis!');
+				}
+				
+				// Dummy Werte
+				//data = "<html><head></head><body>Höhe: ~204 [m]</body></html>";
+				//data = "Höhe: ~204 [m]";
+				
+				// zur Featurelist hinzufügen (Anfang)
+				var html = $('<div>');
+				var collaps = $('<div class="collapsible unselected" data-role="collapsible" data-collapsed="true" data-theme="a" data-content-theme="c" data-inline="true" data-inset="true"></div>');
+				collaps.append('<h3>DHM</h3>');
+				collaps.append(data);
+				html.append(collaps);
+				$('#featurelist').prepend(html);
+				refreshFeatureResults();
+			}
+		}
+	});
+}
 //SP: Is feature url valid, call php (PHP Interface über Ajax)
 function featureValid(feature)
 {



More information about the Mapbender_commits mailing list