From 7663d2610e0a49007233ee4230079a66f6cd17c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Fri, 16 Sep 2016 14:01:04 +0200 Subject: [PATCH] more fixes in map.js --- src/c3nav/editor/static/editor/js/map.js | 39 +----------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/src/c3nav/editor/static/editor/js/map.js b/src/c3nav/editor/static/editor/js/map.js index 94c6e576..aa818338 100644 --- a/src/c3nav/editor/static/editor/js/map.js +++ b/src/c3nav/editor/static/editor/js/map.js @@ -114,48 +114,11 @@ if ($('#mapeditor').length) { type: 'polygon', color: '#99CC00', }, - } + }; // Add drawing new features currently_drawing = null; currently_adding = null; - function add_edit_button(map, container, type, icon, callback) { - $('').appendTo(container).text(icon).attr({ - href: '#', - title: 'add '+name, - name: type - }).on('click', function(e) { - e.preventDefault(); - - // If we are currently adding a feature, don't start drawing another. - if (currently_adding !== null) { - return; - } - - // If we are currently drawing a feature, don't start drawing another. - if (currently_drawing !== null) { - // If it is a feature of the same type, cancel it. - if (currently_drawing === type) { - $('.leaflet-editbar .current').removeClass('current'); - currently_drawing = null; - map.editTools.stopDrawing(); - } - return; - } - - currently_drawing = type; - console.log(type); - $('.leaflet-editbar .current').removeClass('current'); - $('.leaflet-editbar [name='+type+']').addClass('current'); - options = feature_types[type]; - if (options.type == 'polygon') { - map.editTools.startPolygon(null, options); - } else if (options.type == 'polyline') { - map.editTools.startPolyline(null, options); - } - }); - - } L.DrawControl = L.Control.extend({ options: { position: 'topleft'