React ESRI Maps
React component for rendering ESRI maps
Examples
Most basic map
<ReactEsriMap> <BaseMapLayer></BaseMapLayer> </ReactEsriMap>
Satellite imagery with labels
<ReactEsriMap = = > <BaseMapLayer ="Imagery"></BaseMapLayer> <BaseMapLayer ="ImageryLabels"></BaseMapLayer> </ReactEsriMap>
Tiled map layer
<ReactEsriMap = = > <TiledMapLayer ="https://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer"></TiledMapLayer> </ReactEsriMap>
Adding ESRI Feature set to map
// First, create this options object with the URL for the featuers you want to add var options = url: 'https://services.arcgis.com/rOo16HdIMeOBI4Mb/arcgis/rest/services/stops/FeatureServer/0/' ; // Then add it as a FeatureLayer return <div ='samplemap'> <ReactEsriMap = => <BaseMapLayer></BaseMapLayer> <FeatureLayer =></FeatureLayer> </ReactEsriMap> </div> ;
Adding GeoJSON to the map
// First let's create a GeoJSON object var data = type: 'Feature' properties: geometry: type: 'Point' coordinates: -770429411 389043478 ; // Then add it to the GeoJSON feature return <div ='samplemap'> <ReactEsriMap = = > <BaseMapLayer></BaseMapLayer> <GeoJSON =></GeoJSON> </ReactEsriMap> </div> ;