Skip to content

Find tapped markers when the projection rounds to whole pixels - #44

Merged
wf9a5m75 merged 1 commit into
developfrom
fix/marker-hit-coarse-projection
Nov 13, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
fix/marker-hit-coarse-projection

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Tapping a marker on ArcGIS (3D) did nothing. It showed up in the marker-animation sample on Android: tapping the Bounce marker did not bounce it, though the Animation list button did.

Cause

  • To find the tapped marker, the hit test needs the screen scale round the tap. It projects points 1e-4° (about 11 m) north and east of the tap and measures how far they move.
  • ArcGIS's 3D SceneView returns screen positions rounded to whole pixels. Zoomed out (Hawaii at about zoom 9), 11 m is far under a pixel, so both points landed on the tap.
  • The scale came out as 0, searchBounds returned null, and the tap fell through without any error. Logged on the device: "find: no bounds".

Fix

  • If the two points are under 4 px away, the step widens tenfold (1e-4° → 1e-3° → …, up to 1°) until they are far enough apart to measure.
  • The same change is made in android-sdk-core, js-sdk-core and ios-sdk-core, which share this logic.

Tests

  • A new case uses a Web Mercator projection rounded to whole pixels at zoom 9. It fails without the fix ("bounds were not made") and passes with it. Android (448), web (428) and iOS (561) all pass.
  • On the Android tablet with ArcGIS, tapping the Bounce marker now picks it (s1) and it bounces.

The marker hit test measures the screen scale round the tap from points 1e-4°
north and east of it. ArcGIS's 3D SceneView returns whole-pixel screen points, and
zoomed out 1e-4° is under a pixel: both points landed on the tap, the scale came out
0, no search area was made, and a tap on a marker did nothing (the marker-animation
sample on ArcGIS: tapping Bounce did not bounce it). The step now widens tenfold
until both points are at least 4 px away, up to 1°.
@wf9a5m75
wf9a5m75 merged commit 3e306ed into develop Nov 13, 2026
2 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.

1 participant