martin/docs/src
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
..
config-file.md Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
development.md Improve PG performance by 28% (!!!) (#703) 2023-06-04 15:02:00 -04:00
env-vars.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
installation.md cleanup installation docs 2023-06-04 00:12:24 -04:00
introduction.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
pg-connections.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
recipes.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
run-with-cli.md Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
run-with-docker-compose.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
run-with-docker.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
run-with-nginx.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
run.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
sources-composite.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
sources-files.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
sources-pg-functions.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
sources-pg-tables.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
sources-sprites.md Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
sources-sprites.png Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
SUMMARY.md Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00
tools.md cleanup installation docs 2023-06-04 00:12:24 -04:00
troubleshooting.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
using-with-deck-gl.md readme cleanups 2023-06-02 17:00:19 -04:00
using-with-leaflet.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
using-with-mapbox.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
using-with-maplibre.md Cleaning up mdbook (#697) 2023-06-02 01:16:41 -04:00
using.md Add dynamic sprites support (#715) 2023-06-16 08:19:47 -04:00