Replicating Apple Maps overlay

We find overlays in many Apple native apps like Shortcuts, Maps andStocks. How to replicate it ?

The overlays presented in the different Apple applications do not look exactly the same. In Stocks, the overlay looks a bit viscous for instance. I focuses my research on the overlay displayed in the Shortcuts app. It helped me to reproduce some edge cases.

Let’s analyse it :

There are currently several libraries available to mimic it :

I tried all of them and they all miss something on the motion. So I decided to replicate it myself using a different approach. Some parts of the motion are customizable :

Give it a try ! And please let me known if you see anything wrong. For the details of the implementation, see the related Stack Overflow question.