Skip to main content
100%

Leaflet.js × D3.js × geojson-vt.js - Redraw Canvas Tiles Map

✓ Published0🌍 Public
HHirosaji
Last edited Feb 25, 2020
Created on Oct 28, 2018

This example shows a slippy map interface using Leaflet.js alongside D3.js to render geographic boundaries from a GeoJSON dataset. Canvas tiles are generated in the frontend, converting vector data into raster tiles on demand. The core function `addCanvasTile` leverages the `geojson-vt.js` `tileIndex.getTile` API to extract features for a given zoom level and coordinate. Drawing occurs directly on HTML5 canvas elements, and the code uses Canvas `getImageData` to enable click detection on rendered polygons, with D3 selection handling mouse events for property feature identification.

AI-generated description
mit Licensed

Similar vizzes