sped up the router

This commit is contained in:
muerwre 2019-03-04 17:45:41 +07:00
parent 413a89a0bb
commit 143f3107e1

View file

@ -40,6 +40,7 @@ export class Router {
serviceUrl: CLIENT.OSRM_URL, serviceUrl: CLIENT.OSRM_URL,
profile: 'bike', profile: 'bike',
fitSelectedRoutes: false, fitSelectedRoutes: false,
showAlternatives: false,
routeLine, routeLine,
altLineOptions: { altLineOptions: {
styles: [{ color: '#4597d0', opacity: 1, weight: 3 }] styles: [{ color: '#4597d0', opacity: 1, weight: 3 }]
@ -50,9 +51,13 @@ export class Router {
draggable: true, draggable: true,
icon: this.createWaypointMarker(), icon: this.createWaypointMarker(),
}), }),
routeWhileDragging: true, routeWhileDragging: false,
}), }),
routeWhileDragging: true routeWhileDragging: false,
routingOptions: {
geometryOnly: false,
},
useHints: false,
}).on('waypointschanged', this.updateWaypointsCount); }).on('waypointschanged', this.updateWaypointsCount);
this.router.addTo(map); this.router.addTo(map);
@ -87,7 +92,7 @@ export class Router {
} }
window.removeEventListener('mouseup', this.unlockPropagations); window.removeEventListener('mouseup', this.unlockPropagations);
setTimeout(() => this.lockMapClicks(false), 300); setTimeout(() => this.lockMapClicks(false), 0);
}; };
startFrom = (latlngs: ILatLng): void => { startFrom = (latlngs: ILatLng): void => {