1.0.9 • Published 3 years ago

react-city-space-mapbox v1.0.9

Weekly downloads
50
License
MIT
Repository
github
Last release
3 years ago

react-city-space-mapbox

by the Growth Lab at Harvard's Center for International Development

Visualize the City Space using Mapbox

This package is part of Harvard Growth Lab’s portfolio of software packages, digital products and interactive data visualizations. To browse our entire portfolio, please visit The Viz Hub at growthlab.app. To learn more about our research, please visit Harvard Growth Lab’s home page.

View live example ↗

NPM JavaScript Style Guide

Install

npm install --save react-city-space-mapbox

Usage

import React, {useRef} from 'react'
import OptionsBar from './OptionsBar' // child components can use the map context to trigger events
import CitySpaceMap from 'react-city-space-mapbox'

const App = () => {
  const rootRef = useRef<HTMLDivElement | null>(null);
  return (
    <React.Fragment>
      <CitySpaceMap
        accessToken={accessToken}
        rootRef={rootRef}
        cityGeoJson={cityGeoJson}
        cityUMapJson={cityUMapJson}
      >
        <OptionsBar />
      </CitySpaceMap>
      <Root ref={rootRef} />
    </React.Fragment>
  );
}

export default App

License

MIT © The President and Fellows of Harvard College

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago