david-ipr-simple-map
v0.0.3
Published
Simple ESRI map application that displays WebMap component.
Downloads
3
Readme
david-ipr-simple-map
Simple ESRI map application that displays WebMap component.
Component props:
- viewId (ArcGIS online webmap id)
- onMapLoad (returns "map" and "view" objects)
Installation
Run npm install --save david-ipr-simple-map
Example
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import IprMap from 'david-ipr-simple-map';
export default class MyMap extends Component {
constructor (props) {
super(props);
this.state = {
map: undefined,
view: undefined
}
}
onMapLoad = (map, view) => {
this.setState({
map,
view
});
}
render () {
return (
<IprMap
viewId="6627e1dd5f594160ac60f9dfc411673f"
onMapLoad={this.onMapLoad}
>
</IprMap>
)
}
}
ReactDOM.render((
<MyMap/>
), document.getElementById('container'));