Repository navigation
fix(extensions): measure brushingRadius in true meters on MapView - #10668
Open
chrisgervang wants to merge 5 commits into
Open
chrisgervang wants to merge 5 commits into
chrisgervang wants to merge 5 commits into
Conversation
|
chrisgervang
force-pushed
the
claude/fix-brushing-globe-GveWO
branch
from
September 25, 2026 17:37
8ca4b80 to
d261046
Compare
chrisgervang
force-pushed
the
claude/fix-brushing-radius-meters-GveWO
branch
from
September 25, 2026 17:37
a0038ec to
39bdfea
Compare
chrisgervang
force-pushed
the
claude/fix-brushing-radius-meters-GveWO
branch
from
September 25, 2026 17:43
39bdfea to
54fd922
Compare
chrisgervang
commented
Sep 25, 2026
chrisgervang
force-pushed
the
claude/fix-brushing-globe-GveWO
branch
from
October 3, 2026 22:10
6ffd440 to
2a0980b
Compare
chrisgervang
force-pushed
the
claude/fix-brushing-radius-meters-GveWO
branch
from
October 3, 2026 22:12
2f2f1ac to
fd53c93
Compare
chrisgervang
force-pushed
the
claude/fix-brushing-globe-GveWO
branch
from
October 3, 2026 22:31
2a0980b to
865b857
Compare
brushing_isPointInRange divided the common-space distance by project.commonUnitsPerMeter, which below the auto-offset zoom is the equatorial Web Mercator value. brushingRadius was therefore effectively radius * cos(latitude) in real meters on MapView (about 2.4 km for a 3 km radius in San Francisco), while at zoom >= 12 (auto-offset mode) and on GlobeView it already measured true meters. The same radius thus selected different objects across the zoom-12 boundary and between views. Apply project_size_at_latitude() at the pointer's latitude under PROJECTION_MODE_WEB_MERCATOR + LNGLAT + !pseudoMeters, mirroring what project_size() does for geometry sizes. Auto-offset, globe and identity modes are unchanged. The map render golden now shows the same circle as its GlobeView twin. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
…ter and object Scaling the Web Mercator distance by the pointer's latitude alone gives different effective radii north and south of the pointer for large radii. Use the mean latitude of the two endpoints, which is symmetric and exact to first order in the latitude difference, and describe the remaining approximation in the docs instead of claiming exact meters. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
… of Remarks Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyzWaF5TmQPmGjh3Zr3XL9
chrisgervang
force-pushed
the
claude/fix-brushing-radius-meters-GveWO
branch
from
October 3, 2026 22:31
fd53c93 to
c9abe1f
Compare
This branch has not been deployed
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.
Follow up of #10661
Background
brushing_isPointInRangedivides the distance byproject.commonUnitsPerMeter. Below zoom 12 (PROJECTION_MODE_WEB_MERCATOR) that is the equatorial value, sobrushingRadiusonMapViewisradius × cos(latitude)in real meters, while auto-offset mode andGlobeViewalready measure true meters. The same radius selects different objects across the zoom-12 boundary and between views.brushing-sourceonMapView:brushingRadius: 3000m, pointer at the canvas centre, San Francisco at zoom 11.5The before image is the golden from #10661; the after image is the regenerated golden. The circle grows by 1/cos(37.75°) and now matches the extent of
brushing-source-globe.Change List
brushingshader module: underWEB_MERCATOR+LNGLATwithout pseudo-meters, divide the distance byproject_size_at_latitude()at the mean latitude of the pointer and the object, mirroringproject_size()MapViewbelow zoom 12: the circle grows by 1/cos(latitude), 1.26x at 37.75°, 2x at 60°brushingRadiusmean meters as documented; there is no post-9.4 upgrade guide section to note it in yetbrushing-source.pngregenerated: the map circle now matches its globe twin (about 140 px for 3 km at zoom 11.5); other brushing goldens unchangedbrushingRadiusproperty text states the measurement rule per view;docs/whats-new.mdnotes the MapView changeRan the render spec headless on WebGL,
tscand lint.Note
Medium Risk
Changes GPU distance logic for brushing on MapView below zoom 12, so apps may see a larger selection circle at higher latitudes; behavior is intentional to match documented meters.
Overview
BrushingExtensionnow treatsbrushingRadiusas real meters onMapViewat all zoom levels, matchingGlobeViewand the docs.In the brushing shader, when Web Mercator + lng/lat is active without pseudo-meters, the pointer-to-object distance is scaled by
project_size_at_latitude()at the mean latitude of the pointer and the feature—same idea asproject_size(). Below zoom 12 the effective brush circle grows by 1/cos(latitude) (e.g. ~1.26× at San Francisco), so radius no longer jumps at the zoom-12 boundary or diverges from globe behavior.Docs clarify that radius is in meters in every view; what’s new calls out the MapView fix. Render goldens for the brushing example were regenerated so map and globe circles align.
Reviewed by Cursor Bugbot for commit 2f2f1ac. Bugbot is set up for automated code reviews on this repo. Configure here.