fix(maps): proxy OFM tiles through /ofm/ to fix blank map for SE Asia users - #172
Merged
Conversation
…tiles Cloudflare's Singapore CDN edge serves corrupt responses to Jakarta-region users: style JSON returns a TypeScript schema and PBF tile requests never complete. Routing every OFM request (style, TileJSON, glyphs, sprites, tiles) through our own Cloudflare Worker at /ofm/* fetches from OFM's origin server-side, bypassing the broken edge node entirely. - worker/index.js: add /ofm/* proxy with CF edge caching (24h for style/TileJSON, immutable for versioned .pbf tiles) - map-styles.lib.ts: resolveStyle() returns /ofm/styles/<id> instead of the absolute OFM URL - MapExplorer.tsx: fetchResolvedStyle() rewrites all OFM URLs through the proxy (glyphs, sprites, raster tile arrays, vector TileJSON + tile URLs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
goodwebtools | a21a67d | Aug 08 2026, 06:52 AM |
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.
Problem
Jakarta-region users see a blank Map Explorer after load / after GeolocateControl flyTo. Console shows
[map] source loading: openmaptilesfiring 68+ times but[map] source loaded: openmaptilesnever appearing — tile requests are made but never complete.Root cause: Cloudflare's Singapore CDN edge (which serves Jakarta) returns corrupt responses for
tiles.openfreemap.org:version/sources) instead of valid JSONFix
Route all OpenFreeMap requests through our own Cloudflare Worker at
/ofm/*. The Worker fetches from OFM's origin server-side over Cloudflare's backbone — bypassing the broken edge node. Cloudflare then serves the cached response from the nearest healthy PoP.worker/index.js— new/ofm/*proxy route with CF edge cachingmap-styles.lib.ts—resolveStyle()returns/ofm/styles/<id>(same-origin)MapExplorer.tsx—fetchResolvedStyle()rewrites all OFM URLs through proxy:/ofm/styles/<name>/ofm/planet(wastiles.openfreemap.org/planet)/ofm/planet/TIMESTAMP/{z}/{x}/{y}.pbfTest
All 837 tests pass · lint 0 errors · build succeeds
🤖 Generated with Claude Code