<!--
{
  "availability" : [
    "MapKit JS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKitJS",
  "identifier" : "/documentation/MapKitJS/GeoJSONDelegate/itemForLineString",
  "metadataVersion" : "0.1.0",
  "role" : "Interface Method",
  "symbol" : {
    "kind" : "Interface Method",
    "modules" : [
      "MapKit JS"
    ],
    "preciseIdentifier" : "structm/mapkit.GeoJSONDelegate/itemForLineString"
  },
  "title" : "itemForLineString(overlay, geoJSON)"
}
-->

# itemForLineString(overlay, geoJSON)

Overrides a line string.

```
itemForLineString?(
    overlay: PolylineOverlay,
    geoJSON: GeoJSONTypes.LineString,
): PolylineOverlay | null;
```

## Parameters

`overlay`

A [`PolylineOverlay`](/documentation/MapKitJS/PolylineOverlay) object.

`geoJSON`

The original GeoJSON object for the `LineString` object.

## Return Value

A map item or an array of map items.

## Discussion

MapKit JS calls this method for each individual `LineString` geometry object. You can customize or completely replace the provided overlay before returning it.

---

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)