[Mapbender-commits] r9570 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Sep 2 05:35:17 PDT 2016
Author: armin11
Date: 2016-09-02 05:35:17 -0700 (Fri, 02 Sep 2016)
New Revision: 9570
Modified:
trunk/mapbender/http/javascripts/map_obj.js
trunk/mapbender/http/javascripts/wms.js
Log:
New functions for support of wms dimension parameters
Modified: trunk/mapbender/http/javascripts/map_obj.js
===================================================================
--- trunk/mapbender/http/javascripts/map_obj.js 2016-09-02 09:57:52 UTC (rev 9569)
+++ trunk/mapbender/http/javascripts/map_obj.js 2016-09-02 12:35:17 UTC (rev 9570)
@@ -914,6 +914,16 @@
if (currentWms.gui_wms_sldurl !== "") {
url += "&SLD=" + escape(currentWms.gui_wms_sldurl) + "&";
}
+ //TODO 2016 armin add optional dimension parameter values
+ //if (currentWms.gui_wms_dimension_time !== false && currentWms.gui_wms_dimension_time !== "") {
+ // alert(currentWms.gui_wms_dimension_time);
+ //}
+ if (currentWms.gui_wms_dimension_time !== false && currentWms.gui_wms_dimension_time !== "") {
+ url += "&TIME="+encodeURI(currentWms.gui_wms_dimension_time);
+ }
+ if (currentWms.gui_wms_dimension_elevation !== false && currentWms.gui_wms_dimension_elevation !== "") {
+ url += "&ELEVATION="+encodeURI(currentWms.gui_wms_dimension_elevation);
+ }
//remove the last ampersant (&) of the mapurl
url = url.substr(0, url.length - 1);
Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js 2016-09-02 09:57:52 UTC (rev 9569)
+++ trunk/mapbender/http/javascripts/wms.js 2016-09-02 12:35:17 UTC (rev 9570)
@@ -43,7 +43,9 @@
gui_wms_epsg,
gui_wms_visible,
gui_wms_opacity,
- gui_wms_sldurl){
+ gui_wms_sldurl,
+ gui_wms_dimension_time,
+ gui_wms_dimension_elevation){
wms[wms.length] = new wms_const(
wms_id,
wms_version,
@@ -59,7 +61,9 @@
gui_wms_epsg,
parseInt(gui_wms_visible, 10),
parseInt(gui_wms_opacity),
- gui_wms_sldurl);
+ gui_wms_sldurl,
+ gui_wms_dimension_time,
+ gui_wms_dimension_elevation);
wms_layer[wms.length - 1] = [];
}
/**
@@ -81,6 +85,8 @@
* @param {String} gui_wms_visible the visibility of this service
* @param {Integer} gui_wms_opacity the initial display opacity in percent
* @param {String} gui_wms_sldurl url to an actual sld
+ * @param {String} gui_wms_dimension_time value for optional dimension parameter time
+ * @param {String} gui_wms_dimension_elevation value for optional dimension parameter elevation
*
*/
function wms_const(
@@ -98,7 +104,10 @@
gui_wms_epsg,
gui_wms_visible,
gui_wms_opacity,
- gui_wms_sldurl){
+ gui_wms_sldurl,
+ gui_wms_dimension_time,
+ gui_wms_dimension_elevation
+){
if (!wms_id) {
var id_ok = false;
@@ -140,7 +149,10 @@
// opacity version
this.gui_wms_mapopacity = gui_wms_opacity/100;
// sld version
- this.gui_wms_sldurl = gui_wms_sldurl;
+ this.gui_wms_sldurl = gui_wms_sldurl;
+ //optional dimension parameters
+ this.gui_wms_dimension_time = gui_wms_dimension_time;
+ this.gui_wms_dimension_elevation = gui_wms_dimension_elevation;
this.setCrs = function (options) {
var crsIndex = $.inArray(options.source.srsCode, this.gui_epsg);
@@ -267,8 +279,15 @@
rq += "&FEATURE_COUNT="+mb_feature_count;
}
rq += "&";
+ var currentWms = this;
+ //TODO 2016 arminadd optional dimension parameters
+ if (this.gui_wms_dimension_time !== false && this.gui_wms_dimension_time !== "") {
+ rq += "&TIME="+encodeURI(gui_wms_dimension_time);
+ }
+ if (this.gui_wms_dimension_elevation !== false && this.gui_wms_dimension_elevation !== "") {
+ rq += "&ELEVATION="+encodeURI(gui_wms_dimension_elevation);
+ }
// add vendor-specific
- var currentWms = this;
for (var v = 0; v < mb_vendorSpecific.length; v++) {
var functionName = 'setFeatureInfoRequest';
var currentWms_wms_title = this.wms_title;
More information about the Mapbender_commits
mailing list