Skip to content

Instantly share code, notes, and snippets.

@here-devblog-gists
Created November 7, 2016 09:26
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/077ec38adf1bdab402384103096eb184 to your computer and use it in GitHub Desktop.
Save here-devblog-gists/077ec38adf1bdab402384103096eb184 to your computer and use it in GitHub Desktop.
HERERouter.prototype.getRouteLine = function(route) {
var routeShape = route.shape;
// Create a strip to use as a point source for the route line
var strip = new H.geo.Strip();
// Push all the points in the shape into the strip:
routeShape.forEach(function(point) {
var parts = point.split(',');
strip.pushLatLngAlt(parts[0], parts[1]);
});
// Create a polyline to display the route:
var routeLine = new H.map.Polyline(strip,
{ style: this.routeLineStyles.normal }
);
return routeLine;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment