svn commit: r454 - trunk/mapbender/http/javascripts
christoph at osgeo.org
christoph at osgeo.org
Wed Jun 14 10:41:56 EDT 2006
Author: christoph
Date: 2006-06-14 14:41:56+0000
New Revision: 454
Modified:
trunk/mapbender/http/javascripts/mod_digitize_tab.php
trunk/mapbender/http/javascripts/mod_geometryArray.js
trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
trunk/mapbender/http/javascripts/point.js
trunk/mapbender/http/javascripts/wfs.js
Log:
bugfix: bbox calculation now works.
Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_digitize_tab.php?view=diff&rev=454&p1=trunk/mapbender/http/javascripts/mod_digitize_tab.php&p2=trunk/mapbender/http/javascripts/mod_digitize_tab.php&r1=453&r2=454
==============================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php (original)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php 2006-06-14 14:41:56+0000
@@ -70,6 +70,14 @@
var mod_digitize_height;
var mod_digitizeEvent = false;
+var button_point = "Point";
+var button_line = "Line";
+var button_polygon = "Polygon";
+var button_move = "dragBasePoint";
+var button_insert = "setBasePoint";
+var button_delete = "delBasePoint";
+
+
try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
// ------------------------------------------------------------------------------------------------------------------------
@@ -373,7 +381,7 @@
divTag.setAttribute("id", "div_" + buttonDig_id[i]);
divTag.setAttribute("style", "position:absolute; top:"+buttonDig_y[i]+"; left:"+buttonDig_x[i]+";");
document.getElementById("digButtons").appendChild(divTag);
- var tagContent = "<img name=\""+buttonDig_id[i]+"\" onmouseover=\"parent.mb_regButton_frame('initDigButton', mod_digitize_elName, "+i+");\" id=\""+buttonDig_id[i]+"\" title=\""+buttonDig_titleUp[i]+"\" src=\""+dig_imgdir+buttonDig_src[i]+"\">";
+ var tagContent = "<img name=\""+buttonDig_id[i]+"\" onmouseover=\"parent.mb_regButton_frame('initDigButton', mod_digitize_elName, "+i+");\" id=\""+buttonDig_id[i]+"\" title=\""+buttonDig_title_off[i]+"\" src=\""+buttonDig_imgdir+buttonDig_src[i]+"\">";
parent.writeTag(mod_digitize_elName,"div_" + buttonDig_id[i],tagContent);
}
}
@@ -381,11 +389,11 @@
function initDigButton(ind, pos){
parent.mb_button[ind] = document.getElementById(buttonDig_id[pos]);
- parent.mb_button[ind].img_over = dig_imgdir+buttonDig_src[pos].replace(/_off/,"_over");
- parent.mb_button[ind].img_on = dig_imgdir+buttonDig_src[pos].replace(/_off/,"_on");
- parent.mb_button[ind].img_off = dig_imgdir+buttonDig_src[pos];
- parent.mb_button[ind].title_on = buttonDig_titleUp[pos];
- parent.mb_button[ind].title_off = buttonDig_titleDown[pos];
+ parent.mb_button[ind].img_over = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_over");
+ parent.mb_button[ind].img_on = buttonDig_imgdir + buttonDig_src[pos].replace(/_off/,"_on");
+ parent.mb_button[ind].img_off = buttonDig_imgdir + buttonDig_src[pos];
+ parent.mb_button[ind].title_on = buttonDig_title_on[pos];
+ parent.mb_button[ind].title_off = buttonDig_title_off[pos];
parent.mb_button[ind].status = 0;
parent.mb_button[ind].elName = buttonDig_id[pos];
parent.mb_button[ind].fName = "";
Modified: trunk/mapbender/http/javascripts/mod_geometryArray.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_geometryArray.js?view=diff&rev=454&p1=trunk/mapbender/http/javascripts/mod_geometryArray.js&p2=trunk/mapbender/http/javascripts/mod_geometryArray.js&r1=453&r2=454
==============================================================================
--- trunk/mapbender/http/javascripts/mod_geometryArray.js (original)
+++ trunk/mapbender/http/javascripts/mod_geometryArray.js 2006-06-14 14:41:56+0000
@@ -176,8 +176,8 @@
var pos = this.get(i).getBBox();
if (pos[0].x < min.x) {min.x = pos[0].x;}
if (pos[1].x > max.x) {max.x = pos[1].x;}
- if (pos[1].y > min.y) {min.y = pos[1].y;}
- if (pos[0].y < max.y) {max.y = pos[0].y;}
+ if (pos[1].y > max.y) {max.y = pos[1].y;}
+ if (pos[0].y < min.y) {min.y = pos[0].y;}
}
return new Array(min, max);
}
Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php?view=diff&rev=454&p1=trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php&p2=trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php&r1=453&r2=454
==============================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php (original)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php 2006-06-14 14:41:56+0000
@@ -59,6 +59,12 @@
var mod_wfs_spatialRequest_win = null;
var mod_wfs_spatialRequest_thema = false;
+var button_point = "point";
+var button_polygon = "polygon";
+var button_rectangle = "rectangle";
+var button_extent = "extent";
+var button_dialogue = "dialogue";
+
try{if(wfsResultToDigitize){wfsResultToDigitize=true;}}catch(e){wfsResultToDigitize=false;}
// ------------------------------------------------------------------------------------------
@@ -67,16 +73,16 @@
function displayButtons() {
for (var i = 0 ; i < buttonWfs_id.length ; i ++) {
if (parseInt(buttonWfs_on[i])==1) {
- document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_titleUp[i]+"\" src=\""+wfs_imgdir+buttonWfs_src[i]+"\"></div>");
+ document.write("<div id='div_"+buttonWfs_id[i]+"' style='position:absolute; top:"+buttonWfs_y[i]+"; left:"+buttonWfs_x[i]+"'><img name=\""+buttonWfs_id[i]+"\" onmouseover=\"mb_regButton_frame('initWfsButton', null, "+i+");\" id=\""+buttonWfs_id[i]+"\" title=\""+buttonWfs_title_off[i]+"\" src=\""+buttonWfs_imgdir+buttonWfs_src[i]+"\"></div>");
}
}
}
function initWfsButton(ind, pos) {
mb_button[ind] = document.getElementById(buttonWfs_id[pos]);
- mb_button[ind].img_over = wfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
- mb_button[ind].img_on = wfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
- mb_button[ind].img_off = wfs_imgdir + buttonWfs_src[pos];
+ mb_button[ind].img_over = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_over");
+ mb_button[ind].img_on = buttonWfs_imgdir + buttonWfs_src[pos].replace(/_off/,"_on");
+ mb_button[ind].img_off = buttonWfs_imgdir + buttonWfs_src[pos];
mb_button[ind].status = 0;
mb_button[ind].elName = buttonWfs_id[pos];
mb_button[ind].fName = "";
Modified: trunk/mapbender/http/javascripts/point.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/point.js?view=diff&rev=454&p1=trunk/mapbender/http/javascripts/point.js&p2=trunk/mapbender/http/javascripts/point.js&r1=453&r2=454
==============================================================================
--- trunk/mapbender/http/javascripts/point.js (original)
+++ trunk/mapbender/http/javascripts/point.js 2006-06-14 14:41:56+0000
@@ -64,15 +64,18 @@
var relation_px_y = mb_mapObj[ind].height / mb_mapObj[ind].width;
var relation_bbox_x = extent.x / extent.y;
+ var new_min;
+ var new_max;
+
if(relation_bbox_x <= relation_px_x){
- min = new Point(center.x - relation_px_x * extent.y / 2, min.y);
- max = new Point(center.x + relation_px_x * extent.y / 2, max.y);
+ new_min = new Point(center.x - relation_px_x * extent.y / 2, min.y);
+ new_max = new Point(center.x + relation_px_x * extent.y / 2, max.y);
}
else if(relation_bbox_x > relation_px_x){
- min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
- max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
+ new_min = new Point(min.x, center.y - relation_px_y * extent.x / 2);
+ new_max = new Point(max.x, center.y + relation_px_y * extent.x / 2);
}
- mb_mapObj[ind].extent = min.x +","+ min.y +","+ max.x +","+ max.y;
+ mb_mapObj[ind].extent = new_min.x +","+ new_min.y +","+ new_max.x +","+ new_max.y;
}
function cloneObject(a){
Modified: trunk/mapbender/http/javascripts/wfs.js
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/wfs.js?view=diff&rev=454&p1=trunk/mapbender/http/javascripts/wfs.js&p2=trunk/mapbender/http/javascripts/wfs.js&r1=453&r2=454
==============================================================================
--- trunk/mapbender/http/javascripts/wfs.js (original)
+++ trunk/mapbender/http/javascripts/wfs.js 2006-06-14 14:41:56+0000
@@ -331,8 +331,9 @@
mb_wfs_checkTag();
var tmp = m.getBBox();
var b = parseFloat(wfs_conf[m.wfs_conf]['g_buffer']);
- var buffer = new Point(b,b)
- mb_calcExtent(mb_wfs_targets[0],tmp[0].minus(buffer), tmp[1].plus(buffer));
+ var bbox_ll = new Point(tmp[0].x-b, tmp[0].y+b);
+ var bbox_ru = new Point(tmp[1].x+b, tmp[1].y-b);
+ mb_calcExtent(mb_wfs_targets[0],bbox_ll, bbox_ru);
zoom(mb_wfs_targets[0], 'true', 1.0);
if (!useCheckboxForHighlighting) {
mb_wfs_draw(m);
More information about the Mapbender_commits
mailing list