---
title: "itemForLineString(overlay, geoJSON)"
framework: mapkitjs
role: symbol
role_heading: Interface Method
path: mapkitjs/geojsondelegate/itemforlinestring
---

# itemForLineString(overlay, geoJSON)

Overrides a line string.

## Declaration

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

## Parameters

- `overlay`: A doc://com.apple.mapkitjs/documentation/MapKitJS/PolylineOverlay object.
- `geoJSON`: The original GeoJSON object for the LineString object.

## Return Value

Return Value A map item or an array of map items.

## Discussion

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

## See Also

### Overriding items

- [itemForFeature(item, geoJSON)](mapkitjs/geojsondelegate/itemforfeature.md)
- [itemForFeatureCollection(itemCollection, geoJSON)](mapkitjs/geojsondelegate/itemforfeaturecollection.md)
- [itemForMultiLineString(itemCollection, geoJSON)](mapkitjs/geojsondelegate/itemformultilinestring.md)
- [itemForPoint(coordinate, geoJSON)](mapkitjs/geojsondelegate/itemforpoint.md)
- [itemForMultiPoint(itemCollection, geoJSON)](mapkitjs/geojsondelegate/itemformultipoint.md)
- [itemForPolygon(overlay, geoJSON)](mapkitjs/geojsondelegate/itemforpolygon.md)
- [itemForMultiPolygon(itemCollection, geoJSON)](mapkitjs/geojsondelegate/itemformultipolygon.md)
- [styleForOverlay(overlay, geoJSON)](mapkitjs/geojsondelegate/styleforoverlay.md)
