| | |
| | | * |
| | | */ |
| | | constructor(viewer, popup) { |
| | | this._viewer = viewer |
| | | this._popup = popup |
| | | this._position = popup.position |
| | | this._title = popup.title |
| | | this._content = popup.content |
| | | this.appendPopup() |
| | | this._viewer = viewer; |
| | | this._popup = popup; |
| | | this._position = popup.position; |
| | | this._title = popup.title; |
| | | this._content = popup.content; |
| | | this.appendPopup(); |
| | | this.isOpen = true; |
| | | } |
| | | |
| | | get viewer() { |
| | |
| | | |
| | | // 创建元素并追加 |
| | | createVideoWindowAll(id, className, position) { |
| | | let dom = document.getElementById('mobile-map_popup_content'); |
| | | dom.style.display = 'block'; |
| | | |
| | | var childs = document.getElementById('mobile-map_popup_content').getElementsByTagName('div') |
| | | |
| | | if (childs.length > 0) { |
| | |
| | | |
| | | var el = $("<div class=''></div>") |
| | | |
| | | var titleDiv = $("<div class='mobiletitle'></div>").text(this._title) |
| | | var labelContent = $("<div class='mobilelabel-content'></div>").append(this._content) |
| | | // var titleDiv = $("<div class='mobiletitle'></div>").text(this._title) |
| | | // var labelContent = $("<div class='mobilelabel-content'></div>").append(this._content) |
| | | |
| | | el.append(titleDiv) |
| | | el.append(labelContent) |
| | | // el.append(titleDiv) |
| | | // el.append(labelContent) |
| | | el.append(this._content) |
| | | |
| | | el.attr('id', id) |
| | | |
| | | el.addClass(className || '') |
| | | |
| | | $('#mobile-map_popup_content').append(el) |
| | | // let time; |
| | | // function cons(e) { |
| | | // time = setTimeout(() => { |
| | | // console.log(e) |
| | | // console.log(e.sun._drawingBufferHeight) |
| | | // console.log("roll: ", e.camera.roll) |
| | | // console.log("pitch: ", e.camera.pitch) |
| | | // console.log("heading: ", e.camera.heading) |
| | | // clearTimeout(time); |
| | | // time = ""; |
| | | // }, 2000); |
| | | // } |
| | | |
| | | this._viewer.scene.postRender.addEventListener(function () { |
| | | this._viewer.scene.postRender.addEventListener(function (e) { |
| | | if (!self.isOpen) { |
| | | return; |
| | | } |
| | | const windowCoord = DC.Namespace.Cesium.SceneTransforms.wgs84ToWindowCoordinates( |
| | | self._viewer.scene, |
| | | position |
| | | ) |
| | | |
| | | // time || cons(e); |
| | | self.positionPopUp(windowCoord, id) |
| | | }) |
| | | } |
| | |
| | | if (!windowCoord) { |
| | | return; |
| | | } |
| | | // console.log(windowCoord) |
| | | const wx = document.getElementById('app').clientWidth; |
| | | const x = windowCoord.x - (wx / 100 * 35); |
| | | const y = windowCoord.y - document.getElementById(id).offsetHeight - 15; |
| | |
| | | transform:translate3d(${Math.round(x)}px,${Math.round(y)}px, 0); |
| | | ` |
| | | } |
| | | closeOur() { |
| | | this.isOpen = false; |
| | | let dom = document.getElementById('mobile-map_popup_content'); |
| | | dom.style.display = 'none'; |
| | | // var childs = document.getElementById('mobile-map_popup_content').getElementsByTagName('div') |
| | | |
| | | // if (childs.length > 0) { |
| | | // for (var i = 0; i < childs.length; i++) { |
| | | // document.getElementById('mobile-map_popup_content').removeChild(childs[i]) |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | export default mobileDivForms |