[Mapbender-commits] r9885 - in trunk/mapbender/http/extensions/mobilemap2: . scripts/netgis
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Mar 19 09:38:14 PDT 2018
Author: armin11
Date: 2018-03-19 09:38:14 -0700 (Mon, 19 Mar 2018)
New Revision: 9885
Modified:
trunk/mapbender/http/extensions/mobilemap2/index.html
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/component.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/events.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
Log:
New possibilities for mobilemap component from sebastian pauli
Modified: trunk/mapbender/http/extensions/mobilemap2/index.html
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/index.html 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/index.html 2018-03-19 16:38:14 UTC (rev 9885)
@@ -365,8 +365,9 @@
<span class="icon-left glyphicon glyphicon-check"></span>
<span data-content="title"></span>
<span class="pull-right">
- <span class="btn-up glyphicon glyphicon-arrow-up"></span>
- <span class="btn-down glyphicon glyphicon-arrow-down"></span>
+ <span class="btn-zoom glyphicon glyphicon-fullscreen" title="Zoom"></span>
+ <span class="btn-up glyphicon glyphicon-arrow-up" title="Rauf"></span>
+ <span class="btn-down glyphicon glyphicon-arrow-down" title="Runter"></span>
</span>
</a>
</div>
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/component.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/component.js 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/component.js 2018-03-19 16:38:14 UTC (rev 9885)
@@ -132,3 +132,16 @@
};
netgis.component.KML.prototype.name = "kml";
+
+/** Extent */
+netgis.component.Extent = function( minx, miny, maxx, maxy )
+{
+ this.minx = minx;
+ this.miny = miny;
+ this.maxx = maxx;
+ this.maxy = maxy;
+
+ return this;
+};
+
+netgis.component.Extent.prototype.name = "extent";
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/events.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/events.js 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/events.js 2018-03-19 16:38:14 UTC (rev 9885)
@@ -129,6 +129,7 @@
LAYER_REMOVE: "layer-remove",
LAYER_MOVE_UP: "layer-move-up",
LAYER_MOVE_DOWN: "layer-move-down",
+ LAYER_ZOOM: "layer-zoom",
POSITION_TOGGLE: "position-toggle",
POSITION_CENTER: "position-center",
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js 2018-03-19 16:38:14 UTC (rev 9885)
@@ -16,6 +16,7 @@
// Private Variables
//var layerList;
+ var singleLayerRequest = null;
// Private Methods
var init = function()
@@ -43,7 +44,15 @@
else
{
netgis.events.call( netgis.events.LAYERS_LOADING, { loading: true } );
- netgis.events.call( netgis.events.LAYERS_LOADING, { loading: false } );
+
+ // Request Layer
+ if ( params.layerid )
+ {
+ singleLayerRequest = parseInt( params.layerid );
+ requestLayers( [ params.layerid ] );
+ }
+ else
+ netgis.events.call( netgis.events.LAYERS_LOADING, { loading: false } );
}
};
@@ -137,6 +146,16 @@
if ( layerData.layerQueryable === 1 || layerData.queryable === 1 ) //NOTE: these two props should have the same name!
entity.set( new netgis.component.Queryable() );
+ if ( layerData.bbox )
+ {
+ var bbox = layerData.bbox.split( "," );
+
+ for ( var i = 0; i < bbox.length; i++ )
+ bbox[ i ] = parseFloat( bbox[ i ] );
+
+ entity.set( new netgis.component.Extent( bbox[ 0 ], bbox[ 1 ], bbox[ 2 ], bbox[ 3 ] ) );
+ }
+
return entity;
};
@@ -278,6 +297,22 @@
}
netgis.events.call( netgis.events.LAYERS_LOADING, { loading: false } );
+
+ // Single Layer Request
+ if ( singleLayerRequest )
+ {
+ var results = netgis.entities.find( netgis.component.Layer, "id", singleLayerRequest );
+
+ if ( results.length > 0 )
+ {
+ var layer = results[ 0 ];
+
+ layer.toggle( netgis.component.Active );
+
+ netgis.events.call( netgis.events.LAYER_TOGGLE, { id: layer.id } );
+ netgis.events.call( netgis.events.LAYER_ZOOM, { id: layer.id } );
+ }
+ }
};
var onLayerToggle = function( params )
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/manager.js 2018-03-19 16:38:14 UTC (rev 9885)
@@ -136,6 +136,7 @@
layerListMap.find( ".btn-layer" ).click( onLayerClick );
layerListMap.find( ".btn-up" ).click( onLayerUpClick );
layerListMap.find( ".btn-down" ).click( onLayerDownClick );
+ layerListMap.find( ".btn-zoom" ).click( onLayerZoomClick );
updateMapLayerOrder();
};
@@ -459,6 +460,16 @@
//TODO: bug when moving background layer down
};
+ var onLayerZoomClick = function( event )
+ {
+ event.stopPropagation();
+ event.preventDefault();
+
+ var id = $( event.target ).closest( "[data-id]" ).data( "id" );
+
+ netgis.events.call( netgis.events.LAYER_ZOOM, { id: id } );
+ };
+
var onLayerMoveUp = function( event )
{
var item = layerListMap.find( "#" + event.id );
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js 2018-03-16 11:23:40 UTC (rev 9884)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js 2018-03-19 16:38:14 UTC (rev 9885)
@@ -313,6 +313,7 @@
netgis.events.on( netgis.events.LAYER_REMOVE, onLayerRemove );
netgis.events.on( netgis.events.LAYER_MOVE_UP, onLayerMoveUp );
netgis.events.on( netgis.events.LAYER_MOVE_DOWN, onLayerMoveDown );
+ netgis.events.on( netgis.events.LAYER_ZOOM, onLayerZoom );
netgis.events.on( netgis.events.POSITION_TOGGLE, onPositionToggle );
netgis.events.on( netgis.events.POSITION_CENTER, onPositionCenter );
@@ -876,7 +877,7 @@
content += "<div class='panel panel-primary'>";
content += "<div class='panel-heading clickable' data-toggle='collapse' data-target='#" + panelId + "'>";
- content += "<h4 class='panel-title'>" + "KML Feature" + "</h4>";
+ content += "<h4 class='panel-title'>" + "Zeichnungsobjekt" + "</h4>";
content += "</div>";
content += "<div id='" + panelId + "' class='panel-collapse collapse'>";
@@ -1166,6 +1167,24 @@
}
};
+ var onLayerZoom = function( event )
+ {
+ var layer = netgis.entities.get( event.id );
+ var extent = layer.get( netgis.component.Extent );
+
+ if ( extent )
+ {
+ var min = ol.proj.fromLonLat( [ extent.minx, extent.miny ], netgis.config.MAP_PROJECTION );
+ var max = ol.proj.fromLonLat( [ extent.maxx, extent.maxy ], netgis.config.MAP_PROJECTION );
+
+ viewExtent( min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] );
+ }
+ else
+ {
+ viewExtent( netgis.config.MAP_EXTENT[ 0 ], netgis.config.MAP_EXTENT[ 1 ], netgis.config.MAP_EXTENT[ 2 ], netgis.config.MAP_EXTENT[ 3 ] );
+ }
+ };
+
var onPositionToggle = function( params )
{
positionActive = params.active;
More information about the Mapbender_commits
mailing list