Leaflet dynamicMapLayer - tile vs export

244
1
01-26-2024 08:58 AM
Labels (1)
DanielDormont
Occasional Contributor

Hi, I have a map service that I am trying to display on my basemap using Leaflet. The map service is public and is hosted by an ArcGIS Enterprise site. It works, but sometimes the images are quite slow to load. Whereas on ArcGIS Online there's no issue at all. I notice that the two systems use two very different methods to pull the images. If you go to ArcGIS Online, eg 

https://www.arcgis.com/home/webmap/viewer.html?url=https%3A%2F%2Fpublicmap01.co.st-clair.il.us%2Farc...

and start zooming in, you'll notice it pulls images with URLs like https://publicmap01.co.st-clair.il.us/arcgis/rest/services/Imagery23/MapServer/tile/12/1572/1022 These load extremely fast because I'm assuming they are cached in some way.

But esri-leaflet does something quite different, loading images like https://publicmap01.co.st-clair.il.us/arcgis/rest/services/Imagery23/MapServer/export?bbox=-10031764... which often takes several seconds. 

Is there a way to have esri-leaflet use the cached tiles instead? Codesandbox example: https://codesandbox.io/p/sandbox/frosty-pine-qmsdwh 

0 Kudos
1 Reply
DanielDormont
Occasional Contributor

Hm. I partly answered my own question. If I use `esri.tiledMapLayer` instead of `esri.dynamicMapLayer` with the exact same URL, I see the tiled images.

So I guess my real question is, when displaying data from a map service, when should you use dynamicMapLayer vs tiledMapLayer?

0 Kudos