George-Madeley
main
public
Vector tile rendering for Leaflet with support for offline use.
Based on propmaps-leaflet and leaflet.offline, this packge gives the ability to render vector tiles on a Leaflet.js map from online and offline sources.
To install Leaflet Vector Offline with npm, use the following command:
npm install leaflet-vector-offline
or with yarn:
yarn add leaflet-vector-offline
To use Leaflet Vector Offline, use the following code:
const map: Map = L.map("map");
const url: string = "https://<YourUrlGoesHere>/{z}/{x}/{y}.mvt";
const attribution: string: "";
const vectorLayer: VectorOfflineLayer = vectorOfflineLayer(url, {
attribution,
subdomains: "abc",
minZoom: minZoom,
maxZoom: maxZoom,
theme: "light",
});
vectorLayer.addTo(map);
Plugin for Leaflet.js that supports offline vector map tiles.
1
0
0
1