error handling
This commit is contained in:
parent
a5e1681370
commit
fd98a2f102
2 changed files with 25 additions and 10 deletions
13
js/index.js
13
js/index.js
|
|
@ -138,9 +138,18 @@
|
|||
routing = new BR.Routing({routing: {
|
||||
router: L.bind(router.getRouteSegment, router)
|
||||
}});
|
||||
routing.on('routing:routeWaypointEnd', onUpdate);
|
||||
routing.on('routing:routeWaypointEnd', function(evt) {
|
||||
onUpdate(evt && evt.err);
|
||||
});
|
||||
|
||||
function onUpdate() {
|
||||
function onUpdate(err) {
|
||||
if (err) {
|
||||
BR.message.showError(err);
|
||||
return;
|
||||
} else {
|
||||
BR.message.hideError();
|
||||
}
|
||||
|
||||
var track = routing.toPolyline(),
|
||||
latLngs = routing.getWaypoints(),
|
||||
urls = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue