visgl / visgl/deck.gl

"invalid pixel coordinate" is thrown while pinching

Open
#5,976 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Description

A math.gl exception is thrown during a pinch out (zoom in) gesture, if pitch is 90, and no minZoom is set.

Expected Behavior

No exception should be thrown.

Repro Steps
  "initialViewState": {
    "longitude": -1.4157267858730052,
    "latitude": 52.232395363869415,
    "zoom": 6.6,
    "maxZoom": 15,
    "pitch": 90,
    "maxPitch": 90,
    "bearing": -27.396674584323023
  }
  • Try to pinch outwards (zoom in)
  • Observe math.gl exception being thrown
Environment
  • Framework Version: deck.gl 8.4.20
  • Browser Version: Chrome 91.0.4472.114
  • OS: macOS 12.0 beta
Logs
Error: invalid pixel coordinate
    at assert (assert.js:3)
    at pixelsToWorld (web-mercator-utils.js:188)
    at WebMercatorViewport.getMapCenterByLngLatPosition (web-mercator-viewport.js:127)
    at LinearInterpolator.interpolateProps (linear-interpolator.js:97)
    at TransitionManager._onTransitionUpdate (transition-manager.js:167)
    at Transition.update (transition.js:71)
    at TransitionManager.updateTransition (transition-manager.js:77)
    at TransitionManager._triggerTransition (transition-manager.js:136)
    at TransitionManager.processViewStateChange (transition-manager.js:65)
    at MapController.setProps (controller.js:198)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the pinch gesture in the deck.gl playground with the supplied initialViewState, then start from web-mercator-utils.js and WebMercatorViewport.getMapCenterByLngLatPosition in the stack trace. Trace the transition through linear-interpolator.js and MapController, and verify that pinching at pitch 90 with no minZoom completes without an "invalid pixel coordinate" exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.