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

addImage support for symbol icons #44

Closed
tobrun opened this issue Mar 16, 2019 · 5 comments
Closed

addImage support for symbol icons #44

tobrun opened this issue Mar 16, 2019 · 5 comments

Comments

@tobrun
Copy link
Collaborator

tobrun commented Mar 16, 2019

We currently don't have a way to set an image to the currently loaded style. Atm we can only reference icon ids of images downloaded as part of the style spritesheet.

@TimothySealy
Copy link
Collaborator

I'm currently exploring the idea to add images to a specific folder (for example "assets/symbols") sharing them with the underlying platforms. From there you can reference icons based on the name.

For example if you have an camera icon stored in "assets/symbols/camera.png" then you can add a symbol (with option iconName set to "camera.png") referencing that asset. I have a working iOS implementation on my development branch.

@alfonsodev
Copy link

@TimothySealy that sounds great, do you have plans to open a Pull Request here ?

@tobrun
Copy link
Collaborator Author

tobrun commented May 13, 2019

Flagging here that with the upcoming SDK releases of both iOS as Android (v7.4.0), we are adding a new map change event that is emitted when the style needs a image resource (if not already added). This would simplify integration of suggested approach #44 (comment) more easily + has the benefit of only lazy loading images when needed.

PR of those changes in mapbox/mapbox-gl-native#14302 and mapbox/mapbox-gl-native#14320.

@TimothySealy
Copy link
Collaborator

I've created a PR (#79) for tracking the implementation of custom symbols. Currently the legacy API (MGLPointAnnotation) is used for creating the symbols. Will check the recent release of the Mapbox SDKs for the new map change event and how this can be incorporated.

@TimothySealy
Copy link
Collaborator

Closed by PR #79.

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

No branches or pull requests

3 participants