项目作者: ilomon10

项目描述 :
A feature props editor for react-mapbox-gl
高级语言: JavaScript
项目地址: git://github.com/ilomon10/react-mapbox-gl-editor-components.git
创建时间: 2019-01-18T04:55:43Z
项目社区:https://github.com/ilomon10/react-mapbox-gl-editor-components

开源协议:MIT License

下载


react-mapbox-gl-editor-components

NPM JavaScript Style Guide

Install

  1. npm install --save react@16.2.x react-dom@16.2.x |
  2. react-mapbox-gl@3.9.2 |
  3. @mapbox/mapbox-gl-draw@1.0.2 |
  4. mapbox-gl
  5. #peerDependencies
  6. npm install --save react-mapbox-gl-editor-components@beta

Usage

  1. import React, { Component } from 'react'
  2. import ReactMapboxGL from 'react-mapbox-gl'
  3. import '@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css';
  4. import MBEditorComponents from 'react-mapbox-gl-editor-components'
  5. const Map = ReactMapboxGl({
  6. accessToken: "YOUR.ACCESS.TOKEN"
  7. })
  8. class Example extends Component {
  9. render () {
  10. return (
  11. <Map
  12. containerStyle={{
  13. height: "100vh",
  14. width: "100vw",
  15. }}
  16. style="mapbox://styles/mapbox/streets-v9">
  17. <MBEditorComponents ></MBEditorComponents>
  18. </Map>
  19. )
  20. }
  21. }

License

MIT © ilomon10