Skip to content

Commit 12ceb07

Browse files
author
Per Liedman
committed
Don't route until we have a map; fixes #462
1 parent db6fd98 commit 12ceb07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/control.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939
if (options.routeWhileDragging) {
4040
this._setupRouteDragging();
4141
}
42-
43-
if (this.options.autoRoute) {
44-
this.route();
45-
}
4642
},
4743

4844
_onZoomEnd: function() {
@@ -72,6 +68,10 @@
7268
},
7369

7470
onAdd: function(map) {
71+
if (this.options.autoRoute) {
72+
this.route();
73+
}
74+
7575
var container = Itinerary.prototype.onAdd.call(this, map);
7676

7777
this._map = map;

0 commit comments

Comments
 (0)