Skip to content

Commit

Permalink
Fix DynamicRendererMapOverlay
Browse files Browse the repository at this point in the history
  • Loading branch information
pauljohanneskraft committed Apr 29, 2022
1 parent 8bdd339 commit d56610a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Sources/Overlays/DynamicRendererMapOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,20 @@ public struct DynamicRendererMapOverlay: MapOverlay {

self.overlay = Overlay(coordinate: coordinate, boundingMapRect: boundingMapRect)
self.level = level
self.displayRequestPublisher = publisher.eraseToAnyPublisher()
self.updatePublisher = updates.eraseToAnyPublisher()
self.canDraw = canDraw
self.draw = draw
}


public func renderer(for mapView: MKMapView) -> MKOverlayRenderer {
DynamicMapRenderer(
guard let overlay = overlay as? Overlay else {
assertionFailure("DynamicRendererMapOverlay does not support custom MKOverlay classes.")
return MKOverlayRenderer(overlay: overlay)
}
return DynamicMapRenderer(
overlay: overlay,
displayRequestPublisher: displayRequestPublisher,
updatePublisher: updatePublisher,
canDraw: canDraw,
draw: draw
)
Expand Down Expand Up @@ -155,7 +159,7 @@ private class DynamicMapRenderer: MKOverlayRenderer {
typedOverlay?.coordinate = coordinate
}

if let boundingMapRect = update.boundingMapRect {
if let boundingMapRect = update.boundingMapRect {
typedOverlay?.boundingMapRect = boundingMapRect
}

Expand Down

0 comments on commit d56610a

Please sign in to comment.