Skip to content

React Leaflet V3 layer for displaying vector tiles without need for access token. Forked from ted-piotrowski

License

Notifications You must be signed in to change notification settings

mugambi40/react-leaflet-vector-layer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

React Leaflet V3 layer for displaying vector tiles without need for access token. Forked from ted-piotrowski

Resources

License

Stars

Watchers

Forks

Packages

No packages published