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.

  • 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? – Seth Lutske Jul 19 '21 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 – Bilal Ahmed Jul 19 '21 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. – Seth Lutske Jul 19 '21 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. – Bilal Ahmed Jul 19 '21 at 15:51
  • I have added screenshot from browser console window. – Bilal Ahmed Jul 19 '21 at 16:00
  • It seems like your featurelayer is being treated as a tilelayer...are you sure the arcgis server where its hosted is treating it like a point feature layer, not a tile layer? – Seth Lutske Jul 19 '21 at 19:08
  • Quick update: I am able to load tiles from offline server to map surface. Now the problem is, it appears below marker cluster layer. I want marker clusters layer to appear at top of these tiles. I have updated post with screenshot. – Bilal Ahmed Jul 19 '21 at 19:34
  • ArcGIS server is treating is like tile layer, thats why I am able to get is displayed but problem is its not displaying correctly with expected coordinate and zoom level. – Bilal Ahmed Jul 19 '21 at 19:38
  • Unfortunately without a reproducible example, its going to be hard to help debug. – Seth Lutske Jul 19 '21 at 23:12
  • I understand. Our map environment is restricted so can't give access in order for you to test. Anyhow could you recommend here a link of program which can help me in displaying marker clusters on ArcGis ESRI offline map tiles using Leaflet plugin. I tried finding relevant example but failed. – Bilal Ahmed Jul 20 '21 at 08:42
  • Hi Bilal, I also recommend you to look for help using the [esri-leaflet issues](https://github.com/esri/esri-leaflet/issues). In my case, like Seth, I can't do much without access. – hhkaos Aug 06 '21 at 12:01
  • Hi https://stackoverflow.com/users/3541972/hhkaos , are there instructions on how to work with esri-leaflet in offline mode? With a locally installed server? – orenw Mar 31 '22 at 07:56

0 Answers0