polyline
An instance of a polyline overlay that represents the path of a route.
Declaration
get polyline(): PolylineOverlay;Mentioned in
Discussion
You can add the value of the polyline property directly to the map.
const route = directions.route({
origin: new mapkit.Coordinate(37.616934, -122.383790),
destination: new mapkit.Coordinate(37.3349, -122.0090201)
}, function(error, data) {
const polylines = data.routes.map(function(route) {
return route.polyline;
});
map.showItems(polylines);
});