react-map-gl - Uber 开源的 React 地图组件
WARNING: This project is still very new and the API may change. There also may be Mapbox APIs that haven't yet been exposed.
react-map-gl provides an
overlay API so you can add visualization overlays.
npm install react-map-gl --save
// Add additional overlays here... ])
mapStyle property of the
MapGL as well as several of the built in
overlay properties must be provided as
ImmutableJS objects. This allows
the library to be fast since computing changes to props only involves checking
if the immutable objects are the same instance.
To develop on this component, install the dependencies and then build and watch the static files.
To serve example app:
$ npm start & $ open "http://localhost:9966/?access_token="`echo $MapboxAccessToken`
echo $MapboxAccessToken returns your Mapbox access token.
Once complete, you can view the component in your browser at localhost:9966. Any changes you make will automatically run the compiler to build the files again.
This project is not affiliated with either Facebook or Mapbox.
- SF GeoJSON data from: SF OpenData.