mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Adding debug AABB visualization

Open SnailBones opened this issue 1 year ago • 1 comments

Closes https://github.com/mapbox/gl-js-team/issues/472

Also fixes an issue with tile bounds visualization during the transition not being correctly scaled, as demonstrated by changes in render tests.

image

The AABBs can be viewed from other angles with the transform.freezeTileCoverage option

image

  • [ ] Implement clipping to fix artifacts
  • [X] include before/after visuals or gifs if this PR includes visual changes
  • [ ] write tests for all new functionality
  • [X] manually test the debug page
  • [ ] tagged @mapbox/gl-native if this PR includes shader changes or needs a native port
  • [X] apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'

SnailBones avatar Aug 03 '22 18:08 SnailBones

looks nice and it's very useful!

akoylasar avatar Aug 04 '22 12:08 akoylasar

My only concern here is that this very specialized tool adds ~700 bytes overhead to the gzipped bundle for all users, while it's a feature that would only be used by us, the developers. Could we perhaps limit it to the dev bundle and strip it out like we do with a few other debug code pieces?

Good call @mourner! I just implemented this, bringing the change down from +683 B to +88 B. I suspect that most of the remaining increase comes from the changes to transform._globePoint that fix the tile visualization (which is not stripped out in production).

SnailBones avatar Aug 22 '22 20:08 SnailBones