📜 ⬆️ ⬇️

Kothic JS: OpenStreetMap renderer supporting MapCSS / 0.2 ported to javascript drawing on canvas

Many fans of OpenStreetMap are well aware of a renderer (renderer) under the name Kothic , which is well supported by the promising draft of the MapCSS / 0.2 cartographic style and can draw spectacular vector maps (even pseudo-3D - in an oblique projection, judging by the screenshots).

A few days ago, without much ado (apart from a separate page on the OSM wiki and even one tweet from the author of another interesting library - Leaflet, which was mentioned already in Habrahabr and which has managed to noticeably develop), the Kothic version came to light ported to javascript and called for this occasion Kothic JS. Interacting with Leaflet, the Kothic JS script draws a vector map on canvases (HTML5 canvas) and forms square tiles (“tiles”) from these canvases for the Leaflet cartographic engine. All this happens right in the browser.

You can easily find the Kothic JS code on GitHub (ibid is a short description ), and there is a demo site that draws on a canvas a vector map of the city of Minsk according to data from OpenStreetMap. For those who wish to visit this site, I strongly recommend preserving patience in advance: first, the generation of each square tile takes a few seconds, and secondly, the habraeffect is likely.

')

Source: https://habr.com/ru/post/121291/


All Articles