| @@ -38,9 +38,11 @@ class Compass extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'compass', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| this._wrapper.onmousedown = (e) => { | |||
| this._handleMouseDown(e) | |||
| @@ -59,9 +59,11 @@ class ContextMenu extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'contextMenu', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| this._handler = new Cesium.ScreenSpaceEventHandler(this._viewer.canvas) | |||
| } | |||
| @@ -41,9 +41,11 @@ class DistanceLegend extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'distanceLegend', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -64,9 +64,11 @@ class HawkeyeMap extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'hawkeyeMap', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| this._viewer.camera.percentageChanged = 0.01 | |||
| } | |||
| @@ -22,9 +22,11 @@ class LoadingMask extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'loadingMask', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -34,9 +34,11 @@ class LocationBar extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'locationBar', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -26,9 +26,11 @@ class MapSplit extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'mapSplit', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -34,12 +34,14 @@ class MapSwitch extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'mapSwitch', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| this.enable = true | |||
| let self = this | |||
| // let self = this | |||
| this._wrapper.onmouseover = () => { | |||
| let width = 80 | |||
| let rightMargin = 5 | |||
| @@ -65,9 +65,11 @@ class Popup extends Widget { | |||
| _installHook() { | |||
| this.enable = true | |||
| this._bindEvent() | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'popup', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -27,9 +27,11 @@ class SceneSplit extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'sceneSplit', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -26,9 +26,11 @@ class TilesetSplit extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'tilesetSplit', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -23,9 +23,11 @@ class Tooltip extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'tooltip', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||
| @@ -154,9 +154,11 @@ class ZoomController extends Widget { | |||
| * @private | |||
| */ | |||
| _installHook() { | |||
| const self = this | |||
| Object.defineProperty(this._viewer, 'zoomController', { | |||
| value: this, | |||
| writable: false, | |||
| get() { | |||
| return self | |||
| }, | |||
| }) | |||
| } | |||