-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add Map#{add,remove}Image #2059
Comments
I don't think we should support this; it would make it impossible to implement a 100% fidelity |
Would you be ok with leaving this functionality undocumented, or made as a private API? It would indeed break compatibility with |
We could have both if we allow embedded base64 encoded sprites in the stylesheet mapbox/mapbox-gl-style-spec#220 |
Endusers myself included are really having trouble setting/creating spritesheets. But i gather from this answer that there's a way to do so in Studio? I'de really like it if somebody would take a look at this question: http://stackoverflow.com/questions/35565968/how-can-i-add-markers-to-the-mapbox-light-map-style That's not the first question regarding sprites and will certainly not the last. I hope there's a good solution so i can help these people. Sorry if this is not the place, feel free to delete this comment. Thanks in advance. |
We have a hacky workaround for this (#2277) that uses stringified JSON in the ImageSprite base to essentially implement a |
I work with @dcervelli on this and we've spoken to @ryanbaumann about this problem offline. We're still maintaining our fork (with this commit: AndyMoreland@2a3d879) over at https://github.com/AndyMoreland/mapbox-gl-js/commits/0-22-1-sprite-and-npe-and-no-validation-and-fast-selection. With a recent update of mapbox-gl-js it seems like the raster tile source changed some of its behavior so that when we update the sprite map using our workaround we see all of the background tiles flicker and redraw. This means that changing a single point's sprite requires redrawing everything on the map, which is not a great user experience. It'd be awesome if we could get some sort of API for changing the sprite map without redrawing everything. We'd be happy to take a painful API right now. We can guarantee only additive changes -- or things like that -- if necessary. |
We added I'm less concerned about round-tripping now than I was in #2059 (comment). |
If I were an end user, I would likely believe that a method called Is it too late to adjust course slightly and call it |
The name was chosen based on the intended future direction described in mapbox/mapbox-gl-style-spec#220. |
Thanks! Got it. I'll take the naming conversation upstream. |
Based on the upstream conversation, |
I'm not a fan of Given our planned direction in #2741, I think it's acceptable to introduce a |
From the roadmap, it sounds like work on this might be coming in the next sprint, does that sound right? |
As the roadmap says:
😄 |
@lucaswoj / @alinapaz: @AndyMoreland and I were looking at the way you guys are looking to fix this, and want to be really clear about what our problem is with the current implementation. While adding an API to change the sprite sheet will be helpful, our key issue is that all layers are redrawn when the sprite sheet is changed. This causes a really bad user experience for us when we add new layers to the map with new sprites, as the raster base layer flashes repeatedly. |
@pwilczynski Yes, smooth sprite transitions are in scope for this project 😄 |
@lucaswoj - really excited about this, but struggling a bit to figure out where to inject our UINT32 patch in the new model. Any suggestions? |
@pwilczynski The changes shouldn't affect your patch. Are you seeing a regression? The sprite atlas copies images out of the sprite and into a new texture. The |
@pwilczynski am I right in thinking that the reason for the uint32 patch was to work around a limit in the number of symbols that could be present in a single tile? If so, then I think the patch may no longer be necessary as a result of a previous change (#4217) that removed this limitation. |
yeah, that was the reason. there are still warnings in the code alluding to the problems: https://github.com/mapbox/mapbox-gl-js/blob/master/src/data/bucket/symbol_bucket.js#L689 |
I haven't finished integrating with the new |
In Mapbox Studio, keeping the sprite sheet in sync between the Studio UI, mapbox.com and the map is tricky and has been a consistent source of subtile bugs. Since we have the sprite json and png within Studio, we'd like a way to manually manage the sprite sheet in mapbox-gl-js.
map.setSprite(spriteJson, springPNG)
The json property is the metadata object, The png property could either be a data URI or a Blob.
This method should be supported in the style_batch API as well.
This API proposal would overload the API proposal in #2058, it has two args instead of one.
The text was updated successfully, but these errors were encountered: