MCPcopy
hub / github.com/visgl/deck.gl / pan

Method pan

modules/core/src/controllers/map-controller.ts:215–226  ·  view source on GitHub ↗

* Pan * @param {[Number, Number]} pos - position on screen where the pointer is * @param {[Number, Number], optional} startPos - where the pointer grabbed at * the start of the operation. Must be supplied of `panStart()` was not called

({pos, startPos}: {pos: [number, number]; startPos?: [number, number]})

Source from the content-addressed store, hash-verified

213 * the start of the operation. Must be supplied of `panStart()` was not called
214 */
215 pan({pos, startPos}: {pos: [number, number]; startPos?: [number, number]}): MapState {
216 const startPanLngLat = this.getState().startPanLngLat || this._unproject(startPos);
217
218 if (!startPanLngLat) {
219 return this;
220 }
221
222 const viewport = this.makeViewport(this.getViewportProps());
223 const newProps = viewport.panByPosition(startPanLngLat, pos);
224
225 return this._getUpdatedState(newProps);
226 }
227
228 /**
229 * End panning

Callers 1

_panFromCenterMethod · 0.95

Calls 5

_unprojectMethod · 0.95
_getUpdatedStateMethod · 0.95
getStateMethod · 0.80
getViewportPropsMethod · 0.80
panByPositionMethod · 0.45

Tested by

no test coverage detected