Fix route drawing on page reload

This commit is contained in:
Gautier Pelloux-Prayer 2017-04-24 11:42:36 +02:00
parent 0947bbc89c
commit 3b7494b9d9

View file

@ -138,11 +138,13 @@
var options = this.options,
layer = parsed.layer in options ? parsed.layer : Object.keys(options)[0],
that = this;
//FIXME: removing/readding layers breaks Routing plugin
//Add/remove layer
this.map.eachLayer(function(layer) {
that.map.removeLayer(layer);
});
that.map.addLayer(options[layer]);
// this.map.eachLayer(function(layer) {
// that.map.removeLayer(layer);
// });
// that.map.addLayer(options[layer]);
this.isUpdatingHash = false;
} else {