[Mapbender-commits] r9886 - trunk/mapbender/http/extensions/mobilemap2/scripts/netgis
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Mar 20 01:40:34 PDT 2018
Author: armin11
Date: 2018-03-20 01:40:33 -0700 (Tue, 20 Mar 2018)
New Revision: 9886
Modified:
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js
trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
Log:
New possibilities for mobilemap2 - set default opacity for overlay layers, option to open featureinfo in new tab, featureinfo proxy to solve http/https problems. thanx to sebastian pauli ;-)
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js 2018-03-19 16:38:14 UTC (rev 9885)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/config.js 2018-03-20 08:40:33 UTC (rev 9886)
@@ -36,10 +36,13 @@
/** Map extent (min x, min y, max x, max y). */
MAP_EXTENT: [ 293300, 5424000, 464300, 5654100 ],
+ /** Default map layer opacity (0.0 - 1.0). */
+ MAP_DEFAULT_OPACITY: 0.8,
+
/** Maximum number of map view history entries. */
MAX_HISTORY: 10,
- /** Service URLs. */
+ /** Service URLs (avoid proxies by setting to null or empty string). */
URL_WMC_PROXY: "./scripts/proxy.php",
URL_WMC_REQUEST: "http://www.geoportal.rlp.de/mapbender/php/mod_exportWmc2Json.php",
@@ -50,5 +53,7 @@
URL_SEARCH_REQUEST: "http://www.geoportal.rlp.de/mapbender/geoportal/gaz_geom_mobile.php",
URL_BACKGROUND_HYBRID: "http://www.gdi-rp-dienste2.rlp.de/mapcache/tms/1.0.0/test@UTM32",
- URL_BACKGROUND_AERIAL: "http://geo4.service24.rlp.de/wms/dop_basis.fcgi"
+ URL_BACKGROUND_AERIAL: "http://geo4.service24.rlp.de/wms/dop_basis.fcgi",
+
+ URL_FEATURE_INFO_PROXY: "./scripts/proxy.php"
};
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js 2018-03-19 16:38:14 UTC (rev 9885)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/layers.js 2018-03-20 08:40:33 UTC (rev 9886)
@@ -72,7 +72,7 @@
netgis.config.URL_WMC_PROXY,
{
//q: encodeURI( "http://www.geoportal.rlp.de/mapbender/php/mod_exportWmc2Json.php?wmc_id=" + id + "&epsg=" + netgis.config.MAP_PROJECTION.split( ":" )[ 1 ] + "&withHierarchy=1" )
- q: encodeURI( url )
+ q: encodeURIComponent( url )
},
onWmcResponse
);
@@ -101,7 +101,7 @@
netgis.config.URL_LAYERS_PROXY,
{
//q: encodeURI( "http://www.geoportal.rlp.de/mapbender/extensions/mobilemap/mod_mapbender/search_proxy.php?languageCode=de&resultTarget=web&maxResults=40&resourceIds=" + ids.join( "," ) )
- q: encodeURI( url )
+ q: encodeURIComponent( url )
},
onLayersResponse
);
Modified: trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js
===================================================================
--- trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js 2018-03-19 16:38:14 UTC (rev 9885)
+++ trunk/mapbender/http/extensions/mobilemap2/scripts/netgis/map.js 2018-03-20 08:40:33 UTC (rev 9886)
@@ -651,7 +651,8 @@
(
{
source: source,
- zIndex: index
+ zIndex: index,
+ opacity: netgis.config.MAP_DEFAULT_OPACITY
}
);
@@ -916,7 +917,7 @@
view.getResolution(),
netgis.config.MAP_PROJECTION,
{
- "INFO_FORMAT": "text/html" //"text/plain" //"text/javascript" //"application/json" //"text/html"
+ "INFO_FORMAT": "text/html" //"text/plain" //"text/javascript" //"application/json" //"text/html",
}
);
@@ -931,12 +932,17 @@
content += "<div class='panel panel-primary'>";
content += "<div class='panel-heading clickable' data-toggle='collapse' data-target='#" + panelId + "'>";
- content += "<h4 class='panel-title'>" + layer.components.title.value + "</h4>";
+ content += "<h4 class='panel-title'>" + layer.components.title.value + "<span class='pull-right glyphicon glyphicon-share' title='In neuem Tab öffnen'></span></h4>";
content += "</div>";
+
+ var frame_url = url;
+
+ if ( netgis.config.URL_FEATURE_INFO_PROXY && netgis.config.URL_FEATURE_INFO_PROXY.length > 0 )
+ frame_url = netgis.config.URL_FEATURE_INFO_PROXY + "?q=" + encodeURIComponent( url );
content += "<div id='" + panelId + "' class='panel-collapse collapse'>";
content += "<div class='panel-body'>";
- content += "<iframe seamless width='280' height='100' src='" + url + "'></iframe>";
+ content += "<iframe seamless width='280' height='100' src='" + frame_url + "'></iframe>";
content += "</div>";
content += "</div>";
@@ -945,8 +951,19 @@
content += "</div>";
var element = $( content );
- element.find( ".panel-heading" ).click( function() { element.find( "#" + panelId ).collapse( "toggle" ); } );
+ var heading = element.find( ".panel-heading" );
+ heading.click( function() { element.find( "#" + panelId ).collapse( "toggle" ); } );
+ heading.find( ".pull-right" ).click
+ (
+ function( evt )
+ {
+ evt.stopPropagation();
+ window.open( url, "_blank" );
+ }
+ );
+
+
popupContent.append( element );
}
}
@@ -1005,6 +1022,7 @@
}
),
zIndex: 999,
+ opacity: netgis.config.MAP_DEFAULT_OPACITY,
style: onKmlStyle
}
);
More information about the Mapbender_commits
mailing list