Skip to content

feat(examples): add useDevicePixels toggle to basemap-browser#10332

Open
chrisgervang wants to merge 24 commits into
masterfrom
chrisgervang/basemap-browser-use-device-pixels
Open

feat(examples): add useDevicePixels toggle to basemap-browser#10332
chrisgervang wants to merge 24 commits into
masterfrom
chrisgervang/basemap-browser-use-device-pixels

Conversation

@chrisgervang
Copy link
Copy Markdown
Collaborator

@chrisgervang chrisgervang commented May 22, 2026

Summary

  • Adds a useDevicePixels checkbox to the basemap-browser control panel (toggles between true and 1.5)
  • Passes the setting through to all renderers (deck-only, MapLibre, Mapbox, Google Maps) in both pure-js and React modes
  • Helps verify that custom DPR overrides are correctly forwarded in attached-gl/interleaved mode paths (related to Bugbot finding on chore(core) Adopt luma CanvasContext #10228)

Test plan

  • With MapLibre interleaved: toggle checkbox and observe Debug Info buffer dimensions — if useDevicePixels is silently ignored, buffer dimensions won't change
  • With Deck Only: toggle checkbox as a control — buffer dimensions should change to ~1.5x CSS dimensions
  • Compare behavior between deck-only and interleaved modes to confirm the forwarding gap

🤖 Generated with Claude Code


Note

Low Risk
Changes are confined to the basemap-browser example and manual HTML test pages; no core deck.gl runtime behavior is modified in this diff.

Overview
Adds a useDevicePixels dimension to the basemap-browser example (default true), synced via URL and a control-panel checkbox that toggles between native DPR and 1.5.

The value flows through buildConfig into every renderer path (pure JS and React): Deck / DeckGL, GoogleMapsOverlay, and MapboxOverlay, with MapLibre/Mapbox maps also getting pixelRatio when the setting is a number or false (forced to 1). React map components remount when the ratio changes so buffer size updates.

Several standalone HTML harnesses compare standalone Deck vs interleaved MapboxOverlay and MapLibre pixelRatio vs Deck useDevicePixels across published deck.gl versions.

Reviewed by Cursor Bugbot for commit cbecd54. Bugbot is set up for automated code reviews on this repo. Configure here.

@chrisgervang chrisgervang requested a review from ibgreen May 22, 2026 23:40
@chrisgervang chrisgervang changed the base branch from ib/canvas-context-93 to master May 22, 2026 23:42
@coveralls
Copy link
Copy Markdown

coveralls commented May 22, 2026

Coverage Status

coverage: 83.39%. remained the same — chrisgervang/basemap-browser-use-device-pixels into master

@chrisgervang chrisgervang changed the base branch from master to ib/canvas-context-93 May 22, 2026 23:59
Base automatically changed from ib/canvas-context-93 to master May 26, 2026 19:01
chrisgervang and others added 2 commits May 27, 2026 14:45
… test pages

Pass pixelRatio to MapLibre/Mapbox Map constructor when useDevicePixels
is set to a custom value, since the basemap owns the canvas in
interleaved mode. Also adds standalone HTML test pages for validating
useDevicePixels across deck.gl 9.1, 9.2, 9.3, and local builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 82902eb. Configure here.

setInterval(updateInfo, 500);
</script>
</body>
</html>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Standalone HTML test files accidentally committed to repo

Medium Severity

Six standalone HTML test harnesses (use-device-pixels-cdn-test.html, use-device-pixels-cdn-test-9.2.html, use-device-pixels-cdn-test-9.3.html, use-device-pixels-local-test.html, use-device-pixels-maplibre-ratio-test.html, use-device-pixels-maplibre-ratio-test-9.3.html) are committed to the example root. These are development debugging tools — not referenced by the example's build, index.html, or package.json — totaling ~1000 lines of near-duplicate code across CDN versions. They appear to be manual test artifacts from the development process that were inadvertently included.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 82902eb. Configure here.

Comment thread examples/basemap-browser/src/control-panel.tsx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

3 participants