Skip to content

Commit

Permalink
Integrate protomaps-leaflet
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
prushforth committed Aug 28, 2024
1 parent 7853233 commit 80f7d94
Show file tree
Hide file tree
Showing 49 changed files with 1,282 additions and 77 deletions.
12 changes: 11 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = function(grunt) {
const Diff = require('diff');
const nodeResolve = require('@rollup/plugin-node-resolve');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssmin: {
Expand Down Expand Up @@ -94,6 +95,13 @@ module.exports = function(grunt) {
src: ['index.html'],
dest: 'dist/'
},
{
expand: true,
flatten: true,
filter: 'isFile',
src: ['src/pmtilesRules.js'],
dest: 'dist/'
},
{
expand: true,
cwd: 'node_modules/leaflet.locatecontrol/src/',
Expand Down Expand Up @@ -199,7 +207,9 @@ module.exports = function(grunt) {
},
rollup: {
options: {
format: 'iife'
format: 'iife',
plugins: [nodeResolve()],
external: './pmtilesRules.js'
},
main: {
dest: 'dist/mapml.js',
Expand Down
Loading

0 comments on commit 80f7d94

Please sign in to comment.