Last active
September 21, 2023 03:20
-
-
Save pdarcey/4076c5ab142fccaf0a4b3badd477e013 to your computer and use it in GitHub Desktop.
All the steps to create and display an overlay on a map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See comments below |
Amazing script! Really helped me understand the way of working of Shapes in Apple Maps! Thanks a lot! 💯
Bom dia, @matiasarielol, de nada. Thanks for the feedback. To be honest, I did this for myself, but I'm glad someone else benefitted too.
Thank you so much for listing out the steps. I didn't know step 4 had to be implemented to render it 🫡
Thanks @rungxanh1995, that's kind of why I wrote this up in the first place. Step 4 is the part where you can customise the overlay to suit yourself.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist for getting overlays to display on a map
1. Create a class and set it as a MKMapViewDelegate
2. Add your mapView and hook it up to the new class
3. In
viewDidLoad
, set the mapView's delegate4. In an extension to the base class, add the function
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer { … }
e.g:
5. Generate the overlay(s) you wish to display,
e.g:
6. Add the overlay(s) to the mapView
7. Build & run!