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

Add pmtiles support / dependency #966

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Conversation

prushforth
Copy link
Member

@prushforth prushforth commented Jul 30, 2024

Integrates protomaps-leaflet into mapml.js via rollup.
A user's style module should export the pmtilesRules object per the example in pmtilesStyles.js

@prushforth prushforth force-pushed the pmtiles branch 2 times, most recently from 1e84137 to 47d4d01 Compare July 31, 2024 15:24
@prushforth prushforth requested a review from AliyanH July 31, 2024 15:38
@prushforth
Copy link
Member Author

@AliyanH I think we should try to cue up simultaneous PRs against web-map-doc and experiments repos, potentially write a short blog post on the CG home page for publishing when they land.

Add TemplatedPMTilesLayer, update map-link to use it.

Add the application/vnd.mapbox-vector-tile media type to map-link,
which is the signal to pass {z}/{x}/{y}.mvt templates to TemplatedPMTilesLayer
Import symbolizer and other symbols explicitly from protomapsL

Update src/mapml/index.js to import from protomaps-leaflet module
directly.

Add grunt-rollup plugin-node-resolve to help bundle output esm from
 protomaps

Add dynamic import of "pmtilesRules.js" module, containing user styles
for pmtiles / mvt layers via
<map-link rel=stylesheet type=application/pmtiles+stylesheet>

Use protomaps-leaflet v 4.0.0

Add protomapsL as M.protomapsL

Add label rule with filter example for Spearfish to pmtilesRules.js

Move example pmtilesRules.js into src, dist

Add image comparison test for local pmtiles mvt source, win32 png files

Add linux images for templatedPMTilesMVTLayer.test.js

Replace linux image that was missing glyphs or something
Comment out flaky image comparison (IIRC label selection is based on
tile load order, so not reliable for a test, probably)

Let images of labelled maps be up to 1500 pixels different, since labels
can move around based on tile loading order, and the fonts on different
systems are / can be different.

Update test to accommodate change to use of noWrap: true option

Update image for PMTiles test comparison on linux, in light of change to
using noWrap: true for M.protomapsL.leafletLayer option

Change names of URL template variables in test so that it tests the
ability to use non-hardcoded variable names.

Merge upstream/main renaming of principal repo
Add spearfish.pmtiles data file to test infrastructure
Add test dependency on serve-static so that test server supports byte
range request, a requirement of protomaps-leaflet

Test rendering of pmtiles and mvt data sources using light and dark
themes built into protomaps-leaflet (may break with changes to those
themes, tbd)

Change API for pmtilesRules.js - eliminate need to have single file and
hardcoded file name:
use <map-link rel=stylesheet type=application/pmtiles+stylesheet href="URL to pmtilesRules module">
with ability to include above <map-link> for each <map-extent> or <layer->
as required.
Change playwright.config.js to match current playwright documentation.
REMOVE setup.js, which was used by jest, no longer required.

- update/add pmtiles / mvt tests
- remove hard-coded name for pmtilesStyles.js filename is up to user
- add blank map image test image
- log errors to console, used in test assertions (these messages may
be helpful tbd)
@prushforth prushforth marked this pull request as ready for review August 27, 2024 21:05
@prushforth prushforth mentioned this pull request Aug 28, 2024
5 tasks
@prushforth prushforth merged commit 80f7d94 into Maps4HTML:main Aug 28, 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