umap-project / umap

uMap lets you create maps with OpenStreetMap layers in a minute and embed them in your site.
https://umap-project.org
Other
1.19k stars 226 forks source link

chore: split umap.js in two modules #2257

Closed yohanboniface closed 4 days ago

yohanboniface commented 6 days ago

Long awaited step! Very intrusive change!

The umap.js old papa js style is now moved to modules, and split in two, as we did for layers and features: one module is for the data part, and the other is for the rendering part, and this one inherits from Leaflet.

Sadly, the split between those two modules is not as clear as I'd like it to be, as some functions my be interpreted or not as rendering.

What is now moved to the rendering module is all elements that inherit from Leaflet, so what concerns the map itself, but also controls in of the Leaflet world (inheriting from L.Control). In the other hand, UI elements that does not inherit from Leaflet are kept on the umap.js module (panels, tooltip, contextmenu…).

Also, Umap as a properties key, to follow geojson spec, and distinguish from LeafletMap.options.

This is a first step, that will need more work, but as tests pass, I'd suggest to merge if we agree on the choices and continue working with other (smaller) PRs (and I'll take care of rebasing current other PRs).

Some specific points I've in mind that does not smell good: