Skip to content

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.

  1. Get (or create) MapCSS file. For example, you have a style file named awesome.mapcss
  2. If you want to generate CSS sprite, get all images mentioned in your style to one directory. For example, you put it to icons/
  3. Run MapCSS to JS converter python scripts/mapcss_converter.py --mapcss awesome.mapcss --icons icons
  1. Upload awesome.js and awesome.png to your server.
  2. Load awesome.js in your HTML page as JavaScript <script src="awesome.js"></script>
  3. Load CSS sprite awesome.png in your Leaflet map initialization code MapCSS.loadImages("awesome", "awesome.png");
  4. Enjoy your new style.
Clone this wiki locally