Kothic JS is a full-featured JavaScript map rendering engine using HTML5 Canvas. It was initially developed as a JavaScript port of Kothic rendering engine written in Python.
- Rendering OpenStreetMap data visually on par with Mapnik
- MapCSS support (see How to Prepare a Map Style)
- rendering from lightweight GeoJSON-like tiles (see Tiles Format)
- easy integration with Leaflet (interacrive maps library)
Include kothic.js
from the dist
directory on your page. Now you can call:
Kothic.render(
canvas, // canvas element (or its id) to render on
data, // JSON data to render
zoom, // zoom level
additionalStyle, // (optional) explained below
onRenderComplete, // (optional) callback to call when rendering is done
buffered // (optional) if true, result will appear only after all layers are rendered
);
additionalStyle
is a function of the following form (for example):
function(style, tags, zoom, type, selector) {
if (tags.building == 'yes' && !tags['addr:housename']) {
style['default']['fill-color'] = 'red';
}
}
Kothic JS is licensed under a BSD license, and we'll be glad to accept your contributions! Please send your pull requests to one of the guys below.
Darafei Praliaskouski (@Komzpa), Vladimir Agafonkin (@mourner), Maksim Gurtovenko (@Miroff)