Skip to content

fix(maps): let transformRequest own all OFM URL rewriting, drop manual TileJSON inline - #182

Merged
slaveofcode merged 1 commit into
developfrom
fix/ofm-bypass-edge-cache
Aug 8, 2026
Merged

fix(maps): let transformRequest own all OFM URL rewriting, drop manual TileJSON inline#182
slaveofcode merged 1 commit into
developfrom
fix/ofm-bypass-edge-cache

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Root cause (confirmed)

Probe confirmed tiles are valid: status 200, application/vnd.mapbox-vector-tile, 181 KB, bytes 1a f1 0f (valid protobuf MVT). Network was never the issue.

The bug: fetchResolvedStyle manually fetched the TileJSON and inlined tiles: [] into the style source — but WITHOUT the TileJSON's vector_layers, scheme, attribution, and other metadata. MapLibre needs the full TileJSON to correctly process vector tiles; without it, tiles were received but features were silently not extracted (blank map despite valid tile bytes).

Fix

fetchResolvedStyle is now a pure fetch+parse with zero URL manipulation. transformRequest (already set up) handles all OFM URL rewriting at request time — tiles, TileJSON, sprites, glyphs — exactly as MapLibre's API intends.

🤖 Generated with Claude Code

…l TileJSON inline

Inlining the TileJSON tiles array (without vector_layers, scheme, attribution,
etc.) caused MapLibre to silently fail feature extraction from the tiles: bytes
were received correctly (181 KB valid MVT confirmed by probe) but no features
were rendered. The issue is that MapLibre needs the full TileJSON metadata to
process vector tiles correctly.

fetchResolvedStyle is now a pure fetch+parse — it returns the style JSON as-is
with OFM URLs untouched. transformRequest handles all URL rewriting at request
time for tiles, TileJSON, sprites and glyphs, which is its designed purpose.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
goodwebtools fcb6dba Aug 08 2026, 08:59 AM

@slaveofcode
slaveofcode merged commit 1e7c30e into develop Aug 8, 2026
2 checks passed
@slaveofcode
slaveofcode deleted the fix/ofm-bypass-edge-cache branch August 8, 2026 08:59
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