Closed naogify closed 3 years ago
@miya0001
I updated the option for build map icons. Please re-review it.
CLI manual is below
$ charites build style.yml --sprite-url [<sprite url>] --sprite-input [<icon source>] --sprite-output [<icon destination>]
$ charites build style.yml
This command will use ./icons/*.svg
to generate files below. Because --sprite-input
default value is ./icons/
and --sprite-output
default value is ./
.
Output
./basic.json
./basic.png
./basic@2x.json
./basic@2x.png
./style.json
Icon name is defined by sprite url in style.yml
. (eg, basic.json/png
is created by sprite url http://localhost:8888/basic
))
$ charites build style.yml --sprite-url http://localhost:8888/basic-white --sprite-input ./src/icons--sprite-output ./public
This command will use ./src/icons/*.svg
to generate files below.
Output
./public/basic-white.json
./public/basic-white.png
./public/basic-white@2x.json
./public/basic-white@2x.png
./style.json
@JinIgarashi Please review 😊
@JinIgarashi
Thank for your feedback!
However, I don't think we need to include this implementation on charites build because there is no clear relationship between inputted style.yaml and sprite icons.
The reason I used option is that I also want to add building sprite funtion to charites serve
, like charites serve --sprite-url http://localhost:8888/sprite
. So, I thougt it's better to use option to create sprite file to build command.
However, I thought it would be a good idea to provide both the charites sprite
command and the charites serve --sprite-url http://localhost:800/sprite
option, so that user can see the changes to the SVG icon on the map in real time, and also it would also make it easier to understand how to build sprites. What do you think?
Close #13
Add an option for building icon's sprite image and json.
You can build sprite image and json by adding--sprite
option like below.This option will replace style.jsonsprite
url and convert icon's svg files to sprites image and json file.You can also specify the svg files directory and dist directory like below.The default<icon source>
isicons/
, and the default<icons destination>
is the directory this command runs.