Skip to content

Bearing, reorientation, slider comparison and zoom improvements - #647

Merged
borismasis merged 16 commits into
mapillary:mainfrom
borismasis:vendored-sync
Nov 2, 2026
Merged

borismasis merged 16 commits into
mapillary:mainfrom
borismasis:vendored-sync

Conversation

@borismasis

Copy link
Copy Markdown
Member

Brings upstream the MapillaryJS changes that have been running in Meta's internal Mapillary web build but were not yet on GitHub. Each commit is self-contained with its own tests.

Bearing and reorientation (follow-ups to #643)

  • Keep cone bearing stable during sequence steps
  • Add tooltip to bearing component; reuse its properties across renders
  • Keep horizon leveling at sequence endpoints
  • Orient final sequence images from incoming travel
  • Validate perspective reconstruction before leveling

Viewer and data

  • Capture-location IANA timezone in attribution dates, fbcdn POP-shard host normalization, SliderConfiguration.gravityAligned, zoom carried through ReorientationComponent.adoptView and reorientCurrent()
  • Keep spatial edge caching consistent with image lifecycles (guards against uninitialized/disposed images, reset re-entrancy)
  • Pointer view window (PointerConfiguration view bounds) for drag panning and bounce limits
  • Zoom buttons and +/- keys step 1x → 1.5x → 2x → 3x … instead of doubling (ZoomSteps, stepZoom); scroll and pinch unchanged

Slider comparisons

  • Screen-space alignment by heading, roll, position and FOV; guarded automatic motion between reconstructions
  • Shared perspective horizon leveling (PerspectiveLevel) for reorientation and slider
  • Configurable soft curtain edge
  • External image-based view correction, panorama look-around correction, viewScale, and a relaxed automaticMotionPolicy

Upstream-only changes on main (camera-type fallback, vertical bearing fix, touchcancel fix, trusted publishing, #646) are preserved; package version is unchanged.

Testing

  • Full TypeScript build (UMD/ESM, declarations, CSS) succeeds
  • Full Jest suite: 1,723 tests across 124 suites pass

Create the bearing indicator's tooltip properties once instead of on every
render so the virtual DOM does not rebuild the tooltip each frame.
…and adopted zoom

- Request the capture location's IANA `timezone` and show capture dates in it
  in the attribution.
- Normalize POP-sharded fbcdn hosts to their unsharded form before fetching.
- Add `SliderConfiguration.gravityAligned` to keep stationary comparison
  cameras aligned to gravity.
- Let `ReorientationComponent.adoptView` carry a zoom level and add
  `reorientCurrent()` to re-run reorientation without navigating.
- Regression tests for each.
- Refuse to cache spatial edges for an image whose cache is not initialized,
  and record the cached node before notifying edge subscribers.
- Make `resetSpatialEdges` tolerate re-entrant caching and disposed images,
  and forget cached spatial edges when images are uncached.
- Only warn about an incorrect mesh URL when a mesh id or URL was provided.
- Guard state transitions against disposed images.
- Spatial cache lifecycle, image cache and state transition regression tests.
Align the two slider images by heading, roll, position and field of view so a
side-by-side comparison shows the same subject, add guarded automatic motion
between reconstructions, consistent fisheye axes and texture handoff, and make
the zoom control keyboard/zoom-state aware. Extensive slider regression tests.
Extract the perspective leveling rules into `PerspectiveLevel` and use them for
both reorientation and slider alignment so both level images the same way.
New `SliderConfiguration` option feathers the split between the two slider
images in all curtain shaders.
Accept an externally computed view correction (e.g. from image matching) in
`SliderConfiguration` and apply it when rendering the comparison image.
New `PointerConfiguration` view bounds let drag panning and bounce limits use a
sub-window of the viewer, and keep silent cluster loads from emitting errors.
… motion to the slider

Apply view correction to panorama look-around, add `viewScale` to size 360
comparisons like the original, and add a relaxed `automaticMotionPolicy` that
lets pairs from different reconstructions try guarded 3D motion.
Button and keyboard zoom now step 1x -> 1.5x -> 2x ... instead of doubling
each time (`ZoomSteps`, `stepZoom`).
@meta-cla meta-cla Bot added the cla signed label Nov 2, 2026
Align wrapped arguments, split multi-variable declarations and long lines,
add missing typedefs, fix JSDoc formatting and a shadowed parameter, and type
the missing-image guard cases so the build passes noImplicitAny. No behavior
change.
@borismasis
borismasis merged commit 03c174f into mapillary:main Nov 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant