mkoverlay

Polylines are disappearing when zoom closely

二次信任 提交于 2020-03-24 07:21:12
问题 I created seven different polylines. However some of them are disappearing when I zoom in closely. Why it is happening? How can I prevent this? Here is my polyline renderer: func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer { let renderer = MKPolylineRenderer(polyline: overlay as! MKPolyline) renderer.strokeColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.9) renderer.lineWidth = 2.2 return renderer } //Thousands of parameters sending as a parameter

Inverted Circle Overlay Not Showing On Map

戏子无情 提交于 2020-02-06 07:32:49
问题 I am trying to create a inverted MKCircle overlay on the map but it will not show up. Heres my inverted circle class code: import Foundation import MapKit class MKInvertedCircle : NSObject, MKOverlay { var coordinate: CLLocationCoordinate2D var boundingMapRect: MKMapRect { return MKMapRect.world } init(center coord: CLLocationCoordinate2D) { self.coordinate = coord } } Heres my inverted circle renderer class code: import Foundation import UIKit import MapKit class

Inverted Circle Overlay Not Showing On Map

你。 提交于 2020-02-06 07:32:29
问题 I am trying to create a inverted MKCircle overlay on the map but it will not show up. Heres my inverted circle class code: import Foundation import MapKit class MKInvertedCircle : NSObject, MKOverlay { var coordinate: CLLocationCoordinate2D var boundingMapRect: MKMapRect { return MKMapRect.world } init(center coord: CLLocationCoordinate2D) { self.coordinate = coord } } Heres my inverted circle renderer class code: import Foundation import UIKit import MapKit class

Smooth resizing of MKCircle

风格不统一 提交于 2020-01-30 04:27:45
问题 How can I achieve a smooth resizing of a MKCircleView on a UIMapView when adjusting an NSSlider? Apple has managed to do it in the Find my friends app when creating geofences (http://reviewznow.com/wp-content/uploads/2013/03/find-my-friends-location-alerts-01.jpg), so I guess it's possible in some way. So far I've tried the following solutions, but with a very "flickery" result: First attempt I added a new MKCircleView with an updated radius and immediately after removing the one that was (as

iOS - MKOverlayView custom view rect fills works, but line draws do not

瘦欲@ 提交于 2020-01-24 12:42:25
问题 New to Map Overlays, but this is a really weird problem. I pass in the mapView.visibleMapRect to my overlay implementation and return that as the boundingMapRect, which is fine for now - just trying to draw a line on the whole map rect. My drawMapRect is getting called, and in the following code - the partially transparent green rectangle is drawn, but the lines are not. I've verified the line drawing code in drawRect of a uiview subclass, so I know it draws something :-) I'm sure I must be

iOS - MKOverlayView custom view rect fills works, but line draws do not

僤鯓⒐⒋嵵緔 提交于 2020-01-24 12:42:18
问题 New to Map Overlays, but this is a really weird problem. I pass in the mapView.visibleMapRect to my overlay implementation and return that as the boundingMapRect, which is fine for now - just trying to draw a line on the whole map rect. My drawMapRect is getting called, and in the following code - the partially transparent green rectangle is drawn, but the lines are not. I've verified the line drawing code in drawRect of a uiview subclass, so I know it draws something :-) I'm sure I must be

iOS - MKOverlayView custom view rect fills works, but line draws do not

泄露秘密 提交于 2020-01-24 12:42:01
问题 New to Map Overlays, but this is a really weird problem. I pass in the mapView.visibleMapRect to my overlay implementation and return that as the boundingMapRect, which is fine for now - just trying to draw a line on the whole map rect. My drawMapRect is getting called, and in the following code - the partially transparent green rectangle is drawn, but the lines are not. I've verified the line drawing code in drawRect of a uiview subclass, so I know it draws something :-) I'm sure I must be

How to refresh an MKOverlayRenderer when mapView change

為{幸葍}努か 提交于 2020-01-15 05:36:06
问题 I am new to code, and i'm trying to realize something like Reminders app : I've follow another answer to realize it and here my code: In my ViewController: var circle = MKCircle(centerCoordinate: location.coordinate, radius: 100) self.mapView.addOverlay(circle) In my MKMapView: func mapView(mapView: MKMapView!, rendererForOverlay overlay: MKOverlay!) -> MKOverlayRenderer! { if overlay is MKCircle { render = MapFillRenderer(overlay: overlay) return render } else { return nil } } And the