[Mapbender-commits] r3644 - in trunk/mapbender: conf
http/img/button_digitize http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Mar 6 11:00:41 EST 2009
Author: christoph
Date: 2009-03-06 11:00:41 -0500 (Fri, 06 Mar 2009)
New Revision: 3644
Added:
trunk/mapbender/http/img/button_digitize/punchPolygon_off.png
trunk/mapbender/http/img/button_digitize/punchPolygon_on.png
trunk/mapbender/http/img/button_digitize/punchPolygon_over.png
Modified:
trunk/mapbender/conf/digitize_default.conf
trunk/mapbender/conf/wfs_default.conf
trunk/mapbender/http/img/button_digitize/mergePolygons_off.png
trunk/mapbender/http/img/button_digitize/mergePolygons_on.png
trunk/mapbender/http/img/button_digitize/mergePolygons_over.png
trunk/mapbender/http/javascripts/map.php
trunk/mapbender/http/javascripts/mapnf.php
trunk/mapbender/http/javascripts/mod_digitize_tab.php
trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
trunk/mapbender/http/javascripts/ovnf.php
Log:
* icons for merge and cut polygon
* remove original polygons after cutting/merging/splitting
* bug fixing spatial request: toDigitize/popup
Modified: trunk/mapbender/conf/digitize_default.conf
===================================================================
--- trunk/mapbender/conf/digitize_default.conf 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/conf/digitize_default.conf 2009-03-06 16:00:41 UTC (rev 3644)
@@ -10,9 +10,9 @@
addButtonDig("setBasePoint", 1, "new_node_off.png", "", "", 112, 0);
addButtonDig("delBasePoint", 1, "delete_node_off.png", "", "", 140, 0);
addButtonDig("clear", 1, "del_off.png", "", "", 168, 0);
-addButtonDig("digitizeDifference", 0, "splitPolygon_off.png", "", "", 0, 28);
-addButtonDig("digitizeSplit", 0, "splitPolygon_off.png", "", "", 28, 28);
-addButtonDig("digitizeMerge", 0, "mergePolygons_off.png", "", "", 56, 28);
+addButtonDig("digitizeSplit", 1, "splitPolygon_off.png", "", "", 0, 28);
+addButtonDig("digitizeDifference", 1, "punchPolygon_off.png", "", "", 28, 28);
+addButtonDig("digitizeMerge", 1, "mergePolygons_off.png", "", "", 56, 28);
//definition of directory of digitize buttons
buttonDig_imgdir = "../img/button_digitize/";
@@ -58,4 +58,5 @@
var wfsWindowWidth = 400;
var wfsWindowHeight = 300;
-var spatialRequestResultToDigitize = 1;
\ No newline at end of file
+// deprecated! check wfs_default.conf to configure this behaviour
+//var spatialRequestResultToDigitize = 1;
\ No newline at end of file
Modified: trunk/mapbender/conf/wfs_default.conf
===================================================================
--- trunk/mapbender/conf/wfs_default.conf 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/conf/wfs_default.conf 2009-03-06 16:00:41 UTC (rev 3644)
@@ -19,7 +19,9 @@
var buttonWfs_imgdir = "../img/button_gray/";
var buttonWfs_zIndex = 10;
-var buttonWfs_toDigitize_on = 1;
+// if wfsResultToPopupDiv is 0, this is automatically 1
+var buttonWfs_toDigitize_on = 1;
+var buttonWfs_toDigitize_target = "digitize";
var buttonWfs_toDigitize_src = "../img/pencil.png";
var generalHighlightZIndex = 90;
Modified: trunk/mapbender/http/img/button_digitize/mergePolygons_off.png
===================================================================
(Binary files differ)
Modified: trunk/mapbender/http/img/button_digitize/mergePolygons_on.png
===================================================================
(Binary files differ)
Modified: trunk/mapbender/http/img/button_digitize/mergePolygons_over.png
===================================================================
(Binary files differ)
Added: trunk/mapbender/http/img/button_digitize/punchPolygon_off.png
===================================================================
(Binary files differ)
Property changes on: trunk/mapbender/http/img/button_digitize/punchPolygon_off.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/mapbender/http/img/button_digitize/punchPolygon_on.png
===================================================================
(Binary files differ)
Property changes on: trunk/mapbender/http/img/button_digitize/punchPolygon_on.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/mapbender/http/img/button_digitize/punchPolygon_over.png
===================================================================
(Binary files differ)
Property changes on: trunk/mapbender/http/img/button_digitize/punchPolygon_over.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/mapbender/http/javascripts/map.php
===================================================================
--- trunk/mapbender/http/javascripts/map.php 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/http/javascripts/map.php 2009-03-06 16:00:41 UTC (rev 3644)
@@ -77,7 +77,8 @@
$extPath = dirname(__FILE__) . "/../extensions/";
$extFileArray = array( "jquery-1.2.6.min.js",
"jqjson.js",
- "jquery.mousewheel.min.js");
+ "jquery.mousewheel.min.js",
+ "jquery.form.js");
for ($i = 0; $i < count($extFileArray); $i++) {
$currentFile = $extPath . $extFileArray[$i];
@@ -163,6 +164,8 @@
$e_src = $row_js["e_src"];
$e_require = $row_js["e_requires"];
$e_target = explode(",",$row_js["e_target"]);
+ $e_width = intval($row_js["e_width"]);
+ $e_height = intval($row_js["e_height"]);
$currentFile = trim($jsArray[$i]);
if (file_exists($currentFile)) {
if (in_array($e_id, $modulesNotRelyingOnGlobalsArray)) {
Modified: trunk/mapbender/http/javascripts/mapnf.php
===================================================================
--- trunk/mapbender/http/javascripts/mapnf.php 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/http/javascripts/mapnf.php 2009-03-06 16:00:41 UTC (rev 3644)
@@ -19,4 +19,4 @@
require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
?>
-mb_registerMapObj('', 'mapframe1', null,500, 500);
\ No newline at end of file
+mb_registerMapObj('', 'mapframe1', null,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
\ No newline at end of file
Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php 2009-03-06 16:00:41 UTC (rev 3644)
@@ -514,10 +514,6 @@
parent.eventAfterMapRequest.register(function () {
updateExtent();
});
- try {if(spatialRequestResultToDigitize){}}catch(e) {spatialRequestResultToDigitize = 1;}
- if(spatialRequestResultToDigitize==1){
- parent.mb_registerWfsReadSubFunctions(function(geom){parent.tab_open(mod_digitize_elName);parent.window.frames[mod_digitize_elName].appendGeometryArray(geom);});
- }
parent.mb_registerWfsWriteSubFunctions(function(){parent.zoom(mod_digitize_target, true, 0.999);});
}
@@ -856,6 +852,12 @@
var response = eval('(' + json + ')');
var polygon = response.polygon;
d.importGeometryFromText(polygon);
+
+ // remove the original polygons
+ var len = d.count();
+ for (var i = 0; i < len-1; i++) {
+ d.del(0);
+ }
parent.mb_disableThisButton(button_merge);
});
}
@@ -880,6 +882,9 @@
d.importGeometryFromText(polygonArray[i]);
d.get(-1).wfs_conf = wfsConfId;
}
+ // remove the original polygon and the temporary line
+ d.del(0);
+ d.del(0);
parent.mb_disableThisButton(button_split);
});
}
Modified: trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/http/javascripts/mod_wfs_SpatialRequest.php 2009-03-06 16:00:41 UTC (rev 3644)
@@ -93,6 +93,44 @@
try {if(mod_digitize_elName){}}catch(e) {mod_digitize_elName = "digitize";}
+try{
+ if (wfsResultToPopupDiv){}
+}
+catch(e){
+ wfsResultToPopupDiv = 0;
+}
+try{
+ if (buttonWfs_toDigitize_on){}
+}
+catch(e){
+ buttonWfs_toDigitize_on = 0;
+}
+if (wfsResultToPopupDiv == 1) {
+ mb_registerWfsReadSubFunctions(function (geom) {
+ displayPopup(geom);
+ });
+}
+else {
+ if (buttonWfs_toDigitize_on == 1) {
+ mb_registerWfsReadSubFunctions(function(geom){
+ if (buttonWfs_toDigitize_target && window.frames[buttonWfs_toDigitize_target]) {
+ tab_open(buttonWfs_toDigitize_target);
+ appendGeometryArrayToDigitize(geom);
+ }
+ else {
+ var msg = "No digitizing module available. " +
+ "Check you WFS spatial request configuration.";
+ var e = new Mb_warning(msg);
+ }
+ });
+ }
+}
+
+var msgObj;
+
+mb_registerInitFunctions("init_wfsSpatialRequest()");
+//mb_registerL10nFunctions("init_wfsSpatialRequest()");
+
function addButtonWfs(id, isOn, src, title, x, y) {
buttonWfs_id.push(id);
buttonWfs_on.push(isOn);
@@ -103,11 +141,6 @@
buttonWfs_y.push(y);
}
-var msgObj;
-
-mb_registerInitFunctions("init_wfsSpatialRequest()");
-//mb_registerL10nFunctions("init_wfsSpatialRequest()");
-
function init_wfsSpatialRequest() {
mb_ajax_json("../php/mod_wfsSpatialRequest_messages.php", function(obj, status) {
msgObj = obj;
@@ -172,7 +205,6 @@
mod_wfs_spatialRequest_width = mb_mapObj[ind].width;
mod_wfs_spatialRequest_height = mb_mapObj[ind].height;
mod_wfs_spatialRequest_epsg = mb_mapObj[ind].epsg;
- mb_registerSubFunctions("drawDashedLineExt()");
mb_registerPanSubElement("measuring");
geomArray = new GeometryArray();
@@ -280,11 +312,6 @@
mod_wfs_spatialRequestSubFunctions[mod_wfs_spatialRequestSubFunctions.length] = stringFunction;
}
-function isSetWfsResultToDigitize() {
- if (parseInt(buttonWfs_toDigitize_on)==1) return true;
- return false;
-}
-
function mod_wfs_SpatialRequest_dialog(){
if(!mod_wfs_spatialRequest_win || mod_wfs_spatialRequest_win == null || mod_wfs_spatialRequest_win.closed == true){
mod_wfs_spatialRequest_win = window.open("","mod_wfs_spatialRequest_win","width=200,height=150,resizable=yes");
@@ -527,7 +554,6 @@
geom.get(i).wfs_conf = parseInt(js_wfs_conf_id);
}
}
-
checkIfAllAjaxCallsFinished(geom);
}
);
@@ -597,8 +623,14 @@
function appendGeometryArrayToDigitize(geom){
var mapIndex = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+ var proceed = true;
if (geom.get(0).getEpsg() !== mb_mapObj[mapIndex].epsg) {
- var e = new Mb_exception("SRS mismatch. Geometry is in " + geom.get(0).getEpsg() + ", map is in " + mb_mapObj[mapIndex].epsg + ". Geometry discarded.");
+ var msg = "SRS mismatch. Geometry is in " + geom.get(0).getEpsg() +
+ ", map is in " + mb_mapObj[mapIndex].epsg + ".";
+ var e = new Mb_warning(msg);
+ proceed = confirm(msg + " Proceed?");
+ }
+ if (!proceed) {
return;
}
try {
@@ -613,11 +645,16 @@
function appendGeometryToDigitize(i){
var mapIndex = getMapObjIndexByName(mod_wfs_spatialRequest_target);
+ var proceed = true;
if (geomArray.get(i).getEpsg() !== mb_mapObj[mapIndex].epsg) {
- var e = new Mb_exception("SRS mismatch. Geometry is in " + geom.get(0).getEpsg() + ", map is in " + mb_mapObj[mapIndex].epsg + ". Geometry discarded.");
+ var msg = "SRS mismatch. Geometry is in " + geom.get(0).getEpsg() +
+ ", map is in " + mb_mapObj[mapIndex].epsg + ".";
+ var e = new Mb_warning(msg);
+ proceed = confirm(msg + " Proceed?");
+ }
+ if (!proceed) {
return;
}
-
var digitizeArray = new GeometryArray();
digitizeArray.addCopy(geomArray.get(i));
try {
@@ -720,13 +757,4 @@
wfsPopup = new mb_popup(detailPopupTitle,resultHtml,detailPopupWidth,detailPopupHeight,detailPopupX,detailPopupY);
}
wfsPopup.show();
-}
-try{
- if (wfsResultToPopupDiv){}
-}
-catch(e){
- wfsResultToPopupDiv =0;
-}
-if(wfsResultToPopupDiv==1){
- mb_registerWfsReadSubFunctions(function(geom){displayPopup(geom);});
-}
+}
\ No newline at end of file
Modified: trunk/mapbender/http/javascripts/ovnf.php
===================================================================
--- trunk/mapbender/http/javascripts/ovnf.php 2009-03-06 15:40:30 UTC (rev 3643)
+++ trunk/mapbender/http/javascripts/ovnf.php 2009-03-06 16:00:41 UTC (rev 3644)
@@ -24,7 +24,7 @@
if (typeof(overview_wms) === 'undefined')overview_wms = 0;
overview_wms = parseInt(overview_wms);
-mb_registerMapObj('', 'overview', overview_wms ,150, 150);
+mb_registerMapObj('', 'overview', overview_wms ,<?php echo $e_width; ?>, <?php echo $e_height; ?>);
parent.eventInitMap.register(function init_overview(){
var ind = getMapObjIndexByName('overview');
More information about the Mapbender_commits
mailing list