Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using current zoom factor in Annotations #26

Open
rderimay opened this issue Oct 29, 2022 · 1 comment
Open

Using current zoom factor in Annotations #26

rderimay opened this issue Oct 29, 2022 · 1 comment

Comments

@rderimay
Copy link

I'd like to display Annotations differently depending on the current zoom factor. Is there a way to access the current zoom factor? I couldn't find it... Thanks !

@pauljohanneskraft
Copy link
Owner

I'm currently unaware of such a functionality and I am actually wondering about how this would be done in UIKit MKMapView - of course, you could theoretically resort to MKOverlay instead, which would allow you to access the MKZoomScale inside the render-method of MKOverlayRenderer.

The best current workaround using overlays would probably be to write your own MKOverlayRenderer subclass. You could then wrap this renderer in a MapOverlay conforming struct (see MapCircle, MapPolyline, etc).

If that annotation/overlay is supposed to be created from SwiftUI views, you would probably need that overlay to be similarly generic to ViewMapAnnotation (just conforming to MapOverlay instead of MapAnnotation).

It would be really great to have this kind of functionality and flexibility in this project, so feel free to open a pull request or comment, if you happen to implement something that could also be used or at least adapted to help others as well 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants