react-leaflet-vector-layer
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

react-leaflet-vector-layer

Vector tile layer for React Leaflet V3. Tested with both Mapbox, Maptiler vector tiles and selfhosted vector tiles. Also works in conjunction with React Leaflet Layers Control.

Mapbox

import { MapContainer } from 'react-leaflet';
import VectorTileLayer from 'react-leaflet-vector-layer';

const App = () => {
  <MapContainer center={[47.5415, -122.393]} zoom={10} style={{ height: '100%' }}>
    <VectorTileLayer
      styleUrl="mapbox://styles/customstyles/ckpslkwor05q318mzmetjbv5z"
      accessToken="XXXX"
    />
  </MapContainer>
}

Maptiler

import { MapContainer } from 'react-leaflet';
import VectorTileLayer from 'react-leaflet-vector-layer';

const App = () => {
  <MapContainer center={position} zoom={13}>
    <VectorTileLayer
      styleUrl="https://api.maptiler.com/maps/outdoor/style.json?key=XXXX"
    />
  </MapContainer>
}

/react-leaflet-vector-layer/

    Package Sidebar

    Install

    npm i react-leaflet-vector-layer

    Weekly Downloads

    0

    Version

    0.1.8

    License

    MIT

    Unpacked Size

    7.14 kB

    Total Files

    9

    Last publish

    Collaborators

    • lawmug