Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HERERouter.prototype.getRoutes = function(options, onSuccessCallback) {
var onSuccess,
onError;
onSuccess = function (result) {
if (result.response.route) {
var routeLineGroup = new H.map.Group();
var routes = result.response.route.map(function(route) {
var routeLine = this.getRouteLine(route);
routeLineGroup.addObject(routeLine);
return {
route: route,
routeLine: routeLine
};
}.bind(this));
onSuccessCallback(routes, routeLineGroup);
} else {
onError(result.response.details);
}
};
onError = function (error) {
console.error('Oh no! There was some communication error!', error);
};
this.router.calculateRoute(options, onSuccess.bind(this), onError);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.