[Mapbender-commits] r9056 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Sep 3 03:55:50 PDT 2014


Author: armin11
Date: 2014-09-03 03:55:50 -0700 (Wed, 03 Sep 2014)
New Revision: 9056

Modified:
   trunk/mapbender/http/javascripts/mb_downloadFeedClient.php
Log:
INSPIRE Download feed client - simplify to allow download with ie

Modified: trunk/mapbender/http/javascripts/mb_downloadFeedClient.php
===================================================================
--- trunk/mapbender/http/javascripts/mb_downloadFeedClient.php	2014-09-01 10:16:31 UTC (rev 9055)
+++ trunk/mapbender/http/javascripts/mb_downloadFeedClient.php	2014-09-03 10:55:50 UTC (rev 9056)
@@ -245,7 +245,7 @@
 		}
                 for (var i = 0; i < numberOfLinks; i++) {
 			if (featureCollection.features[k].properties.link[i]['@attributes'].bbox == '' || featureCollection.features[k].properties.link[i]['@attributes'].bbox === undefined) {
-				selectFOptions = selectFOptions+"<option value='"+i+"' url='"+featureCollection.features[k].properties.link[i]['@attributes'].href+"' title='"+featureCollection.features[k].properties.link[i]['@attributes'].title+"'  onclick='window.open(\""+featureCollection.features[k].properties.link[i]['@attributes'].href+"\");'>"+featureCollection.features[k].properties.link[i]['@attributes'].title+"</option>";
+				//selectFOptions = selectFOptions+"<option value='"+i+"' url='"+featureCollection.features[k].properties.link[i]['@attributes'].href+"' title='"+featureCollection.features[k].properties.link[i]['@attributes'].title+"'  onclick='window.open(\""+featureCollection.features[k].properties.link[i]['@attributes'].href+"\");'>"+featureCollection.features[k].properties.link[i]['@attributes'].title+"</option>";
 			} else {
                 		ext = featureCollection.features[k].properties.link[i]['@attributes'].bbox;
 				extArrayNew = new Array();
@@ -256,21 +256,21 @@
 				extArrayNew[2] = extArray[3];
 				extArrayNew[3] = extArray[2];
                 		bound = OpenLayers.Bounds.fromArray(extArrayNew);
-				attributes = {id: i, url:featureCollection.features[k].properties.link[i]['@attributes'].href};
+				attributes = {id: i, url:featureCollection.features[k].properties.link[i]['@attributes'].href, title: featureCollection.features[k].properties.link[i]['@attributes'].title};
                 		box = new OpenLayers.Feature.Vector(bound.toGeometry(),attributes);
                 		bboxFiles.addFeatures(box);
-				selectFOptions = selectFOptions+"<option value='"+i+"' url='"+featureCollection.features[k].properties.link[i]['@attributes'].href+"' title='"+featureCollection.features[k].properties.link[i]['@attributes'].title+"' onclick='highlightFeatureIndexById("+i+",true);' onmouseover='highlightFeatureIndexById("+i+",false);'>"+featureCollection.features[k].properties.link[i]['@attributes'].title+"</option>";
+				//selectFOptions = selectFOptions+"<option value='"+i+"' url='"+featureCollection.features[k].properties.link[i]['@attributes'].href+"' title='"+featureCollection.features[k].properties.link[i]['@attributes'].title+"' onclick='highlightFeatureIndexById("+i+",true);' onmouseover='highlightFeatureIndexById("+i+",false);'>"+featureCollection.features[k].properties.link[i]['@attributes'].title+"</option>";
 			}
 				
                	}
 		//count features of bboxFiles
 		//bboxFiles if not available show error message
-		selectFObject = $(document.createElement('select')).appendTo('#section_list');
-		selectFObject.attr({'id':'section_option'});
-		selectFObject.attr({'multiple':'multiple'});
+		//selectFObject = $(document.createElement('select')).appendTo('#section_list');
+		//selectFObject.attr({'id':'section_option'});
+		//selectFObject.attr({'multiple':'multiple'});
 		//add options 
-		selectFOptionsObject = $('#section_option').append(selectFOptions);
-		selectFOptionsObject.attr({'width': 300});
+		//selectFOptionsObject = $('#section_option').append(selectFOptions);
+		//selectFOptionsObject.attr({'width': 300});
 		//alert(bboxFiles.features.length);
 		if (bboxFiles.features.length >= 1) {//TODO
 			//show mapframe
@@ -288,8 +288,14 @@
         				var feature = event.feature;
         				var id = feature.attributes.id;
 					var url = feature.attributes.url;
-					$('#section_option option').removeAttr('selected')
-					$("#section_option option[value='"+id+"']").attr('selected',true);
+					$("#download_link").remove();
+					//show Downloadlink
+					downloadLink = $(document.createElement('a')).appendTo('#section_list');
+					downloadLink.attr({'href':url});
+					downloadLink.attr({'id':'download_link'});
+					downloadLink.text(feature.attributes.title);
+					//$('#section_option option').removeAttr('selected')
+					//$("#section_option option[value='"+id+"']").attr('selected',true);
 					//window.open(url,'download_window');
 
 					/*if ($('#multi_select').is(':checked')) {



More information about the Mapbender_commits mailing list