L.esri.Util

Utility methods used internally by Esri Leaflet. These methods are useful for converting data between ArcGIS and Leaflet formats.

Method Returns Description
extentToBounds(<Extent> extent) LatLngBounds Converts ArcGIS Extent objects to Leaflet LatLngBounds objects.
boundsToExtent(<LatLngBounds> bounds) Extent Converts Leaflet LatLngBounds objects to ArcGIS Extent objects.
arcgisToGeojson(<ArcGIS Geometry> arcgis)
arcgisToGeojson(<ArcGIS Feature> arcgis)
GeoJSON Converts ArcGIS Geometry Objects or ArcGIS Feature Objects objects to GeoJSON. If you pass a GeoJSON Feature or FeatureCollection you should also pass idAttribute to assign a property from the feature attributes to the ID of the GeoJSON Feature, 'OBJECTID' or 'FID' attributes by default.
geojsonToArcGIS(<GeoJSON> geojson, <String> idAttribute) Object Converts GeoJSON objects to ArcGIS Geometry Objects or ArcGIS Feature Objects. If you pass a GeoJSON Feature or FeatureCollection you should also pass idAttribute to assign a property in the output features to represent the features id, 'OBJECTID' by default.
responseToFeatureCollection(<Object> response, <String> idAttribute) FeatureCollection Converts an API response (returned by identify, query or find API methods) to a GeoJSON FeatureCollection. This is used internally by L.esri.Tasks.Query, L.esri.Tasks.Identify and L.esri.Tasks.Find to convert responses.
cleanUrl(<String> url) String Used internally to ensure that URLs have no leading or trailing whitespace and have a leading slash.

Edit this page on GitHub