Spaces:
Paused
Paused
Download node_modules/@plotly/mapbox-gl/src/ui/handler/click_zoom.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 941 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/ui/handler/click_zoom.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/mapbox-gl/src/ui/handler/click_zoom.js
-
curl -L -o click_zoom.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/mapbox-gl/src/ui/handler/click_zoom.js
941 Bytes
| // @flow | |
| import type Point from '@mapbox/point-geometry'; | |
| import type Map from '../map'; | |
| export default class ClickZoomHandler { | |
| _enabled: boolean; | |
| _active: boolean; | |
| constructor() { | |
| this.reset(); | |
| } | |
| reset() { | |
| this._active = false; | |
| } | |
| blur() { | |
| this.reset(); | |
| } | |
| dblclick(e: MouseEvent, point: Point) { | |
| e.preventDefault(); | |
| return { | |
| cameraAnimation: (map: Map) => { | |
| map.easeTo({ | |
| duration: 300, | |
| zoom: map.getZoom() + (e.shiftKey ? -1 : 1), | |
| around: map.unproject(point) | |
| }, {originalEvent: e}); | |
| } | |
| }; | |
| } | |
| enable() { | |
| this._enabled = true; | |
| } | |
| disable() { | |
| this._enabled = false; | |
| this.reset(); | |
| } | |
| isEnabled() { | |
| return this._enabled; | |
| } | |
| isActive() { | |
| return this._active; | |
| } | |
| } | |