L.esri.Geocoding.ReverseGeocode

Extends L.esri.Task

L.esri.Geocoding.ReverseGeocode is an abstraction for submitting requests for address candidates associated with a particular location. You can find more information and the source code for this plugin here.

Constructor

ConstructorDescription
L.esri.Geocoding.reverseGeocode(<Object>options)Creates a new `ReverseGeocode` task.

You can pass any options you can pass to L.esri.Task. The url will be the ArcGIS World Geocoder by default but a custom geocoding service can also be used.

Methods

MethodReturnsDescription
latlng(<L.LatLng>latlng)thisThe `L.LatLng` object for which an associated address will be queried.
distance(<Integer>distance)thisThe distance (in meters) around the point for which addresses will be queried. The default value is `100`.
language(<String>language)thisThe language to use when returning address candidates.
intersection(<Boolean>returnIntersection )thisSet this value to `true` if you'd like the nearest intersection to be returned (Default value is `false`).
run(<Function>callback, <Object>context)XMLHttpRequestExecutes the request chain and accepts the response callback.

Examples

Use dark colors for code blocksCopy
  
1
2
<link rel="stylesheet" href="./esri-leaflet-geocoder.css">
<script src="./esri-leaflet-geocoder.js"></script>
Use dark colors for code blocksCopy
         
1
2
3
4
5
6
7
8
9
L.esri.Geocoding.reverseGeocode({
  apikey: 'YOUR_API_KEY' // required when using the ArcGIS geocoding service
})
.latlng([48.8583, 2.2945])
.run(function (error, result, response) {
    // callback is called with error, result, and raw response
    // result.latlng contains the coordinates of the located address
    // result.address contains information about the match
});

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.