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

# styleForOverlay(overlay, geoJSON)

Overrides the style of overlays.

## Declaration

```data
styleForOverlay?(
    overlay: PolylineOverlay | PolygonOverlay,
    geoJSON: GeoJSONTypes.LineString | GeoJSONTypes.Polygon,
): Style;
```

## Parameters

- `overlay`: The overlay to style.
- `geoJSON`: The original GeoJSON for the feature or geometry object.

## Return Value

Return Value This method returns a Style object for the provided overlay.

## Discussion

Discussion MapKit JS calls this method for each overlay, and after each call to itemForPoint(coordinate, geoJSON) and itemForPolygon(overlay, geoJSON).

## See Also

### Overriding items

- [itemForFeature(item, geoJSON)](mapkitjs/geojsondelegate/itemforfeature.md)
- [itemForFeatureCollection(itemCollection, geoJSON)](mapkitjs/geojsondelegate/itemforfeaturecollection.md)
- [itemForLineString(overlay, geoJSON)](mapkitjs/geojsondelegate/itemforlinestring.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)
