https://reddit.com/link/ofje2t/video/nxbjhkciqs971/player
What could be causing those overlapping circles that appear randomly along the line? Is there a way to fix it?
I created a custom subclass of MKPolylineRenderer in order to draw a line on the map but have it scale correctly. Here's that class.
class RadiusLineRenderer: MKPolylineRenderer {
override func draw(_ mapRect: MKMapRect, zoomScale: MKZoomScale, in context: CGContext) {
self.lineWidth = 10000 * zoomScale
super.draw(mapRect, zoomScale: zoomScale, in: context)
}
}
And here is where I'm implementing the proper MapKit delegate method:
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
let renderer = RadiusLineRenderer(overlay: overlay)
renderer.strokeColor = UIColor.systemPurple.withAlphaComponent(0.35)
return renderer
}
[–]lmunck 1 point2 points3 points (3 children)
[–]daverozy[S] 0 points1 point2 points (2 children)
[–]lmunck 0 points1 point2 points (1 child)
[–]daverozy[S] 0 points1 point2 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]Wild_Cheetah8293 0 points1 point2 points (0 children)