Select to view content in your preferred language

esri leaflet base layers issues

90
3
a week ago
Labels (1)
lpauchet
New Contributor

Hi Everyone

I'm developing a web application where I use layers published on an ArcGIS server as the base layer. I'm encountering some issues with `esri-leaflet` when using TiledMapLayer and DynamicMapLayer.

Here are the problems I'm facing:

1. DynamicMapLayer: This version loads very slowly, which significantly degrades the user experience.

2. TiledMapLayer: With this version, I encounter an issue when changing the base layer for the second time. Specifically, the tiles from the previous layer are not completely erased, leading to a visual overlap.

If anyone has experience with these issues, I would greatly appreciate your input!

import L from "leaflet";
import { tiledMapLayer, dynamicMapLayer } from "esri-leaflet";
import "leaflet/dist/leaflet.css";

document.addEventListener("DOMContentLoaded", () => {
  // VERSION 1
  var topo = dynamicMapLayer({
    url: "https://geodata.npolar.no/arcgis/rest/services/Basisdata/NP_Basiskart_Svalbard_WMTS_3857/MapServer",
  });

  var ortho = dynamicMapLayer({
    url: "https://geodata.npolar.no/arcgis/rest/services/Basisdata/NP_Ortofoto_Svalbard_WMTS_3857/MapServer",
  });

  // VERSION 2
  // var topo = tiledMapLayer({
  //   url: "https://geodata.npolar.no/arcgis/rest/services/Basisdata/NP_Basiskart_Svalbard_WMTS_3857/MapServer",
  // });

  // var ortho = tiledMapLayer({
  //   url: "https://geodata.npolar.no/arcgis/rest/services/Basisdata/NP_Ortofoto_Svalbard_WMTS_3857/MapServer",
  // });

  var baseMaps = {
    Img: ortho,
    Topo: topo,
  };

  var overlayMaps = {};

  var map = L.map("map", {
    center: [78.2, 15.6],
    zoom: 10,
    layers: [ortho],
  });

  var layerControl = L.control.layers(baseMaps, overlayMaps).addTo(map);
});

 

0 Kudos
3 Replies
GavinRehkemper
Esri Contributor

Hi @lpauchet , thank you for posting the question.

Can you please tell us what versions of Leaflet and Esri Leaflet you are using? I have created replication cases using the latest versions:

  1. Your dynamicLayer examplehttps://jsbin.com/corurum/2/edit?html,output
    1. Behavior on my computer: As I pan around, the new tile loads in 1-2 seconds. Not amazing - that can be improved by optimizing the speed of the ArcGIS Server that is hosting this service.
  2. Your tiledMapLayer examplehttps://jsbin.com/qosecuz/2/edit?html,output
    1. Behavior on my computer: As I pan around, the performance is pretty good. When switch between layers I do not get any visual overlap.

Can you please tell us what versions of Leaflet and Esri Leaflet you are using, and also please test the URL on #2 above and see if you still get the issue, and if so please share detailed replication steps.

Thanks!

0 Kudos
lpauchet
New Contributor

Hi @GavinRehkemper ,

Here are the package version I'm using :

  "dependencies": {
    "esri-leaflet": "^3.0.0",
    "esri-leaflet-vector": "^4.3.0",
    "leaflet": "^1.9.4",
    "leaflet.control.layers.tree": "^1.1.1"
  }.
 
The bug for the version 2 can be reproduced with the version 3.0.0 of esri leaflet (https://jsbin.com/welodipusu/edit?html,output). The best would be in that case to use the last version 😊.
 
Best regards,
 
Louis
0 Kudos
GavinRehkemper
Esri Contributor

Hi Louis,

Thank you for the replication case. I am seeing your issue in Esri Leaflet v3.0.0. When I upgrade to the latest version, v3.0.17, your issue is resolved for me:

https://jsbin.com/govuyab/1/edit?html,output

Can you test that version and confirm that it's resolved for you too at version 3.0.17?

0 Kudos