Leaflet V2
https://leafletjs.com/2025/05/18/leaflet-2.0.0-alpha.html
Looks huge: Remove all L use, and import via ESM instead. (only if using v2!)
cc @hupe13
@bozdoz I’m interested in helping. I guess a bundler setup required to work with the ESM nodejs package? That’s a somewhat opinionated topic. Consider using wp-scripts—it could be useful if you plan to add Gutenberg blocks later. https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/
@bozdoz I can help you in testing. In any case, we must offer both options: Leaflet 1.9.4 and 2.0. My WordPress plugin depends on other Leaflet plugins, and those must also be migrated.
I'm thinking of just creating a proxy for v1 to work automatically with v2, and require the use of the leaflet-global script:
See:
https://codepen.io/bozdoz/pen/EaVOegY?editors=0010
That's using https://unpkg.com/[email protected]/dist/leaflet-global.js
Otherwise, I'm not entirely sure how to handle both v1 (global and cjs) and v2 (ESM)
@bozdoz If that works, why not. The simplistic style of the plugin is his best and strongest feature 🥇
Will you load the package with unpkg? I am from europe and we always try to keep external domain requests als low as possible because of GDPR. So I really hope you continue to service the script from your plugin.