Promote to production: fix blank tiles in Map Explorer (PR #168) - #169
Merged
Conversation
The OpenFreeMap /styles/liberty endpoint serves different content from different Cloudflare edge nodes — some return the actual MapLibre style JSON, others return a TypeScript schema representation that MapLibre cannot parse, causing blank tiles. Instead of letting MapLibre fetch the style URL internally (where it hits the same stale edge), we pre-fetch the style with cache:'no-cache' to force revalidation with the origin server. We also resolve TileJSON-backed vector sources (openmaptiles) to direct tile URL arrays inline, so MapLibre never needs a separate TileJSON fetch at all. Also caps GeolocateControl and myLocation() zoom at 14 (the vector tile source's maxzoom), avoiding overzoom tile-loading edge cases in MapLibre v6. Removes the moveend→rAF→resize() pattern (the canvas size doesn't change during pan/zoom — the ResizeObserver handles real container size changes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-cdn fix(map-explorer): pre-fetch style+TileJSON to bypass stale Cloudflare CDN
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.
Promotes fix/map-explorer-blank-tiles-cdn to production. See PR #168 for full details.
Root cause: Cloudflare Singapore edge returning stale schema response instead of valid MapLibre style JSON.
Fix: pre-fetch style + TileJSON with cache:'no-cache', inline tile URLs, cap zoom at 14.
🤖 Generated with Claude Code