diff --git a/src/control.js b/src/control.js index a5e0384d..08cd6111 100644 --- a/src/control.js +++ b/src/control.js @@ -39,10 +39,6 @@ if (options.routeWhileDragging) { this._setupRouteDragging(); } - - if (this.options.autoRoute) { - this.route(); - } }, _onZoomEnd: function() { @@ -72,6 +68,10 @@ }, onAdd: function(map) { + if (this.options.autoRoute) { + this.route(); + } + var container = Itinerary.prototype.onAdd.call(this, map); this._map = map;