mapbox / mapbox/mapbox-gl-js

Map.panBy and Point.convert API

Open
#8,968 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

`map.panBy` specifies that its first argument can be a `PointLike` object. Though if you pass in an `{x, y}` literal it fails in `camera.js` due to the ```Point.convert(offset).mult()``` call that assumes that the output from `Point.convert` is a real Point instance, which is not what `Point.convert` spec actually says, it will only convert Array to Point, other objects (literals) unchanged.

/Fredrik Blomqvist

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

Start in camera.js at map.panBy and inspect the Point.convert(offset).mult() call, then compare it with the Point.convert API behavior described in the issue. Reproduce the failure with an {x, y} offset and verify that map.panBy accepts the documented PointLike input without throwing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.