arcgis-map-viewer
v1.0.1
Published
A package to display street-level maps using ESRI ArcGIS API
Maintainers
Readme
ArcGIS Map Viewer
A package to display street-level maps using ESRI ArcGIS API. This package allows you to display maps, search for addresses, and display coordinates.
Installation
npm install arcgis-map-viewerUsage
Basic Usage
import ArcGISMapView from 'arcgis-map-viewer';
// Create a map in a div with id "mapDiv"
const mapViewer = new ArcGISMapView('mapDiv');
// Set view by address
await mapViewer.setViewByAddress('1600 Amphitheatre Parkway, Mountain View, CA');
// Set view by coordinates
await mapViewer.setViewByCoordinates(37.4224082, -122.0856086);
// Clean up
mapViewer.destroy();With API Key
You need an ArcGIS API key for most production uses. Get a free key from https://developers.arcgis.com/.
import ArcGISMapView from 'arcgis-map-viewer';
const mapViewer = new ArcGISMapView('mapDiv', {
apiKey: 'YOUR_API_KEY',
zoom: 15
});
await mapViewer.setViewByAddress('1600 Amphitheatre Parkway, Mountain View, CA');You can also use coordinates:
await mapViewer.setViewByCoordinates(37.4224082, -122.0856086);Options
You can pass options to customize the map:
const mapViewer = new ArcGISMapView('mapDiv', {
zoom: 15 // Default zoom level
});Features
- Street-level maps using ArcGIS
- Address search functionality
- Coordinate display
- Customizable zoom levels
- Marker placement
Requirements
- Node.js
- ESRI ArcGIS API (included as dependency)
License
MIT
