feat(server): render location preview via Martin static-images API#3277
Merged
CommanderStorm merged 2 commits intoJun 13, 2026
Merged
Conversation
Replace the hand-rolled 5×5 XYZ tile download and stitching with a single
request to Martin's static-image endpoint
(`/style/{id}/static/{lon},{lat},{zoom}[@{bearing},{pitch}]/{w}x{h}.png`).
The basemap is rendered at exactly the map-area size (above the bottom info
panel) and centered on the location, so the pin and panel geometry are
preserved. Building previews render at z16, where the basemap still has 3D
extrusions, so they are tilted 20° to show those buildings in relief; closer
zooms (rooms/pois) keep the flat north-up view.
The static-image endpoint is only in Martin's `main` image, so bump the
basemap Dockerfile base accordingly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the hand-rolled 5×5 XYZ tile download and stitching in
/api/locations/{id}/previewwith a single request to Martin's static-image endpoint:What changed
building-3dextrusion band (minzoom 14.2 → maxzoom 16.5, full height through z16.2), so a slight tilt shows them in relief. Rooms/POIs (z17) have no extrusions, so they keep the flat north-up view.download_map_image.rs→static_map_image.rs: one HTTP request per preview instead of up to 9 tile fetches; retries transient5xx(static rendering has no concurrency support) and bails on4xx.mainimage, somap/martin/Dockerfilenow bases onghcr.io/maplibre/martin:main.Verification
cargo build,cargo clippy --all-targets, and the URL unit tests pass. Net −215 lines.🤖 Generated with Claude Code