---
title: selectedOverlay
framework: mapkitjs
role: symbol
role_heading: Instance Property
path: mapkitjs/map/selectedoverlay
---

# selectedOverlay

The selected overlay on the map.

## Declaration

```data
get selectedOverlay(): Overlay | null;
set selectedOverlay(overlay: Overlay | null);
```

## Discussion

Discussion To deselect any selected overlay, set this property to null. To select an overlay that’s already part of the map, set this property to the desired overlay. When MapKit JS removes the selected overlay from the map (as an effect of removeOverlay(overlay), removeOverlays(overlays), or setting a new set of overlays with the overlays property), MapKit JS deselects the overlay before removing it.

## See Also

### Adding and removing overlays

- [overlays](mapkitjs/map/overlays.md)
- [overlaysAtPoint(point)](mapkitjs/map/overlaysatpoint.md)
- [addOverlay(overlay)](mapkitjs/map/addoverlay.md)
- [addOverlays(overlays)](mapkitjs/map/addoverlays.md)
- [removeOverlay(overlay)](mapkitjs/map/removeoverlay.md)
- [removeOverlays(overlays)](mapkitjs/map/removeoverlays.md)
- [topOverlayAtPoint(point)](mapkitjs/map/topoverlayatpoint.md)
