This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
forked from mapbox/maki
-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* add arrow and boat icons * adds car top view icon
nyurik
approved these changes
Jul 26, 2019
As mentioned on Slack, it would be great if we can avoid checking in the build artifacts, and make it part of |
4 tasks
nyurik
approved these changes
Aug 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes elastic/kibana#39715
This automatically builds PNG spritesheets of Maki icons with Signed Distance Fields (SDF) for better sizing, coloring, and rotation in WebGL maps.
SVGs are scaled to generate three sizes of spritesheets. These are generated at build time and added to the repo.
sprite@1 - standard size
sprite@2 - retina
sprite@4 - ultra-hd
Each spritesheet comes with a
.json
file which maps the icon ids to the location in the spritesheet. Images from the spritesheet can be added to a mapbox-gl map by iteratively running themap.addImage
method similar to these mapbox-gl-js internals.Implementation note: You may need to set
options.sdf = true
in themap.addImage
function.SDF icon generation requires changes to Mapbox's fontnik and spritezero libraries:
H
andV
SVG commands in thepathToSdf
function.option.sdf
to create PNG icons with signed distance fields directly from SVG iconsSee this POC showing one way we could load the spritesheet icons based on mapbox-gl-js internals.