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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jan 12 07:47:37 PST 2016


Author: armin11
Date: 2016-01-12 07:47:37 -0800 (Tue, 12 Jan 2016)
New Revision: 9344

Modified:
   trunk/mapbender/http/javascripts/mb_downloadFeedClient.php
Log:
New version of INSPIRE ATOM Feed client with using bootstrap

Modified: trunk/mapbender/http/javascripts/mb_downloadFeedClient.php
===================================================================
--- trunk/mapbender/http/javascripts/mb_downloadFeedClient.php	2016-01-11 15:43:44 UTC (rev 9343)
+++ trunk/mapbender/http/javascripts/mb_downloadFeedClient.php	2016-01-12 15:47:37 UTC (rev 9344)
@@ -5,6 +5,7 @@
 
 var mapframe_dataset_list, mapframe_file_list, datasetSelect, file_list, bboxDataset, bboxFiles, formats, sf;
 
+
 function updateFormats() {
             var in_options = {
                 'internalProjection': mapframe_dataset_list.baseLayer.projection,
@@ -53,9 +54,19 @@
 }
 
 function init(){
-	//generate 2 Mapframes
+	//var form = document.getElementById("service_feed_form");
+
+
+
+	//generate 2 Mapframes	
+	//add active class to dataset info before showing map, afterwords remove it!
+	$('#dataset_info').toggleClass('active');
 	mapframe_dataset_list = new OpenLayers.Map('mapframe_dataset_list');
+	$('#dataset_info').toggleClass('active');
+	
+	$('#representations').toggleClass('active');
 	mapframe_file_list = new OpenLayers.Map('mapframe_file_list');
+	$('#representations').toggleClass('active');
 	<?php echo "\n".$backgroundLayer_1."\n"?>
 	<?php echo "\n".$backgroundLayer_2."\n"?>
 	//var wms_osm = new OpenLayers.Layer.WMS( "OpenLayers WMS",
@@ -84,6 +95,7 @@
 	resetForm();
 	//start parsing when no empty string was found in input for url
 	if ($('#download_feed_url').val() != "") {
+		resetForm();
 		method =  "getServiceFeedObjectFromUrl";
         	data = $("#download_feed_url").val();
 		//call server by ajax function
@@ -98,6 +110,9 @@
 			//call server by ajax function
 			callServer(data,method);
     		});
+		$('#stop_parsing').click(function () {
+  			alert("test");
+		});
 	});
 	//don't show elements of dataset feed
 	//
@@ -107,6 +122,14 @@
 function callServer(data,method,id) {
 	if (id === undefined) id = 0;
 	//alert("ajax call begin");
+	if (method == "getServiceFeedObjectFromUrl") {
+		//$("#parse_service_feed_modal").toggle();
+		$("#loading_image_service").css("display","block");
+	}
+	if (method == "getDatasetFeedObjectFromUrl") {
+		//$("#parse_dataset_feed_modal").toggle();
+		$("#loading_image_dataset").css("display","block");
+	}
 	$.ajax({
   		url: '../plugins/mb_downloadFeedServer.php',
   		type: "post",
@@ -115,6 +138,11 @@
        		dataType: "json",
   		success: function(result) {
 			if (method == "getServiceFeedObjectFromUrl") {
+				//hide modal
+				//$("#parse_dataset_feed_modal").toggle();
+				$("#loading_image_service").css("display","none");
+				//select tab
+				$('#mytabs a[href="#dataset_info"]').tab('show');
 				//draw georss polygons from service feed 
 				drawMetadataPolygons(result);
 				//show datasets in a dropdown list
@@ -122,7 +150,12 @@
 			}
 			if (method == "getDatasetFeedObjectFromUrl") {
 				//function to draw bboxes of single link to data tile and the corresponding list of tiles 
-				//alert("ajax datasetfeed read!");				
+				//alert("ajax datasetfeed read!");	
+				//hide modal
+				//$("#parse_service_feed_modal").toggle();
+				$("#loading_image_dataset").css("display","none");
+				//select tab
+				$('#mytabs a[href="#representations"]').tab('show');
 				showDatasetEntryList(result, id);
 				
 			}
@@ -137,11 +170,15 @@
 	//don't show elements of dataset feed
 	$("#representation_select").css("display","none");
 	$("#representation_info").css("display","none");
+	$("#dataset_information").css("display","none");
 	$("#capabilities_hybrid").css("display","none");
 	//change size of outer fieldset
 	$("#client").css("height","450px");
 	$("#download_link_list").remove();
 	$("#download_link").remove();
+	//$('#dataset_select').remove();
+	$('.selectpicker').remove();
+	$('.selectpicker').selectpicker('refresh');
 		
 }
 
@@ -166,9 +203,9 @@
 	for(var i=0; i<featureCollection.features.length; ++i) {
 		//fill in first title, rights and abstract in fields
 		if (i == id) {
-			$('#dataset_title').val(featureCollection.features[i].properties.title);
-			$('#dataset_rights').val(featureCollection.features[i].properties.rights);
-			$('#dataset_abstract').val(featureCollection.features[i].properties.summary);
+			$('#dataset_title').append(featureCollection.features[i].properties.title);
+			$('#dataset_rights').append(featureCollection.features[i].properties.rights);
+			$('#dataset_abstract').append(featureCollection.features[i].properties.summary);
 			//add capabilities anchor
 			identifierAnchor =  $(document.createElement('a')).appendTo('#capabilities_hybrid');
 			identifierAnchor.attr({'id':'capabilities_link'});
@@ -189,6 +226,11 @@
 	
 	}
 	datasetSelect.append(selectOptions);
+	//datasetSelect.addClass('selectpicker');
+	//datasetSelect.attr({'data-style':'btn-primary'});
+	//datasetSelect.attr({'data-width':'auto'});
+	//$('.selectpicker').selectpicker('render');
+	$("#dataset_information").css("display","block");
 	//preselect option
 	$("#dataset_select option[optionid='" + id + "']").attr("selected","selected");
 	$('#dataset_select').bind('change', function() {
@@ -225,6 +267,10 @@
 		selectROptions = selectROptions+"<option value='"+i+"' url='"+featureCollection.features[i].properties.datasetFeedLink+"'>"+featureCollection.features[i].properties.title+"</option>";
 	}
 	datasetEntrySelect.append(selectROptions);
+	//datasetEntrySelect.addClass('selectpicker');
+	//datasetEntrySelect.attr({'data-style':'btn-primary'});
+	//datasetEntrySelect.attr({'data-width':'auto'});
+	//$('.selectpicker').selectpicker('render');
 	fillSectionList(featureCollection, id);
 	$('#dataset_representation_select').bind('change', function() {
     		var $this = $(this);



More information about the Mapbender_commits mailing list