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 your portal, 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 should 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 does not officially support any other spatial reference for tile layers, however unofficial support maybe obtained though the the Proj4Leaflet plugin as shown in the projection samples.

Constructor

ConstructorDescription
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.

OptionTypeDefaultDescription
urlStringRequired: URL of the Map Service with a tile cache.
zoomOffsetAllowanceNumber0.1If correctZoomLevels is enabled this controls the amount of tolerance for the difference at each scale level for remapping tile levels.
proxyStringfalseURL of an ArcGIS API for JavaScript proxy or ArcGIS Resource Proxy to use for proxying requests.
useCorsBooleantrueDictates if the service should use CORS when making GET requests.
tokenStringnullWill use this token to authenticate all calls to the service.

Methods

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

MethodReturnsDescription
authenticate(<String> token)thisAuthenticates 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

Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

      const contoursPane = map.createPane('contours')
      contoursPane.style.zIndex = 400;

      const contoursLayer = L.esri.tiledMapLayer({
        url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Santa_Monica_contours_(map_tiles)/MapServer/",
        apiKey: accessToken,

        pane: contoursPane

      })

      contoursLayer.addTo(map)
Expand

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