0

I need to display ArcGIS ESRI map hosted in intranet environment. I was following this example and it works fine when system is connected to internet.

As our Map Server is hosted in intranet environment so I cannot use above example. I have further investigated ESRI leaflet and found out that its making calls to online arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer for loading map tiles. I replaced this URL with our Map server URL https://{our domain}/intsrv/rest/services/Cache/StreetsNightBlue/MapServer but still tiles are not loaded.

I have added all required CSS and JS files offline in my project already.

 mapObject = L.map('mapDiv').setView([defaultLat, defaultLong], defaultZoom);
    L.esri.basemapLayer('Gray').addTo(mapObject);
    L.esri.Cluster.featureLayer({
        url: 'https://{our domain}/intsrv/rest/services/Cache/StreetsNightBlue/MapServer/0'
    }).addTo(mapObject);

When I run program, in console it giving tile not found error.

enter image description here

Update: Tiles appearing now but far away from marker cluster

enter image description here

Kindly help to fix this issue.

12
  • 1
    which tile is not found? When using L.esri.basemap, you're requesting tiles from esri's gray basemap, which requires an internet connection. Are those the tiles not being found? Or is it your Cluster tiles that are not being found? Commented Jul 19, 2021 at 14:39
  • I am new to Leaflet esri and did not know that I am requesting tiles through internet. I need tiles to be loaded from my offline server, not from internet. Map server is hosted at: https://{our domain}/intsrv/rest/services/Cache/StreetsNightBlue/MapServer Commented Jul 19, 2021 at 14:42
  • 1
    Yes hidden in the internals of L.esri.basemap, you are requesting their basemap tiles. If you want those specific tiles for your basemap, you'll have to serve them yourself. You didn't answer which tiles are not being found. Commented Jul 19, 2021 at 14:47
  • 1
    We already have setup offline server to serve tiles in intranet environment and tiles are loaded properly when I use ArcGis js api. I want to use ESRI leaflet JS to load tiles instead of ArcGIS API because I need to add other functionalities of leaflet later on. Hope it answers your question. Furthermore could you suggest piece of code which I need to put to load tiles from offline server. Commented Jul 19, 2021 at 15:51
  • I have added screenshot from browser console window. Commented Jul 19, 2021 at 16:00

0