From 53587c865baf08199a65d1fda71c4974dc1e13ef Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Wed, 14 May 2014 13:14:35 +0200 Subject: [PATCH] crosshair cursor instead of marker --- css/style.css | 4 ++-- js/plugin/Routing.js | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/css/style.css b/css/style.css index 2efa6da..fe2854c 100644 --- a/css/style.css +++ b/css/style.css @@ -88,8 +88,8 @@ td { width: 92.5px; } -.leaflet-container { - cursor: auto; +.routing-draw-enabled { + cursor: crosshair; } /* left sidebar as additional control position */ diff --git a/js/plugin/Routing.js b/js/plugin/Routing.js index a4bf9c1..f35fd29 100644 --- a/js/plugin/Routing.js +++ b/js/plugin/Routing.js @@ -1,17 +1,26 @@ BR.Routing = L.Routing.extend({ options: { - /* not implemented yet icons: { + /* not implemented yet start: new L.Icon.Default({iconUrl: 'bower_components/leaflet-gpx/pin-icon-start.png'}), end: new L.Icon.Default(), normal: new L.Icon.Default() - },*/ + */ + draw: false + }, snapping: null }, onAdd: function (map) { var container = L.Routing.prototype.onAdd.call(this, map); + this._draw.on('enabled', function() { + L.DomUtil.addClass(map.getContainer(), 'routing-draw-enabled'); + }); + this._draw.on('disabled', function() { + L.DomUtil.removeClass(map.getContainer(), 'routing-draw-enabled'); + }); + // enable drawing mode this.draw(true);