-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Maki Icon Generation
mramato edited this page Sep 28, 2014
·
1 revision
Cesium ships with the Maki icon set, which is a set of SVG files created by MapBox for many common map icons. We need to massage them slightly in order to use them effectively. Thankfully the entire process is automated. It consists of the following steps.
- Download and unzip the latest release of the maki icon set.
- Use Inkscape on the command line to batch convert the svg files to 512x512 png files.
- Use a centerCropResize to crop/center/resize the PNG files so they can be used by Cesium.
- Use pngCrush
- Replace the Cesium
Source/Assets/Textures/maki
directory with the new icons.
The below bash script can be run inside of the src directory of the maki release. All you have to do is take the generated png files and move them to Cesium.
#!/bin/bash
for svgFile in *-24.svg; do
pngFile="${svgFile%-24.svg}.png"
crushedFile="${pngFile%.png}-crushed.png"
inkscape "$svgFile" --export-png=$pngFile -w 512 -h 512
centerCropResize $pngFile 96
pngcrush $pngFile $crushedFile
mv $crushedFile $pngFile;
done