-
Notifications
You must be signed in to change notification settings - Fork 38
Style reference: document sdf icons #97
Comments
👍 |
please |
I spent a lot of time trying to hunt down the details of SDF today. These are some of the questions/answers I have:
I'm not sure how much of this belongs in the style spec. At this point, in order to go from 100% ignorant of SDF to being able to use it, a solid tutorial with examples is needed. Maybe that belongs in the mapbox-gl-js examples section? With minimal information added to the spec? [edit: remove comment about limited style-ability of SDF, that was backwards] |
Some notes / corrections:
SDF is a raster format, not a vector one. Vector formats store geometry, raster formats store pixels. SDF is a raster format that is optimized for displaying resized, recolored, and rotated raster images.
Sorry about that mess:
We use SDF already and always for fonts: rotating and resizing fonts is only possible via SDF. We don't use SDF commonly for icons, and tools like Mapbox Studio don't create SDF icons. This is because SDF supports a single color. When that limitation is eliminated, a switch will be possible, but for now it's a hard blocker for using SDF as an icon format in end-user technology. Hence the lack of examples, of documentation, and so on: SDF is not actually used for icons in the vast majority of cases, and the one color limitation would lead most people to think it's broken. |
Just to be clear : there is currently no simple way to display icons/markers in Mapbox gl and change their color, except using the Circle layer type. Am I right ? |
For what it’s worth, iOS and macOS developers can add a template image to their asset catalog and add it to the style using |
Closing in favor of #444 and mapbox/mapbox-gl-js#3605 |
We need to document sdf icons usage.
The text was updated successfully, but these errors were encountered: