Skip to content

ilomon10/react-mapbox-gl-editor-components

Repository files navigation

react-mapbox-gl-editor-components

NPM JavaScript Style Guide

Install

npm install --save  react@16.2.x react-dom@16.2.x |
                    react-mapbox-gl@3.9.2 |
                    @mapbox/mapbox-gl-draw@1.0.2 |
                    mapbox-gl 
                    #peerDependencies
npm install --save react-mapbox-gl-editor-components@beta

Usage

import React, { Component } from 'react'
import ReactMapboxGL from 'react-mapbox-gl'

import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';

import MBEditorComponents from 'react-mapbox-gl-editor-components'

const Map = ReactMapboxGl({
  accessToken: "YOUR.ACCESS.TOKEN"
})

class Example extends Component {
  render () {
    return (
      <Map 
        containerStyle={{
          height: "100vh",
          width: "100vw",
        }}
        style="mapbox://styles/mapbox/streets-v9">
        <MBEditorComponents />
      </Map>
    )
  }
}

License

MIT © ilomon10