-
Notifications
You must be signed in to change notification settings - Fork 46
How to prepare map style
saerdnaer edited this page Jul 3, 2011
·
4 revisions
Kothic-JS use MapCSS for map styling. If you want to prepare JS style for your map, follow this instruction.
- Get (or create) MapCSS file. For example, you have a style file named awesome.mapcss
- If you want to generate CSS sprite, get all images mentioned in your style to one directory. For example, you put it to
icons/
- Run MapCSS to JS converter
python scripts/mapcss_converter.py --mapcss awesome.mapcss --icons icons
- You need https://github.com/Miroff/mapcss-parser to run the converter
- Upload
awesome.js
andawesome.png
to your server. - Load
awesome.js
in your HTML page as JavaScript<script src="awesome.js"></script>
- Load CSS sprite
awesome.png
in your Leaflet map initialization codeMapCSS.loadImages("awesome", "awesome.png");
- Enjoy your new style.