Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time
February 28, 2022 15:18
April 8, 2022 10:04
March 11, 2019 11:19
September 15, 2016 15:36
February 15, 2022 18:25
January 6, 2017 15:52
September 15, 2016 15:36
May 26, 2020 09:43
April 8, 2022 10:04
April 8, 2022 10:04

Esri Leaflet Geocoder

The Esri Leaflet Geocoder is a small series of API helpers and UI controls to interact with the ArcGIS Online geocoding services.

npm version build status apache licensed jsDelivr Hits


Take a look at the live demo.

Example Image

To run this demo, you need to replace 'YOUR_API_KEY' with your API key. If you do not have an account then sign up for free at ArcGIS Developer.

<!DOCTYPE html>
    <meta charset="utf-8" />
    <title>Esri Leaflet Geocoder</title>

    <!-- Load Leaflet from CDN-->
    <link rel="stylesheet" href="" />
    <script src=""></script>

    <!-- Load Esri Leaflet from CDN -->
    <script src=""></script>

    <!-- Esri Leaflet Geocoder -->
    <script src=""></script>

    <!-- Make the map fill the entire page -->
      #map {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;

    <div id="map"></div>
      var map ="map").setView([45.5165, -122.6764], 12);
      var tiles = L.esri.basemapLayer("Streets").addTo(map);

      // create the geocoding control and add it to the map
      var searchControl = L.esri.Geocoding.geosearch({
        providers: [
            // API Key to be passed to the ArcGIS Online Geocoding Service
            apikey: 'YOUR_API_KEY'

      // create an empty layer group to store the results and add it to the map
      var results = L.layerGroup().addTo(map);

      // listen for the results event and add every result to the map
      searchControl.on("results", function (data) {
        for (var i = data.results.length - 1; i >= 0; i--) {

API Reference



a control for auto-complete enabled search



A basic wrapper for ArcGIS Online geocoding services. Used internally by L.esri.Geocoding.geosearch.



An abstraction for submitting requests to turn addresses into locations.


An abstraction for submitting requests for geocoding suggestions.


An abstraction for submitting requests for address candidates associated with a particular location.

Development Instructions

  1. Fork and clone Esri Leaflet Geocoder
  2. cd into the esri-leaflet-geocoder folder and install the dependencies with npm install
  3. Run npm start from the command line. This will compile minified source in a brand new dist directory, launch a tiny webserver and begin watching the raw source for changes.
  4. The example at debug/sample.html should 'just work'
  5. Make your changes and create a pull request



Find a bug or want to request a new feature? Please let us know by submitting an issue.


Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Terms and Conditions

In order use the ArcGIS geocoding service you need the following:

  1. An ArcGIS Developer account or ArcGIS Online account.
  2. If your application uses an basemap layer service or other Esri data, you must displayPowered byEsri in the map attribution. See Basemap attribution for more details.

Not-stored vs stored geocodes

To determine if there is a cost associated with using the Esri Leaflet Geocoder and the ArcGIS geocoding service, if you have an ArcGIS Developer account, go to Pricing, or, if you have an ArcGIS Online account, go to Credits by Capability.

Note: To store geocoding results, pass forStorage: true and a valid access token (see Esri Leaflet Get Started).


Copyright © 2013-2022 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.