Reference both esri-leaflet and ESRI JS API in same environment (Used separately / NOT mixed in mapviewers)

163
2
a month ago
GertConradie
Occasional Contributor

When I reference/include both https://unpkg.com/esri-leaflet@3.0.4/dist/esri-leaflet.js  and js.arcgis.com/4.19 into a shared html layout template (templates is used in two separate map pages ), the inclusion of the ESRI JS replace L.esri with something else.

Are there a way to use different global names for the two packages? 

Else I will duplicate my layout template.

 

Any advice would be much appreciated.

 

Tags (1)
0 Kudos
2 Replies
GavinRehkemper
Esri Contributor

Hi, thanks for the question. Could you please post an example code that demonstrates the error/problem that you're seeing? You can either post the HTML/JS/CSS right into a message here, or you can use a service like JSBin or Codepen or Stackblitz. Thanks!

0 Kudos
GertConradie
Occasional Contributor

Hi

Since I asked the question I got it working. (The leaflet side definitely 100%)

I'm working on an intermittent dojo  require(["dojo/ready"] issue that fail to load my own custom dojo package that use the ESRI JS API.

The times that my dojo package loads, both map frameworks work with two maps on the same page. Dont ask me to explain why one would do that... 🙂 

The order of references are important it seems.

I will give a complete example once it got my loading issue resolved, just to make sure its not related.

 

 

 

 

Just an update

0 Kudos