Default user location annotation view displayPriority, zPosition

Hello.


I'm developen an app that is using MapKit. One of my problem in iOS 11 is that I can not control zPosition on my MKAnnotationViews layers anymore because it seems that MapKit is replacing values in it no matter what I set.


In iOS 10 there was no concept of displayPriority and collisions and I can control where my annotation views will appear (display order front/middle/back etc).


How can I control zPosition in iOS 11 and later so I can make fulfull my specs requirements. I have 3 types of MKAnnotationViews:

- Type 1 that need to be in front of type 2

- Type 2 that need to stay behing of type 1. This type cannot be hidden if collision occurs.

- Type 3 which is default user location annotation view (default iOS MapKit blue dot with pulsing circle area representing gps accuracy). This type of annotation ned to be placed in front of all other types.


In iOS 10 It was simple. I just set zPosition like this:

- Type 1 - zPosition = 0.2

- Type 2 - zPosition = 0.1

- Type 3 - zPosition = 0.5


How to make this in iOS 11?


Thanks in advance for help


--

Warm regards,

Marcin

Replies

Rather than using zPosition, it'd be better to specify the displayPriority of your annotations so the map view can determine what to show and hide during any collisions.

I was talking to Product Owner about it and showing hiding annotation views based on collistions are not acceptable at all. Any other suggestions?