National Patience Month

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

    0.1.7 • 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>
    }
    

    Install

    npm i react-leaflet-vector-layer

    DownloadsWeekly Downloads

    35

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    6.85 kB

    Total Files

    9

    Last publish

    Collaborators

    • lawmug