<!--
{
  "availability" : [
    "MapKit JS: 5.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/Route/polyline",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "instp/mapkit.Route/polyline"
  },
  "title" : "polyline"
}
-->

# polyline

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

```
get polyline(): PolylineOverlay;
```

## Discussion

You can add the value of the `polyline` property directly to the map.

```javascript
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);

});
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)