[Mapbender-commits] r6075 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 4 09:55:47 EDT 2010
Author: verenadiewald
Date: 2010-05-04 09:55:47 -0400 (Tue, 04 May 2010)
New Revision: 6075
Modified:
trunk/mapbender/http/javascripts/mod_digitize_tab.php
Log:
added event mergeLines for registering from outside
Modified: trunk/mapbender/http/javascripts/mod_digitize_tab.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_digitize_tab.php 2010-05-04 13:44:28 UTC (rev 6074)
+++ trunk/mapbender/http/javascripts/mod_digitize_tab.php 2010-05-04 13:55:47 UTC (rev 6075)
@@ -273,7 +273,14 @@
* This <Mapbender.Event> is fired after a feature has been inserted,
* updated or deleted by WFS-T
*/
- afterWfs: new parent.Mapbender.Event()
+ afterWfs: new parent.Mapbender.Event(),
+ /**
+ * Property: events.mergeLines
+ *
+ * Description:
+ * This <Mapbender.Event> is fired when 2 lines are merged to a single line,
+ */
+ mergeLines: new parent.Mapbender.Event()
};
eventCloseGeometry.register(function () {
@@ -1480,6 +1487,26 @@
}
}
var mergedFeatureId = d.get(-1).e.getElementValueByName("fid");
+
+ // remove the original lines
+ var len = d.count();
+ //for (var i = len-1 ; i >= 1; i--) {
+ for (var i = 0; i < len-1; i++) {
+ d.del(0);
+ }
+ parent.mb_disableThisButton(mod_digitizeEvent);
+
+ var res = true;
+ res = parent.Mapbender.modules.digitize.events.mergeLines.trigger({
+ mergedFeatureId: mergedFeatureId,
+ obsoleteFeature: obsoleteFeatureArray
+
+ }, "AND");
+
+ if (res === false) {
+ return;
+ }
+
if(mergedFeatureId !== false) {
parent.Mapbender.modules.digitize.events.afterWfs.register(function (obj) {
for(var j = 0; j < obsoleteFeatureArray.length; j++) {
@@ -1499,16 +1526,6 @@
}
});
}
-
- // remove the original lines
- var len = d.count();
- //for (var i = len-1 ; i >= 1; i--) {
- for (var i = 0; i < len-1; i++) {
- d.del(0);
- }
-
- parent.mb_disableThisButton(mod_digitizeEvent);
-
});
}
}
More information about the Mapbender_commits
mailing list