Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Leaflet 1.9.0 #1342

Closed
addy opened this issue Sep 22, 2022 · 11 comments
Closed

Support for Leaflet 1.9.0 #1342

addy opened this issue Sep 22, 2022 · 11 comments

Comments

@addy
Copy link

addy commented Sep 22, 2022

Describe the problem

Looks like esri-leaflet is currently on the 1.6.0 release of Leaflet. There have been a few changes, improvements and bug fixes since then. Does Esri have a usual timeline for incorporating new versions of Leaflet?

Describe the proposed solution

Libraries built on top of Leaflet that can be used in conjunction with Esri's plugin use more advanced versions of Leaflet. It would be great if this library supported the latest versions under the hood and allowed consumers to be able to upgrade their Leaflet dependencies.

Alternatives considered

No response

Additional Information

No response

@jgravois
Copy link
Contributor

jgravois commented Sep 22, 2022

since leaflet is a peerDependency its up to you to install any version >= 1.0.0 that you want.

"leaflet": "^1.0.0"

if you're seeing a specific problem here because of a breaking change in leaflet, it'd helpful if you could describe it in detail.

@addy
Copy link
Author

addy commented Sep 22, 2022

Sure, yeah here's the specific issue that I'm seeing:

Failed to compile.

./node_modules/esri-leaflet/src/Layers/FeatureLayer/FeatureGrid.js
Attempted import error: 'toLatLngBounds' is not exported from 'leaflet' (imported as 'latLngBounds').

@gavinr
Copy link
Contributor

gavinr commented Sep 22, 2022

@addy thanks, can you please post the steps I would need to follow to see that error?

@jgravois
Copy link
Contributor

jgravois commented Sep 22, 2022

i assume you'll see what @addy mentioned as soon as you:

npm install --save-dev leaflet@1.9.0
npm run build

@gavinr
Copy link
Contributor

gavinr commented Sep 23, 2022

Thanks @jgravois for the help. That workflow actually works for me:
image

@addy
Copy link
Author

addy commented Sep 23, 2022

I'll work on getting a StackBlitz, or similar, up shortly to reproduce the error I'm seeing locally. I think it's likely an issue arising from a mix of dependencies in an external project using both Leaflet and esri-leaflet.

@addy
Copy link
Author

addy commented Sep 24, 2022

@jgravois @gavinr Alright I've recreated the issue here: https://stackblitz.com/edit/vitejs-vite-k5qazv

Let me know if you have issues accessing that. It should build on start, but if not, you can just run npm run build

@gavinr
Copy link
Contributor

gavinr commented Sep 27, 2022

Thanks for the reproduction case. I do see it there, and have also tested on this project: https://github.com/gavinr/esri-leaflet-react-demo/tree/leaflet-1.9 and get the same error:
image

I'm wondering if this is the same issue as what's going on here:
Leaflet/Leaflet#8467 / Leaflet/Leaflet#8451

@natBizitza
Copy link

I get the same errors importing heatLayer, SemiCircleMarker, and SemiCircle.

@gavinr
Copy link
Contributor

gavinr commented Oct 4, 2022

Leaflet released v1.9.2 a few hours ago: https://github.com/Leaflet/Leaflet/releases/tag/v1.9.2

And I have tested that using 1.9.2 (instead of 1.9.0 or 1.9.1) fixes this issue for me.

@addy please test after running:

npm install leaflet@1.9.2

Thanks!

@addy
Copy link
Author

addy commented Oct 4, 2022

Looks like it's working for me now, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants