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

Refactor to use es imports consistently, create global MapML namespace for element interfaces. #1003

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

prushforth
Copy link
Member

Use nodeResolve() in rollup to import node_modules by name
Refactor global L.symbol use to use imported symbol of same name from "leaflet" import.

Update module specifiers to include ".js" where it is a file for consistency.

Update package.json to use specific forks of
proj4leaflet (module version), leaflet-locatecontrol (module version)

Get import of proj4leaflet from specific branch of maps4html/proj4leaflet fork, which may never get merged upstream, but keeps differences in a git repo, at least, instead of in the build script.

Update some tests to import the leaflet module directly

Create window.L so that protomaps-leaflet will work.

Add rollup alias plugin to allow rollup to resove import of 'leaflet' to correct file (Leaflet lacks a "module" key as of 1.9.4)

Get import of proj4 from the module code that ships with that project. The maps4html/proj4leaflet fork works with proj4 code as shipped.

@prushforth prushforth force-pushed the es6-modularization branch 4 times, most recently from 7c9f417 to 81d3922 Compare October 29, 2024 00:13
Refactor / remove global L.symbol use to use
imported symbol of same name from "leaflet" import.

Update module specifiers to include ".js" where it is a file
in this project for consistency.

Update package.json to use specific forks of
proj4leaflet (module version), leaflet-locatecontrol (module version)

Get import of proj4leaflet from specific branch of maps4html/proj4leaflet
fork, which may never get merged upstream, but keeps differences in a
git repo, at least, instead of in the build script.

Update some tests to import the leaflet module directly

Create window.L.GridLayer, .L.DomUtil so that protomaps-leaflet will work.

Add rollup alias plugin to allow rollup to resove import of 'leaflet' to
correct file (Leaflet lacks a "module" key as of 1.9.4). This
allows us to not have to modify what's in node_modules.

Get import of proj4 from the module code that ships with that project.
The maps4html/proj4leaflet fork works with proj4 code as shipped.

Update "module","main" keys with correct path
relative to dist/ subdirectory

Use npm-installed esm version of leaflet-locatecontrol
control class, testing _isExpanded property only.  Force touch device
emulation by changing how context is launched, options passed.
@prushforth prushforth merged commit dc67a5d into Maps4HTML:main Oct 30, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant