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

# styleForOverlay(overlay, geoJSON)

Overrides the style of overlays.

```
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

This method returns a [`Style`](/documentation/MapKitJS/Style) object for the provided overlay.

## Discussion

MapKit JS calls this method for each overlay, and after each call to [`itemForPoint()`](/documentation/MapKitJS/GeoJSONDelegate/itemForPoint) and [`itemForPolygon()`](/documentation/MapKitJS/GeoJSONDelegate/itemForPolygon).

---

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)