The map draws its own icons on an overlay (#967)

An overlay drawn with a style of its own names icons, which needed the sprite sheet that style was made for.  The map now ships icons for overlays, the Maki and Temaki sets (both CC0), and always draws those, in both viewers.

The sprite sheet is the translation: its index lists every icon under its own name, under each other name it answers to (modules/map/icons/aliases.json), and in both spellings of each.  A name with no icon is drawn as a plain dot.  The icons are signed distance fields, so a style's icon color and halo apply.

A pattern is not an icon: what it filled (a fill, a line or an extrusion) is drawn in a translucent color, where removing a pattern used to leave MapLibre's opaque black.

A sprite sheet beside a map file is no longer used, served or reported.  wrolpi/scripts/build_map_icons.py builds the sheet from the SVGs; the sheet is committed.
This commit is contained in:
lrnselfreliance 2026-11-13 17:59:03 -07:00 • committed by Roland
parent 177d0dba4b
commit b2b8e2075c
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
794 changed files with 4193 additions and 252 deletions

View file

@ -49,19 +49,6 @@ async def post_file_visible(_: Request, body: schema.MapFileVisibleRequest):
return response.json({'error': 'File not found'}, HTTPStatus.NOT_FOUND)
@map_bp.get('/files/sprite/<name:path>')
@openapi.description("Get the sprite sheet beside a PMTiles map file: `<map file>[@2x].json` or `.png`")
async def get_file_sprite(_: Request, name: str):
try:
sprite = lib.get_sidecar_sprite_file(name)
except ValueError as e:
return response.json({'error': str(e)}, HTTPStatus.BAD_REQUEST)
if sprite:
return await response.file(sprite)
return response.json({'error': 'Sprite not found'}, HTTPStatus.NOT_FOUND)
@map_bp.get('/subscribe')
@openapi.description('Get map catalog and current subscriptions')
def get_subscriptions(request: Request):