Add a flag to enforce visibility of MKMarkerAnnotationViews

Originator:futuretap
Number:rdar://46205149 Date Originated:22-Nov-2018 12:47 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:12.1
Classification:Enhancement Reproducible:Not Applicable
 
Summary:
Marker annotation views are great because the convey more information (title, subtitle) compared to traditional annotation views. However, this comes at the cost that they're sometimes hidden altogether. 

We'd like to see an `alwaysShowMarker` Bool property (or a `markerVisibility` property of type MKFeatureVisibility) that forces the marker view to be always visible. Only the titles and subtitles would be hidden if space is tight.

Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
12.1

Notes:
The existing titleVisibility and subtitleVisibility properties don't help because they prevent the bubble itself from being hidden.

Comments

My response

Even with the changes you proposed, we can still reproduce the issue. Please find the revised project attach along with a screen movie in the project folder. In zoomed-out state, only 3 markers are displayed.

Apple response

Engineering has determined that this issue behaves as intended based on the following information:

This is behaving correctly and we can’t reproduce the issue. We did have to make a few minor tweaks to the sample app:

Changes Made: MKMapViewDelegate protocol decloration from the extension to the ViewController class. In ViewController.swift I moved “MKMapViewDelegate” from line 43 to line 11

Register the MKMarkerAnnotationView before setting the region In ViewController.swift I moved line 29 to 17 “ mapView.register(MKMarkerAnnotationView.self, forAnnotationViewWithReuseIdentifier: "dot") “

With those changes the six annotations in the sample app are always present.

My response

This doesn't work unfortunately. Even when specifying

view.displayPriority = .required 
view.titleVisibility = .adaptive

some markers aren't displayed, depending on the zoom level. Please find a sample app attached, reproducing the issue. Just hit the "Zoom In" and "Zoom Out" buttons alternatively and different markers are shown. (Tested on an iPhone XR simulator. For other devices, the zoom levels might need adjustment.)

Apple response

This issue behaves as intended based on the following:

What’s described here is exactly what I’d expect to happen if you use an MKMarkerAnnotationView, set its displayPriority to .required, and set its titleVisibilty/subtitleVisibility to .adaptive.

MKMarkerAnnotationView has a default displayPriority of < .required, so maybe that’s the disconnect — you need to set the displayPriority.

Please update your bug report to let us know if this is still an issue for you.


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!