mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 03:46:29 -05:00
A style beside a PMTiles overlay says how the map draws it (#963)
When a MapLibre style (and optionally a sprite sheet) sits beside a PMTiles file, the overlay is drawn with it instead of the generic colors: `<name>.style.json` and `<name>.sprite.json/.png`, or `style.json` and `sprite.json/.png` shared by the files of a directory. Only the style's layers which draw that file are used; its sources, sprite and glyph URLs never are. Fonts are replaced by the ones the map has, images are pointed at the overlay's own sprite (as strings, expressions or property functions), and each layer is validated so one the map could not draw is skipped instead of stopping the map. The sprite is served by the API, which falls back to the single resolution sheet when there is no double resolution one.
This commit is contained in:
parent
adb0adbd94
commit
4f58d2862f
12 changed files with 1003 additions and 12 deletions
|
|
@ -372,7 +372,11 @@ function ManageMap() {
|
|||
{file.title && file.title !== file.name.replace(/\.pmtiles$/, '') && <div style={{fontSize: '0.75rem', color: 'var(--muted)'}}
|
||||
title={file.description || undefined}>{file.title}</div>}
|
||||
</Table.Cell>
|
||||
<Table.Cell>{MAP_FILE_KINDS[file.kind] || ''}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{MAP_FILE_KINDS[file.kind] || ''}
|
||||
{/* A style beside the file says how it is drawn. */}
|
||||
{file.kind === 'overlay' && file.style_path ? ' (styled)' : ''}
|
||||
</Table.Cell>
|
||||
<Table.Cell>{humanFileSize(file.size)}</Table.Cell>
|
||||
<Table.Cell>
|
||||
{/* A search index is built from a basemap's places; other files have none. */}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue