Instance Property

polyline

An instance of a polyline overlay that represents the path of a route.

Declaration

mapkit.PolylineOverlay polyline;

Discussion

The value of the polyline property can be added directly to the map.

var route = directions.route({
    origin: new mapkit.Coordinate(37.616934, -122.383790),
    destination: new mapkit.Coordinate(37.3349, -122.0090201)
}, function(error, data) {

    var polylines = data.routes.map(function(route) {
        return route.polyline;
    });

    map.showItems(polylines);

});

See Also

Route Geometry

path

An array of coordinate objects representing the path of the route.

Deprecated