Skip to content

visgl/react-maplibre

Repository files navigation

version build downloads

react-maplibre | Docs

@vis.gl/react-maplibre is a suite of React components designed to provide a React API for maplibre-gl. More information in the online documentation.

See our Design Philosophy.

Installation

Using this package requires react >= 16.3 and maplibre-gl >= 4.0.0.

npm install @vis.gl/react-maplibre maplibre-gl

Example

import * as React from 'react';
import {Map} from '@vis.gl/react-maplibre';
import 'maplibre-gl/dist/maplibre-gl.css';

function App() {
  return <Map
    initialViewState={{
      longitude: -100,
      latitude: 40,
      zoom: 3.5
    }}
    style={{width: 600, height: 400}}
    mapStyle="https://demotiles.maplibre.org/style.json"
  />;
}

Contribute

See contribution guide.

Attributions

react-maplibre is part of vis.gl, an OpenJS Foundation project.