martin/tests
Yuri Astrakhan a5c5505713
Add dynamic sprites support (#715)
Dynamically create image sprites for MapLibre rendering, given a
directory with images.

### TODO
* [x] Work with @flother to merge these PRs
  * [x] https://github.com/flother/spreet/pull/59  (must have)
  * [x] https://github.com/flother/spreet/pull/57
  * [x] https://github.com/flother/spreet/pull/56
* [ ] https://github.com/flother/spreet/pull/62 (not required but nice
to have, can upgrade later without any code changes)
* [x] Add docs to the book
* [x] Add CLI param, e.g. `--sprite <dir_path>`
* [x] Don't output `.sprites` in auto-genned config when not in use

### API
Per [MapLibre sprites
API](https://maplibre.org/maplibre-style-spec/sprite/), we need to
support the following:
* `/sprite/<sprite_id>.json` metadata about the sprite file - all coming
from a single directory
* `/sprite/<sprite_id>.png` all images combined into a single PNG
* `/sprite/<sprite_id>@2x.json` same but for high DPI devices
* `/sprite/<sprite_id>@2x.png`

Multiple sprite_id values can be combined into one sprite with the same
pattern as for tile joining:
`/sprite/<sprite_id1>,<sprite_id2>,...,<sprite_idN>[.json|.png|@2x.json|@2x.png]`.
No ID renaming is done, so identical names will override one another.

### Configuration
[Config file](https://maplibre.org/martin/config-file.html) and possibly
CLI should have a simple option to serve sprites. The configuration may
look similar to how mbtiles and pmtiles are configured:

```yaml
# Publish sprite images
sprites:
  paths:
    # scan this whole dir, matching all image files, and publishing it as "my_images" sprite source
    - /path/to/my_images
  sources:
    # named source matching source name to a directory
    my_sprites: /path/to/some_dir
```

Implement #705
2023-06-16 08:19:47 -04:00
..
expected Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
fixtures Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
utils Minor refactor and cleanup (#716) 2023-06-15 18:36:41 -04:00
composite_source.html Multi-source support, new path structure (#456) 2022-11-26 04:46:40 -05:00
config.yaml Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
debug-deckgl.html Multi-source support, new path structure (#456) 2022-11-26 04:46:40 -05:00
debug-leaflet.html Multi-source support, new path structure (#456) 2022-11-26 04:46:40 -05:00
debug-maplibre.html Require PostGIS 3 and use ST_TileEnvelope (#497) 2022-11-30 18:57:27 +02:00
debug.html allow resize menu by drag side on tests/debug.html (#677) 2023-05-25 12:07:43 -04:00
mb_server_test.rs fix (re-)compression of images (#579) 2023-02-20 10:44:22 -05:00
pg_function_source_test.rs PG TileJSON changes, add vector_layers (#584) 2023-02-22 16:25:48 +00:00
pg_server_test.rs In auto-discover, hide geocolumns from tables with multiple ones (#663) 2023-05-22 09:44:21 -04:00
pg_table_source_test.rs PG TileJSON changes, add vector_layers (#584) 2023-02-22 16:25:48 +00:00
pmt_server_test.rs fix (re-)compression of images (#579) 2023-02-20 10:44:22 -05:00
test.sh Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00