Select to view content in your preferred language

Overlay raster image in Leaflet map

1208
1
10-16-2022 04:55 PM
Labels (1)
RishavKaranjit
New Contributor

Hello, I want to overlay a tif image on my Esri Leaflet map. I had tried creating a web layer (Layer type: tile) and overlaying it but this returned a 404 error. This is the tile layer created by me: https://tiles.arcgis.com/tiles/x5wCko8UnSi4h0CB/arcgis/rest/services/HAND_Raster/MapServer

I tried to overlay this layer with L.esri.tiledMapLayer function. Is creating a web layer and overlaying it the correct method to overlay raster data?  If no, how can I overlay a raster? If yes, what I might have done wrong to overlay it?

0 Kudos
1 Reply
GavinRehkemper
Esri Contributor

Hi, thank you for the question.

It looks like your service's spatial reference is 4269. Note on the L.esri.TiledMapLayer documentation page:

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.

https://developers.arcgis.com/esri-leaflet/api-reference/layers/tiled-map-layer/

So, please publish your tiled service following those requirements, then you can use L.esri.TiledMapLayer.

Thanks!

0 Kudos