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 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.Query, L.esri.IdentifyFeatures and L.esri.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