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

watchOS support for overlays? #41

Open
keyle opened this issue Mar 25, 2023 · 2 comments
Open

watchOS support for overlays? #41

keyle opened this issue Mar 25, 2023 · 2 comments

Comments

@keyle
Copy link

keyle commented Mar 25, 2023

Hi,

trying to render some images on top of a map on my Apple Watch (rain radar gifs on top of map)

I did this on the web previously and thought, gee, that'd be nice on my wrist!

Having some difficulty trying to render images on the map, I found your library.
After adding it... Found this #if !os(watchOS) ... code ... #endif

Bummer.

So, simple question, is it a case of impossible at the moment or ... something else? It seems deliberate!

thanks for your time,
keyle

@pauljohanneskraft
Copy link
Owner

This library does not really implement any functionality on its own but is rather a wrapper around the existing APIs that make it a bit more useful for the use with SwiftUI where the APIs in MapKit itself often lack the exposure of functionality that would otherwise be there (e.g. when using WatchKit directly in this case). So, if there is a functionality that is part of WatchKit/MapKit that this library does not provide, let me know.

Okay, now to your concrete question: If you are "only" trying to display images on the map and do not care about map zoom scale, etc - annotations are the way to go (e.g. ImageAnnotation for watchOS). Unfortunately, MapKit on watchOS doesn't know about overlays (talking about MKOverlay here), so we cannot really build it into this library.

@pauljohanneskraft
Copy link
Owner

I just noticed a current bug about ImageAnnotation that the initializer with an imageNamed parameter does not set the respective value. So, please use ImageAnnotation(coordinate:image:centerOffset:) instead until a fix is released.

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