[Mapbender-commits] r5341 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jan 19 07:13:56 EST 2010
Author: christoph
Date: 2010-01-19 07:13:55 -0500 (Tue, 19 Jan 2010)
New Revision: 5341
Modified:
trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
added new events
Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php 2010-01-19 12:03:59 UTC (rev 5340)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php 2010-01-19 12:13:55 UTC (rev 5341)
@@ -106,7 +106,6 @@
};
var digitizeHistory = new DigitizeHistory();
-
parent.eventInit.register(function () {
var mapIndex = parent.getMapObjIndexByName(mod_digitize_target);
mapDomElement = parent.mb_mapObj[mapIndex].getDomElement();
@@ -141,7 +140,9 @@
closeGeometry: eventCloseGeometry,
beforeUpdateOrInsert: new parent.Mapbender.Event(),
beforeUpdate: new parent.Mapbender.Event(),
- beforeInsert: new parent.Mapbender.Event()
+ beforeInsert: new parent.Mapbender.Event(),
+ openDialog: new parent.Mapbender.Event(),
+ geometryInserted: new parent.Mapbender.Event()
};
eventCloseGeometry.register(function () {
@@ -552,7 +553,6 @@
});
}
else if (editingLineAndTwoPointsHaveBeenInserted()) {
-
digitizeHistory.addItem({
back: function () {
s.removePoint(d.getPoint(currentGeomIndex, -1, -1));
@@ -1072,7 +1072,6 @@
//
// complete a previously unfinished geometry
//
-
(function () {
var currentGeometryDoesNotCorrespondToTheCurrentButton =
(d.count() > 0 && d.get(_currentGeomIndex).count() > 0 &&
@@ -1874,6 +1873,14 @@
// this method opens a new window and displays the attributes in wfs_conf
//
function showWfs(geometryIndex) {
+ var res = true;
+ res = parent.Mapbender.modules[mod_digitize_elName].events.openDialog.trigger({
+ geometryIndex: geometryIndex
+ });
+ if (res === false) {
+ return;
+ }
+
wfsConf = parent.get_complete_wfs_conf();
if(typeof wfsWindow != 'undefined') {
@@ -2297,12 +2304,18 @@
return str;
}
-function dbGeom(type, m, callback) {
+function dbGeom(type, m, callback, wfsConfId) {
var hasFid = d.get(m).e.getElementValueByName("fid") !== false;
- if (!hasFid && typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
- d.get(m).wfs_conf = parseInt(wfsWindow.document.forms[0].wfs.options[wfsWindow.document.forms[0].wfs.selectedIndex].value);
- d.get(m).e = new parent.Wfs_element();
+ if (!hasFid) {
+ if (typeof wfsConfId !== "undefined") {
+ d.get(m).wfs_conf = wfsConfId;
+ d.get(m).e = new parent.Wfs_element();
+ }
+ else if (typeof(wfsWindow) != 'undefined' && !wfsWindow.closed) {
+ d.get(m).wfs_conf = parseInt(wfsWindow.document.forms[0].wfs.options[wfsWindow.document.forms[0].wfs.selectedIndex].value);
+ d.get(m).e = new parent.Wfs_element();
+ }
}
else {
wfsConf = parent.get_complete_wfs_conf();
@@ -2435,6 +2448,9 @@
wfsWindow.alert(wfsWriteMessage);
}
else {
+ parent.Mapbender.modules[mod_digitize_elName].events.geometryInserted.trigger({
+ fid: fid
+ });
new parent.Mb_notice(wfsWriteMessage);
}
window.setTimeout("wfsWindow.close()",0);
@@ -2444,6 +2460,9 @@
alert(wfsWriteMessage);
}
else {
+ parent.Mapbender.modules[mod_digitize_elName].events.geometryInserted.trigger({
+ fid: fid
+ });
new parent.Mb_notice(wfsWriteMessage);
}
}
More information about the Mapbender_commits
mailing list