leaflet-tiled-geojson
v0.1.0
Published
A Leaflet plugin for tiled GeoJSON
Downloads
106
Readme
leaflet-tiled-geojson
Leaflet layer for displaying tiled GeoJSON data. Handles levels of detail and feature deduplication. Essentially a drop in replacement for an L.GeoJSON layer.
See tiled-geojson for generating tiled GeoJSON.
Example
The following example is for tiled GeoJSON located as follows relative to the root of the web directory.
path/
├─ to/
│ ├─ tiledgeojson/
│ │ ├─ tiledgeojson.json
│ │ ├─ tiles/
│ │ │ ├─ <sha hash>.json
│ │ │ ├─ ...The tiled GeoJSON layer can be added similar to an L.GeoJSON layer. Options accepted are the same as an L.GeoJSON layer.
var map = L.map('map');
var tiledGeoJsonLayer = L.tiledGeoJSON('/path/to/tiledgeojson/', {
style: {
color: 'red',
fillColor: 'black',
weight: 0.5
}
}).addTo(map);