Events

Event types common across components of Esri Leaflet are documented here.

Loading Event

DataValueDescription
boundsLatLngBoundsThe bounds that are currently being loaded.

Load Event

DataValueDescription
boundsLatLngBoundsThe bounds that were loaded.

NOTE: The load event will not fire if you add the layer to the map before adding the event listener. You must add the listener first and then add the layer to the map as follows.

var layer = new L.esri.FeatureLayer(url, options);

layer.on('load', function (e) {
// do something on load
});

layer.addTo(map);

Feature Create

createfeature is fired when a feature from the Feature Layer is loaded for the first time.

DataValueDescription
featureGeoJSON FeatureGeoJSON respresentation of the feature that was created.

Feature Remove

removefeature is fired when a feature is removed from the map, either as the result of a filter operation or because it was deleted from the service.

DataValueDescription
featureGeoJSON FeatureGeoJSON respresentation of the feature that was created.
permanentBooleantrue if the feature was permanently deleted from the service or false if the feature was removed as the result of a filter operation.

Feature Add

addfeature is fired when a feature that has already been created is added to the map again, usually the result of a filtering operation.

DataValueDescription
featureGeoJSON FeatureGeoJSON respresentation of the feature that was added.

Request Event

DataValueDescription
urlStringThe url the request was made to.
paramsObjectThe parameters that were passed to the request.
methodStringThe HTTP method that was used for the request.

Request Success Event

DataValueDescription
urlStringThe url the request was made to.
paramsObjectThe parameters that were passed to the request.
methodStringThe HTTP method that was used for the request.
responseObjectThe JSON returned from the request.

Request Error Event

DataValueDescription
urlStringThe url the request was made to.
paramsObjectThe parameters that were passed to the request.
methodStringThe HTTP method that was used for the request.
codeIntegerThe error code that was returned.
messageStringThe error message that was returned.

Authentication Event

DataValueDescription
authenticateFunctionPass a new access token to this method to retry the failed request(s).

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