@polygonjs/plugin-mapbox
Version:
Mapbox plugin for the 3D engine https://polygonjs.com
32 lines (31 loc) • 753 B
JavaScript
export class MapboxViewerEventsController {
constructor(_viewer) {
this._viewer = _viewer;
}
init_events() {
const map = this._viewer.map();
if (!map) {
return;
}
map.on("move", this._on_move.bind(this));
map.on("moveend", this._on_moveend.bind(this));
map.on("mousemove", this._on_mousemove.bind(this));
map.on("mousedown", this._on_mousedown.bind(this));
map.on("mouseup", this._on_mouseup.bind(this));
}
_on_move(e) {
}
_on_moveend(e) {
this.camera_node_move_end();
}
_on_mousemove(e) {
}
_on_mousedown(e) {
}
_on_mouseup(e) {
}
camera_node_move_end() {
var _a;
(_a = this._viewer.cameraNode()) == null ? void 0 : _a.onMoveEnd(this._viewer.canvasContainer());
}
}