My question yesterday - https://developer.apple.com/forums/thread/680107 - was probably to complex for anyone to want to try to answer, I am sorry!
So now I will break it up, and start with a smaller question:
I am trying to show 10 simple lines on a map with Map Kit. The lines have been loaded into a list called 'overlays' by a module called KMLviewer, or more exactly KMLparser, inside KMLviewer - from https://github.com/ooper-shlab/KMLViewer-Swift .
As you can see from my debugging log below, 'overlays' is a list of elements of the type 'MKOverlay', although in reality they are all MKPolyline(s). So how do I access the 2 geographic points that make up each line?
MKPolyline inherits from MKMultiPoint, which has a function:
func points() - UnsafeMutablePointerMKMapPoint
"Returns an array of map points associated with the shape. "
But as you can see from my debugging below, I can't seem to access that function, now that the MKPolyline is "inside" an MKOverlay. So how do I access the points?:
(lldb) po overlays
▿ 10 elements
- 0 : MKPolyline: 0x60000368bc60
- 1 : MKPolyline: 0x60000368bcd0
- 2 : MKPolyline: 0x60000368bd40
- 3 : MKPolyline: 0x60000368bdb0
- 4 : MKPolyline: 0x60000368be20
- 5 : MKPolyline: 0x60000368be90
- 6 : MKPolyline: 0x60000368bf00
- 7 : MKPolyline: 0x60000368bf70
- 8 : MKPolyline: 0x600003690000
- 9 : MKPolyline: 0x600003690070
(lldb) po overlays[0]
MKPolyline: 0x60000368bc60
(lldb) po overlays[0].coordinate
▿ CLLocationCoordinate2D
- latitude : 64.47726683920816
- longitude : -21.420572185955933
(lldb) po overlays[0].points()
error: EXPR:3:13: error: value of type 'MKOverlay' has no member 'points'
overlays[0].points()
~~~ ^~
(lldb)
14
0
2.9k