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

Override sprites #7251

Closed
JEVietti opened this issue Sep 7, 2018 · 5 comments
Closed

Override sprites #7251

JEVietti opened this issue Sep 7, 2018 · 5 comments

Comments

@JEVietti
Copy link

JEVietti commented Sep 7, 2018

There is currently no way to override the sprite sheet used by the basic mapbox provided styles. Without creating a custom style for each predefined style in mapbox studio or hosting the style yourself. Both of which are cumbersome to keep up to date, especially when using multiple map styles per application.

A solution much like https://www.mapbox.com/mapbox-gl-js/example/local-ideographs/ for sprites where a URL/path is provided that overrides the default would be ideal.

But if there is a current way to dealing with this use case please let me know.

(Note: Why did you guys use a dot instead of the standard pin for marker in your sprite sheets for streets and satellite-streets, all I want is a basic marker shown in the maki general, that in a separate issue is claimed to be in all styles as a part of general?)

@andrewharvey
Copy link
Collaborator

@JEVietti
Copy link
Author

JEVietti commented Sep 7, 2018

@andrewharvey Are you suggesting that I can use loadimage on a sprites.png(sprite-sheet), and use addImage with an array of objects{width, height, and data}(sprite.json) to replicate the functionality of loading through the sprite property on the style object?

@jfirebaugh
Copy link
Contributor

This seems like a duplicate of #4804; an updateImage API (or allowing addImage to overwrite) would be the way we'd support this.

@JEVietti
Copy link
Author

JEVietti commented Sep 7, 2018

@jfirebaugh To be clear I am not requesting the ability to explicitly override sprite images by id, by the title I meant override the sprite sheets being used themselves (not the best choice of title).

I am looking for a way to add sprites via an external sprite sheet that can have entirely different ids, without loading it through the sprite property in the style object. The reason being I would have to host multiple map styles per application for the sake of using a single sprite sheet.

@jfirebaugh
Copy link
Contributor

Sorry @JEVietti, but I don't think that's something we're likely to support. If anything, we're most likely to deprecate sprite sheets and make images a nested collection of styles, like layers and sources. #4086.

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

3 participants