[Mapbender-commits] r10131 - in trunk/mapbender/http/extensions/mobilemap2: . scripts/netgis styles

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 23 01:42:37 PDT 2019


Author: armin11
Date: 2019-05-23 01:42:37 -0700 (Thu, 23 May 2019)
New Revision: 10131

Modified:
   trunk/mapbender/http/extensions/mobilemap2/index.html
   trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
   trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js
   trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
   trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/menu.js
   trunk/mapbender/http/extensions/mobilemap2/styles/common.css
   trunk/mapbender/http/extensions/mobilemap2/styles/manager.css
Log:
Some fixes from netgis - done in 12/2018

Modified: trunk/mapbender/http/extensions/mobilemap2/index.html
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/index.html	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/index.html	2019-05-23 08:42:37 UTC (rev 10131)
@@ -9,7 +9,6 @@
 
 	<head>
 		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
 		<meta name="viewport" content="width=device-width, initial-scale=1" />
 
 		<title>GeoPortal RLP</title>
@@ -228,10 +227,10 @@
 									
 									<ul class="nav nav-tabs nav-justified">
 										<li id="tab-layers-all" class="active">
-											<a href="#layer-list-all" data-toggle="tab"><span class="icon-left glyphicon glyphicon-folder-open"></span>Themen</a>
+											<a href="#layer-list-all" data-toggle="tab"><span class="icon-left glyphicon glyphicon-folder-open"></span> Themen</a>
 										</li>
 										<li id="tab-layers-map">
-											<a href="#layer-list-map" data-toggle="tab"><span class="icon-left glyphicon glyphicon-eye-open"></span>Karte</a>
+											<a href="#layer-list-map" data-toggle="tab"><span class="icon-left glyphicon glyphicon-eye-open"></span> Karte</a>
 										</li>
 									</ul>
 									
@@ -362,6 +361,7 @@
 					<span class="icon-folder glyphicon glyphicon-folder-open"></span>
 					<span data-content="title"></span>
 					<span class="pull-right">
+						<span class="btn-remove-group glyphicon glyphicon-remove" title="Dienst entfernen"></span>
 						<span class="icon-right glyphicon glyphicon-chevron-down"></span>
 					</span>
 				</a>
@@ -385,7 +385,7 @@
 		</script>
 		
 		<script type="text/html" id="layer-result-template">
-			<div href="#" class="list-group-item" data-template-bind='{ "attribute": "data-index", "value": "index" }'>
+			<div class="list-group-item" data-template-bind='{ "attribute": "data-index", "value": "index" }'>
 				<h4 class="list-group-item-heading clickable">
 					<span class="icon-folder glyphicon glyphicon-folder-open"></span>
 					<span class="result-item-title" data-content="title"></span>
@@ -452,4 +452,4 @@
 		
 	</body>
 
-</html>
+</html>
\ No newline at end of file

Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js	2019-05-23 08:42:37 UTC (rev 10131)
@@ -18,7 +18,8 @@
 	INITIAL_CENTER_X:		385000,
 	/** Initial map center coordinate y in main map projection. */
 	INITIAL_CENTER_Y:		5543000,
-	
+	/** Minimum scale to zoom to place search result.  */
+	MIN_SEARCH_SCALE:		3000,
 	/** Initial map zoom scale (e.g. 10000 = 1:10000). */
 	INITIAL_SCALE:			1500000,
 	MAP_SCALES:				[ 500, 1000, 3000, 5000, 8000, 10000, 15000, 25000, 50000, 100000, 150000, 250000, 500000, 1000000, 1500000, 2000000 ],

Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js	2019-05-23 08:42:37 UTC (rev 10131)
@@ -245,6 +245,7 @@
 				layerList.find( ".btn-group" ).click( onGroupClick );
 				
 				layerList.find( ".btn-remove" ).click( onLayerRemoveClick );
+				layerList.find( ".btn-remove-group" ).click( onGroupRemoveClick );
 			}
 			
 			layerCount.text( count );
@@ -412,6 +413,23 @@
 			updateMapLayers();
 		};
 		
+		var onGroupRemoveClick = function( evt )
+		{
+			evt.preventDefault();
+			evt.stopPropagation();
+			
+			var item = $( evt.target ).closest( "[data-id]" );
+			var children = item.next( ".child-container" ).find( ".btn-layer" );
+			
+			for ( var i = 0; i < children.length; i++ )
+			{
+				var child = $( children[ i ] );
+				var id = child.data( "id" );
+				
+				netgis.events.call( netgis.events.LAYER_REMOVE, { id: id } );
+			}
+		};
+		
 		var onLayerRemoveClick = function( event )
 		{
 			event.stopPropagation();
@@ -602,7 +620,17 @@
 				var count = recursive( layer );
 				
 				var rows = "";
-				for ( var c = 0; c < children.length; c++ ) rows += "<tr><td>" + children[ c ].title + "</td></tr>";
+				for ( var c = 0; c < children.length; c++ )
+				{
+					var child = "<tr class='layer-result-child' data-layer-id='" + children[ c ].id + "'>";
+					child += "<td>";
+					child += children[ c ].title;
+					child += "<span class='btn-add pull-right glyphicon glyphicon-plus'></span>";
+					child += "</td>";
+					child += "</tr>";
+					
+					rows += child;
+				}
 				
 				// Add to list
 				var item =
@@ -618,9 +646,12 @@
 				layerResultsList.loadTemplate( $( "#layer-result-template" ), item, { append: true } );
 			}
 			
+			//TODO: add click handler for layer result child
+			
 			layerResultsCount.text( searchResults.length );
 			
 			layerResultsList.find( ".list-group-item-heading" ).click( onResultClick );
+			layerResultsList.find( ".layer-result-child" ).click( onResultChildClick );
 			layerResultsList.find( ".collapser" ).click( onResultDetailsClick );
 			
 			searchButton.find( "i" ).toggleClass( "hidden" );
@@ -647,13 +678,10 @@
 			var index = item.parent().data( "index" );
 			
 			var result = searchResults[ index ];
-		   
-			var service = result;
 				
 			// Service Group Layer
+			var service = result;
 			var serviceEntity = netgis.layers.createService( service, true );
-			
-			console.info( service );
 
 			// Service Layers
 			for ( var i = 0; i < service.layer.length; i++ )
@@ -702,6 +730,100 @@
 			layerContainer.collapse( "show" );
 		};
 		
+		var onResultChildClick = function( evt )
+		{
+			evt.preventDefault();
+			evt.stopPropagation();
+			
+			netgis.events.call( netgis.events.LAYERS_LOADING, { loading: true } );
+			
+			var item = $( this );
+			var index = item.closest( ".list-group-item" ).data( "index" );
+			
+			var result = searchResults[ index ];
+			
+			// Service Group Layer
+			var service = result;
+			var serviceEntity = netgis.layers.createService( service, true );
+			
+			// Child Layer
+			var id = parseInt( item.data( "layer-id" ) );
+			
+			// Service Layers
+			for ( var i = 0; i < service.layer.length; i++ )
+			{
+				var layer = service.layer[ i ];
+				
+				var layerEntity = serviceEntity;
+				
+				if ( parseInt( layer.id ) === id )
+				{
+					layerEntity = netgis.layers.createLayer( layer, serviceEntity, true );
+					break;
+				}
+				
+				//TODO: recursive layer adding, move to layers module
+
+				// Child Layers
+				if ( layer.layer )
+				{
+					for ( var j = 0; j < layer.layer.length; j++ )
+					{
+						var child = layer.layer[ j ];
+						
+						var childEntity = layerEntity;
+						
+						if ( parseInt( child.id ) === id )
+						{
+							childEntity = netgis.layers.createLayer( child, layerEntity, true );
+							break;
+						}
+						
+						if ( child.layer )
+						{
+							for ( var k = 0; k < child.layer.length; k++ )
+							{
+								var child2 = child.layer[ k ];
+								
+								var child2Entity = childEntity;
+								
+								if ( parseInt( child2.id ) === id )
+								{
+									child2Entity = netgis.layers.createLayer( child2, childEntity, true );
+									break;
+								}
+								
+								if ( child2.layer )
+								{
+									for ( var m = 0; m < child2.layer.length; m++ )
+									{
+										var child3 = child2.layer[ m ];
+										
+										var child3Entity = child2Entity;
+										
+										if ( parseInt( child3.id ) === id )
+										{
+											child3Entity = netgis.layers.createLayer( child3, child2Entity, true );
+											break;
+										}
+									}
+									
+								}
+							}
+							
+						}
+					}
+					
+				}
+				
+			}
+			
+			netgis.events.call( netgis.events.LAYERS_LOADING, { loading: false } );
+			
+			layerResultsPanel.collapse( "hide" );
+			layerContainer.collapse( "show" );
+		};
+		
 		// Public Interface
 		var iface =
 		{

Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js	2019-05-23 08:42:37 UTC (rev 10131)
@@ -961,8 +961,7 @@
 							view.getResolution(),
 							netgis.config.MAP_PROJECTION,
 							{
-								"INFO_FORMAT": "text/html", //"text/plain" //"text/javascript" //"application/json" //"text/html",
-								"FEATURE_COUNT": 100
+								"INFO_FORMAT": "text/html" //"text/plain" //"text/javascript" //"application/json" //"text/html",
 							}
 						);
 				
@@ -1455,4 +1454,4 @@
 		
 		return iface;
 	}
-)();
+)();
\ No newline at end of file

Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/menu.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/menu.js	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/menu.js	2019-05-23 08:42:37 UTC (rev 10131)
@@ -6,7 +6,7 @@
 
 /**
  * The NetGIS Menu module.
- * @namespace 
+ * @namespace
  */
 netgis.menu =
 (
@@ -714,4 +714,4 @@
 		
 		return iface;
 	}
-)();
+)();
\ No newline at end of file

Modified: trunk/mapbender/http/extensions/mobilemap2/styles/common.css
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/styles/common.css	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/styles/common.css	2019-05-23 08:42:37 UTC (rev 10131)
@@ -55,6 +55,11 @@
     margin-right: 0.5em;
 }
 
+.icon-right
+{
+    margin-left: 0.5em;
+}
+
 .icon-folder
 {
 	margin-right: 0.5em;

Modified: trunk/mapbender/http/extensions/mobilemap2/styles/manager.css
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/styles/manager.css	2019-05-21 10:13:39 UTC (rev 10130)
+++ trunk/mapbender/http/extensions/mobilemap2/styles/manager.css	2019-05-23 08:42:37 UTC (rev 10131)
@@ -27,6 +27,11 @@
 	color: red;
 }
 
+.layer-list .btn-remove-group
+{
+	color: red;
+}
+
 .layer-list .btn-up
 {
 	color: blue;
@@ -89,4 +94,24 @@
 {
 	vertical-align: middle;
 	margin-top: -0.6em;
+}
+
+#layer-results .layer-result-child
+{
+	cursor: pointer;
+}
+
+#layer-results .layer-result-child:hover
+{
+	background-color: #e0e0e0;
+}
+
+#layer-results .layer-result-child .btn-add
+{
+	display: none;
+}
+
+#layer-results .layer-result-child:hover .btn-add
+{
+	display: initial;
 }
\ No newline at end of file



More information about the Mapbender_commits mailing list