Get started with esri-leaflet-geocoder CDN
Apache-2.0 licensed
Esri-Leaflet-Geocoder is a plugin that integrates Esris geocoding service into Leaflet maps.
Tags:- geocoding
- ArcGIS
- Leaflet
Stable version
Copied!
How to start using esri-leaflet-geocoder CDN
// Include required libraries
L.esri.accessToken = "YOUR_ARCGIS_ONLINE_ACCESS_TOKEN"; // Replace with your ArcGIS Online access token
// Create a map
const map = L.map('mapid').setView([51.505, -0.09], 13);
// Include esri-leaflet-geocoder library
L.esri.util.registerPlugin(/esri-leaflet-geocoder.js/);
// Initialize the geocoder plugin
const geocoder = L.esri.Geocoding.geocoder();
// Add a search control to the map
const searchControl = L.esri.Controls.Geocoding.geocoding({
position: 'topright',
geocoder: geocoder,
});
map.addControl(searchControl);
// Add a marker to the map that moves to the location found by the geocoder
const marker = L.marker([], { draggable: false }).addTo(map);
// Bind the geocoder to the search control
searchControl.on('geocode:result', function (event) {
marker.setLatLng(event.result.location);
});
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
0.0.1-alpha
0.0.1-alpha.1
0.0.1-alpha.2
0.0.1-beta.1
0.0.1-beta.2
0.0.1-beta.3
0.0.1-beta.4
0.0.1-beta.5
0.0.1-rc.1
1.0.0
1.0.0-rc.1
1.0.0-rc.2
1.0.0-rc.3
1.0.0-rc.4
1.0.1
1.0.2
2.0.0
2.0.0-beta.1
2.0.0-beta.2
2.0.0-beta.3
2.0.1
2.0.2
2.0.3
2.1.0
2.1.1
2.1.2
2.1.3
2.1.4
2.2.0
2.2.1
2.2.10
2.2.12
2.2.13
2.2.14
2.2.2
2.2.3
2.2.4
2.2.6
2.2.7
2.2.8
2.2.9
2.3.0
2.3.1
2.3.2
2.3.3
2.3.4
3.0.0
3.0.0-beta.0
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
*** 3.1.5