@renci/react-arcgis-components
v0.1.0
Published
Made with create-react-library
Downloads
1
Readme
@renci/react-esri-components
This contains Path and marker components for use with @esri/react-arcgis.
installation
$ npm i @renci/react-arcgis-components
usage
Note that @esri/react-arcgis
is a peer dependency of this package.
import
import React from 'react'
import { Map } from '@esri/react-arcgis'
import { Marker, Path } from 'react-esri-components'
use
// path = [{ long: -78.738638, lat: 23.875623 }, ...]
// markers = [{ long: -78.738638, lat: 23.875623 }, ...]
<Map>
<Path coordinates={ path } />
{
markers.map((props, i) => (
<Marker key={ `marker-${ i }_-${ props.long },${ props.lat }` } { ...props } />
))
}
</Map>
development
clone this repo.
$ git clone git remote add origin [email protected]:RENCI/react-arcgis-components.git
install dependencies.
$ npm i
start package local dev server.
$ npm start
start example local dev server..
$ cd example
$ npm start
the example pulls the package source from its parent directory with hot module reloading, so changes to the example project and changes to the package source triggers a browser reload.