@mongodb-js/react-mapbox-gl-leaflet

1.0.0 • Public • Published

react-mapbox-gl-leaflet

github_forks_img github_stars_img

React wrapper of mapbox-gl-leaflet for react-leaflet.

Demos

Package version Dependency Versions Demo
1.0.0 react-leaflet@2.x.x, mapbox-gl-leaflet@0.0.3 Link

Installation

npm install @mongodb-js/react-mapbox-gl-leaflet --save

You will also need to manually install the following peer dependencies:

npm install leaflet react react-dom react-leaflet mapbox-gl mapbox-gl-leaflet --save

Usage

Please consult the mapbox-gl-leaflet documentation for available prop options, the Mapbox Vector Tile Specification for defining the map tile data, and the Mapbox Style Specification for defining the visual appearance of the map.

import React from 'react';
import { Map } from 'react-leaflet';
import MapboxGlLayer from '@mongodb-js/react-mapbox-gl-leaflet';

const DemoComponent = () => {
  return (
    <Map>
      <MapboxGlLayer
        accessToken="for-usage-with-mapbox-api-only"
        style="https://your-tile-server.com/path/to/your/map-style.json"
        attribution="Copyright attribution message goes here" />
    </Map>
  );
}

Contributing

Pull requests of any kind are welcome from the community. Please ensure you have read the guidelines for Contributing and this project's Code of Conduct before raising a pull request.

Maintainers

License

MIT License

Package Sidebar

Install

npm i @mongodb-js/react-mapbox-gl-leaflet

Weekly Downloads

13

Version

1.0.0

License

MIT

Unpacked Size

28.5 kB

Total Files

7

Last publish

Collaborators

  • mongodb-js-user
  • rueckstiess
  • durran
  • alexander_schroll
  • mabaasit
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish
  • mongo-j
  • orechova
  • himanshusinghs
  • c-buckingham
  • nbbeeken
  • dbx-node
  • nirinchev
  • pearsb1