Skip to content

fix(maps): use absolute URLs for OFM proxy - #174

Merged
slaveofcode merged 1 commit into
developfrom
fix/map-ofm-absolute-urls
Aug 8, 2026
Merged

fix(maps): use absolute URLs for OFM proxy#174
slaveofcode merged 1 commit into
developfrom
fix/map-ofm-absolute-urls

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

MapLibre rejects relative sprite/glyph URLs outright. Web Workers also resolve relative tile template URLs against their blob URL rather than the page origin, causing silent tile fetch failures.

Fix: compute proxyBase = location.origin + '/ofm/' inside fetchResolvedStyle (browser-only, safe) and use it for all OFM URL rewrites so every URL passed to MapLibre is fully absolute.

🤖 Generated with Claude Code

MapLibre rejects relative sprite/glyph URLs with a validation error.
Web Workers also resolve relative tile URLs against their blob URL
(not the page origin), causing silent tile fetch failures.

Move the ofm() rewriter inside fetchResolvedStyle so location.origin
is available, and produce fully absolute proxy URLs:
  https://tiles.openfreemap.org/... → https://goodwebtools.com/ofm/...

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@slaveofcode
slaveofcode merged commit 94d6ef2 into develop Aug 8, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the fix/map-ofm-absolute-urls branch August 8, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant