Widget HTML Atas

Hand Drawn Polygons For Leaflet


You powerfulness accept seen examples of rough.js floating some on social media this week. Rough.js is a novel sail based library for creating graphics which accept a sketchy, hand-drawn appearance. The library's github page includes a peachy d3.js present map inwards which each of the states has been filled inwards amongst a dissimilar hand-drawn style.

Rough.js doesn't alone live on amongst static maps. Because the library is sail based yous tin move besides overlay hand-drawn, sketch similar polygons on transcend of an interactive map. At to the lowest degree yous tin move if yous role the novel Leaflet.RoughCanvas plug-in for Leaflet maps. The plug-in allows yous to add together polylines too polygons to a Leaflet.js map which accept a hand-drawn style.

Here's a demo map which I created using Leaflet.RoughCanvas amongst a Mapbox styled base-map.