MCPcopy Create free account
hub / github.com/facebook/Rapid / pan

Method pan

modules/core/MapSystem.js:688–692  ·  view source on GitHub ↗

* pan * Pan the map by given pixel amount * @param delta Array [dx,dy] amount to pan the map * @param duration? Duration of the transition in milliseconds, defaults to 0ms (asap) * @return this

(delta, duration = 0)

Source from the content-addressed store, hash-verified

686 * @return this
687 */
688 pan(delta, duration = 0) {
689 const t = this.context.viewport.transform;
690 const [dx, dy] = vecRotate(delta, -t.r, [0, 0]); // remove any rotation
691 return this.transform({ x: t.x + dx, y: t.y + dy, k: t.k, r: t.r }, duration);
692 }
693
694
695 /**

Callers 5

resizeMethod · 0.80
_keydownMethod · 0.80
_pointermoveMethod · 0.80
_wheelMethod · 0.80
_doNudgeMethod · 0.80

Calls 1

transformMethod · 0.95

Tested by

no test coverage detected