summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2013-12-12 14:14:28 +0100
committerChristian Franke <nobody@nowhere.ws>2013-12-12 14:14:28 +0100
commitb42134c08c24a14407e06e6b559a2370999c9e7f (patch)
treef48258811fd1cb8258a7a1eb0d025eb04f03fb93 /web
parent875c3c2a9c9d7bcb05cb23cc6b538404c5906857 (diff)
allow nodes to be deleted and store json in a more friendly format
Diffstat (limited to 'web')
-rw-r--r--web/js/eventmap.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/web/js/eventmap.js b/web/js/eventmap.js
index 290c03e..4ad23fa 100644
--- a/web/js/eventmap.js
+++ b/web/js/eventmap.js
@@ -98,6 +98,12 @@ function eventmap_process_update(data) {
})();
}
+function delete_marker(marker) {
+ layers[marker.options.layer_name].getLayers()[1].removeLayer(marker);
+ delete marker_store[marker.options.label_text];
+ eventmap_send_update();
+}
+
function add_contextmenu(marker) {
marker.options.contextmenu = true;
marker.options.contextmenuItems = [
@@ -112,7 +118,13 @@ function add_contextmenu(marker) {
callback: function() {
rename_marker(marker);
}
- }
+ },
+ {
+ text: 'Delete',
+ callback: function() {
+ delete_marker(marker);
+ }
+ },
];
$.each(layers, function(layer_name, layer_object) {
marker.options.contextmenuItems.push({