maplibre/martin
Add support for tile, sprite, and font source aliasing
Aperta
#1076 aperta il 16 dic 2023
confighelp wantedrust
Metriche repository
- Star
- (3761 stelle)
- Metriche merge PR
- (Merge medio 2g 16h) (78 PR mergiate in 30 g)
Descrizione
Martin allows users to specify multiple comma-separated sources and expect it to work like a single source.
| type | URL |
|---|---|
| TileJSON | /{source1},...,{sourceN} |
| Tiles | /{source1},...,{sourceN}/{z}/{x}/{y} |
| Sprites | /sprite/<sprite_id1>,<sprite_id2>,...,<sprite_idN><suffix>Where the suffix could be .png, .json, @2x.png, @2x.json |
| Fonts | /font/{name1},…,{nameN}/{start}-{end} |
Proposal
Server configuration should allow administrator to configure "aliases" - predefined composite sources, where the client would not be aware that the source actually consists of multiple sources combined on the fly.
Configuration
For tile sources, the configuration would look like this:
aliases:
my_source: # name of the alias
sources:
# List of sources that should be combined, in the order they should be combined.
# Listing just one source effectively creates a redirect to an existing source.
# The list must not reference any other aliases.
- source1
- source2
- source3
For sprites and fonts, the configuration would look like this (note the aliases key is under sprites). The fonts would be similar.
sprites:
aliases:
my_sprite: # name of the sprite alias
sources:
# list of sprite sources that should be combined.
# The list must not reference any other aliases.
- sprite1
- sprite2
- sprite3
# The rest is the regular sprite configuration as exists now
paths:
# all SVG files in this dir will be published as a "my_images" sprite source
- /path/to/my_images
sources:
# SVG images in this directory will be published as a "my_sprites" sprite source
my_sprites: /path/to/some_dir