Skip to content

Commit

Permalink
Don't route until we have a map; fixes #462
Browse files Browse the repository at this point in the history
  • Loading branch information
Per Liedman committed Sep 28, 2018
1 parent db6fd98 commit 12ceb07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
if (options.routeWhileDragging) {
this._setupRouteDragging();
}

if (this.options.autoRoute) {
this.route();
}
},

_onZoomEnd: function() {
Expand Down Expand Up @@ -72,6 +68,10 @@
},

onAdd: function(map) {
if (this.options.autoRoute) {
this.route();
}

var container = Itinerary.prototype.onAdd.call(this, map);

this._map = map;
Expand Down

0 comments on commit 12ceb07

Please sign in to comment.