L.esri.TiledMapLayer

Extends L.TileLayer

Access tiles from ArcGIS Online and ArcGIS Server to visualize and identify features. Copyright text from the service is added to map attribution automatically.

If you have published a Feature Service in ArcGIS Online, it can be used to create a static set of tiles as well. You can find details about that process in the ArcGIS Online Help.

Your map service must be published using the Web Mercator Auxiliary Sphere tiling scheme (WKID 102100/3857) and the default scale options used by Google Maps, Bing Maps and ArcGIS Online. Esri Leaflet will not support any other spatial reference for tile layers.

Constructor

Constructor Description
L.esri.tiledMapLayer(<Object> options) The options parameter can accept the same options as L.tileLayer. The only required parameter is url.

Options

L.esri.TiledMapLayer also accepts all L.TileLayer options.

Option Type Default Description
url String Required: URL of the Map Service with a tile cache.
zoomOffsetAllowance Number 0.1 If correctZoomLevels is enabled this controls the amount of tolerance for the difference at each scale level for remapping tile levels.
proxy String false URL of an ArcGIS API for JavaScript proxy or ArcGIS Resource Proxy to use for proxying requests.
useCors Boolean true Dictates if the service should use CORS when making GET requests.
token String null Will use this token to authenticate all calls to the service.

Methods

L.esri.TiledMapLayer inherits all methods from L.TileLayer.

Method Returns Description
authenticate(<String> token) this Authenticates this service with a new token and runs any pending requests that required a token.
metadata(<Function> callback, <Object> context) this Requests metadata about this Feature Layer. Callback will be called with error and metadata.
featureLayer.metadata(function(error, metadata){
  console.log(metadata);
});
identify() this Returns a new L.esri.services.IdentifyFeatures object that can be used to identify features on this layer. Your callback function will be passed a GeoJSON FeatureCollection with the results or an error.
featureLayer.identify()
  .at(latlng, latlngbounds, 5)
  .run(function(error, featureCollection){
    console.log(featureCollection);
  });

Events

L.esri.TiledMapLayer fires all L.TileLayer events.

Example

var map = L.map('map').setView([37.7614, -122.3911], 12);

L.esri.tiledMapLayer({
  url: 'https://services.arcgisonline.com/ArcGIS/rest/services/USA_Topo_Maps/MapServer',
  maxZoom: 15
}).addTo(map);

Edit this page on GitHub