Skip to content

Instantly share code, notes, and snippets.

@here-devblog-gists
Created October 13, 2016 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save here-devblog-gists/18fd0e69ad72c3689193e3a00b387638 to your computer and use it in GitHub Desktop.
Save here-devblog-gists/18fd0e69ad72c3689193e3a00b387638 to your computer and use it in GitHub Desktop.
var onSuccess = function(result) {
var route,
routeShape,
startPoint,
endPoint,
strip;
if (result.response.route) {
route = result.response.route[0];
routeShape = route.shape;
strip = new H.geo.Strip();
routeShape.forEach(function(point) {
var parts = point.split(',');
strip.pushLatLngAlt(parts[0], parts[1]);
});
var routeLine = new H.map.Polyline(strip, {
style: { strokeColor: 'blue', lineWidth: 10 }
});
map.addObject(routeLine);
map.setViewBounds(routeLine.getBounds());
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment