[Mapbender-commits] r4574 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Aug 28 10:26:02 EDT 2009
Author: christoph
Date: 2009-08-28 10:26:02 -0400 (Fri, 28 Aug 2009)
New Revision: 4574
Modified:
trunk/mapbender/http/javascripts/wms.js
Log:
Modified: trunk/mapbender/http/javascripts/wms.js
===================================================================
--- trunk/mapbender/http/javascripts/wms.js 2009-08-28 14:25:49 UTC (rev 4573)
+++ trunk/mapbender/http/javascripts/wms.js 2009-08-28 14:26:02 UTC (rev 4574)
@@ -129,6 +129,7 @@
this.gui_wms_epsg = gui_wms_epsg;
this.gui_wms_visible = gui_wms_visible;
this.gui_epsg = [];
+ this.gui_epsg_supported = [];
this.gui_minx = [];
this.gui_miny = [];
this.gui_maxx = [];
@@ -137,9 +138,43 @@
// 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;
}
+wms_const.prototype.getBoundingBoxBySrs = function (srs) {
+ for (var i = 0; i < this.gui_epsg.length; i++) {
+ if (srs == this.gui_epsg[i]) {
+ var bbox_minx = parseFloat(this.gui_minx[i]);
+ var bbox_miny = parseFloat(this.gui_miny[i]);
+ var bbox_maxx = parseFloat(this.gui_maxx[i]);
+ var bbox_maxy = parseFloat(this.gui_maxy[i]);
+ if (bbox_minx !== null && bbox_miny !== null && bbox_maxx !== null && bbox_maxy !== null) {
+ return new Extent(bbox_minx, bbox_miny, bbox_maxx, bbox_maxy);
+ }
+ }
+ }
+ return null;
+};
+
+wms_const.prototype.setBoundingBoxBySrs = function (srs, ext) {
+ for (var i = 0; i < this.gui_epsg.length; i++) {
+ if (srs == this.gui_epsg[i]) {
+ this.gui_minx[i] = parseFloat(ext.minx);
+ this.gui_miny[i] = parseFloat(ext.miny);
+ this.gui_maxx[i] = parseFloat(ext.maxx);
+ this.gui_maxy[i] = parseFloat(ext.maxy);
+ return i;
+ }
+ }
+ this.gui_epsg.push(srs);
+ this.gui_epsg_supported.push(false);
+ this.gui_minx.push(ext.minx);
+ this.gui_miny.push(ext.miny);
+ this.gui_maxx.push(ext.maxx);
+ this.gui_maxy.push(ext.maxy);
+ return this.gui_epsg.length - 1;
+};
+
/**
* rephrases the mapRequest
*
@@ -634,6 +669,7 @@
}
function wms_addSRS(epsg,minx,miny,maxx,maxy){
wms[wms.length-1].gui_epsg[wms[wms.length-1].gui_epsg.length] = epsg;
+ wms[wms.length-1].gui_epsg_supported[wms[wms.length-1].gui_epsg_supported.length] = true;
wms[wms.length-1].gui_minx[wms[wms.length-1].gui_minx.length] = minx;
wms[wms.length-1].gui_miny[wms[wms.length-1].gui_miny.length] = miny;
wms[wms.length-1].gui_maxx[wms[wms.length-1].gui_maxx.length] = maxx;
More information about the Mapbender_commits
mailing list