Important: The partner map loads its libraries as modules
Description
Version 2.4 built Leaflet 1.9.4 and the marker cluster plugin 1.5.3 from their
npm packages, still as the two classic scripts in
Resources/, see
Important: The map libraries are built from their packages. They are built as modules now,
at the same versions, into
Resources/ with their
licences and stylesheets. The import map of the extension publishes them as
leaflet and leaflet., and the map module imports them.
Impact
- A page with the map loads the modules through the import map and the stylesheets from the version directories. It loads none of the classic files any more, see Deprecation: The classic files of the map libraries.
- The map sets no global variable. A project script that used
window., or the other globals of the classic files, has to importLeaflet Object leafletinstead, or load the deprecated classic files itself. A template that loads the classic scripts next to the shipped partial loads Leaflet twice, and the two do not share anything. - The stylesheet of the marker cluster plugin is loaded in full now. The copy the extension shipped held only its default look, so the animation of clusters that open and close was missing.
- A project that overrides
Partials/still registers whatever its copy registers. It has to take over the stylesheets, the marker icon attribute and the module, and drop the classic scripts, to get the modules. The asset identifiersPartner/ Map. html partner,C0 partner,C1 partnerandS0 partnerare gone, and so isS1 partnertogether with the stylesheet of the map, see Breaking: The partner map ships no stylesheet.C2 - The marker icon is the one the map showed before. Its images are copied to
Resources/, and the partial names the icon in the attributePublic/ Images/ Map/ data-of the map element. A template without it shows the icon of Leaflet.academic- partners- marker- icon - The specifiers
leafletandleaflet.are global to the page. When another extension or the theme mapsmarkercluster leafletas well, the import map holds only one of them, and the map and the other code share whichever Leaflet that is.