---
title: "setNeedsDisplayInMapRect:zoomScale:"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkoverlayview/setneedsdisplayinmaprect:zoomscale:"
---

# setNeedsDisplayInMapRect:zoomScale:

Invalidates the view in the given map rectangle but only at the specified zoom scale.

## Declaration

```occ
- (void) setNeedsDisplayInMapRect:(MKMapRect) mapRect zoomScale:(MKZoomScale) zoomScale;
```

## Parameters

- `mapRect`: The portion of the overlay that needs to be updated. This value is specified using a map rectangle and not view coordinates. You can convert from a view rectangle to a map rectangle using the doc://com.apple.mapkit/documentation/MapKit/MKOverlayView/mapRectForRect: method.
- `zoomScale`: The zoom scale for which you want to invalidate the overlay.

## Discussion

Discussion Marking a rectangle as invalid causes that portion of the view to be redrawn during the next update cycle. This method invalidates the overlay only when it is drawn at the specified zoom scale.

## See Also

### Drawing the overlay

- [canDrawMapRect:zoomScale:](mapkit/mkoverlayview/candrawmaprect:zoomscale:.md)
- [drawMapRect:zoomScale:inContext:](mapkit/mkoverlayview/drawmaprect:zoomscale:incontext:.md)
- [setNeedsDisplayInMapRect:](mapkit/mkoverlayview/setneedsdisplayinmaprect:.md)
