MKMapKit on macOS Sierra only displays MKPolylines or MKOverlays in the top-right quadrant of the map, when the mapType is .hybridFlyover
| Originator: | paul.robin.manson | ||
| Number: | rdar://28467897 | Date Originated: | 9/26/2016 |
| Status: | Open | Resolved: | |
| Product: | MapKit SDK | Product Version: | macOS Sierra v10.12 |
| Classification: | Significant bug | Reproducible: | Yes |
Summary: On macOS Sierra (but not on previous OSX versions), there is a runtime bug in MKMapKit. This bug impacts both MKPolylines and MKOverlays, both of which display only in the top-right quadrant of the map, when the mapType is .hybridFlyover. Switching the mapType to .hybrid (or any of the other 2D map types) immediately fixes the bug. Steps to Reproduce: 1. Create a new XCode project for macOS/Cocoa. 2. Add a MKMapView to the main ViewController, and set the mapType property to .hybridFlyover 3. Assign mapView.delegate = self, and alter the ViewController's declaration to add MKMapViewDelegate conformance. 4. Create a track on the Map (MKPolyline). I suggest a circle or an elliptical shape for the track, so you can easily tell which portion of this track is being displayed correctly. 5. Implement the mapView(rendererFor:overlay) method and make this simply return a MKPolylineRenderer with strokeColor set to NSColor.yellow and lineWidth set to 10. 6. Pan the map so the track you created is in the center. Expected Results: You would expect to see the entire track on the map. The "2D" screen snaps show successful results, which is what you get on OSX versions prior to macOS Sierra, and which is also what happens on macOS Sierra when the mapType is .hybrid, .satellite or .standard (i.e. a 2D map type). Actual Results: What you actually see is only the portion of the track that's in the upper-right quadrant of the map. As you pan the map from side to side, any part of the track that's not in the upper-right quadrant disappears from the map. If you pan the map so the entire track is in the upper-right quadrant of the map, you can see the entire track. So you know that the track is capable of being rendered correctly by the MKPolylineRenderer(). Either that renderer isn't always being called by MapKit, or it's failing to render the portions of the track which lie outside the upper-right quadrant of the visible map. Version: Version 8.0 (8A218a), but has also been an issue with apps created using XCode v7.x, running on the macOS Sierra beta releases. So the issue would seem to be specific to the macOS Sierra MKMapKit runtime, rather than to the XCode IDE. The same bug applies to MKOverlayRenderers for raster map tiles; they also are displayed only in the upper-right corner of the mapView. Configuration: There have been no variations in behaviour (tested with MacMini, iMac, MacBook, across a variety of languages and regional settings, using both retina and non-retina displays). This bug appears to be specific to macOS Sierra as it did not occur (and still does not occur) under OSX El Capitan.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!
Resolution: wait for macOS Sierra v10.12.1!
It appears this has been fixed in the beta release of macOS Sierra 10.12.1
Initial testing shows that on v10.12.1 the display of both MKPolyLine and MKTileOverlay objects is corrected. These are no longer clipped to the upper-right quadrant of the mapView.