From 9279913d36477f5fdaf7e4494b14ccb94e2ce282 Mon Sep 17 00:00:00 2001 From: Norbert Renner Date: Thu, 29 May 2014 20:44:12 +0200 Subject: [PATCH] indicate recalculation request by changing segment color (mark old); in addition to or instead of loading spinner (#3)? --- js/plugin/Routing.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/plugin/Routing.js b/js/plugin/Routing.js index ab94d57..dd4fc7b 100644 --- a/js/plugin/Routing.js +++ b/js/plugin/Routing.js @@ -68,5 +68,13 @@ BR.Routing = L.Routing.extend({ add(); } - + + ,_routeSegment: function(m1, m2, cb) { + // change segment color before request to indicate recalculation (mark old) + if (m1 && m1._routing.nextLine !== null) { + m1._routing.nextLine.options.color = 'dimgray'; + m1._routing.nextLine._updateStyle(); + } + L.Routing.prototype._routeSegment.call(this, m1, m2, cb); + } });