Skip to content

Add MVT debug toggle#355

Merged
nilsnolde merged 5 commits intovalhalla:masterfrom
thisisharsh7:feat/mvt-debug-toggle
Mar 8, 2026
Merged

Add MVT debug toggle#355
nilsnolde merged 5 commits intovalhalla:masterfrom
thisisharsh7:feat/mvt-debug-toggle

Conversation

@thisisharsh7
Copy link
Contributor

@thisisharsh7 thisisharsh7 commented Mar 6, 2026

Closes #351

What this adds

Added a toggle switch in the Tiles tab to enable MapLibre's tile boundary debug mode. When enabled, shows:

  • Tile grid overlay
  • Tile coordinates (x/y/z)
  • File sizes for each tile

Implementation

Added "MVT Debug" toggle that sets map.showTileBoundaries. Positioned it right after the Valhalla layers toggle to keep debug features together.

The toggle follows the same UI pattern as the Valhalla layers toggle - includes a description with link to MapLibre docs.


Note: AI assisted with code implementation. I researched the MapLibre API, designed the UI, and tested the feature.

@ghost
Copy link

ghost commented Mar 6, 2026

Preview is ready! 🚀 You can view it here: https://valhalla-app-tests.gis-ops.com/355

Copy link
Member

@nilsnolde nilsnolde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, LGTM. other than the 1 change request.

Comment on lines +210 to +222
<p className="text-xs text-muted-foreground">
Display tile grid overlay with coordinates and file sizes. Uses
MapLibre&apos;s{' '}
<a
href="https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#showtileboundaries"
target="_blank"
rel="noopener noreferrer"
className="text-primary underline hover:no-underline"
>
debug mode
</a>{' '}
for inspecting map tiles.
</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should remove the subtext from both input controls IMO. it's quite obvious what both do once they're toggled

@thisisharsh7
Copy link
Contributor Author

thanks for the quick review!! removed subtext from both toggle controls and updated tests. All checks passing.

@nilsnolde nilsnolde requested a review from mustaphaturhan March 7, 2026 07:53
@nilsnolde nilsnolde merged commit 1416e91 into valhalla:master Mar 8, 2026
3 checks passed
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.

add "MVT debug" setting

2 participants