| | |
| | | var that = this; |
| | | // 暴露在外的接口 |
| | | |
| | | function createTooltip(frameDiv) {//抄录createTooltip函数 |
| | | |
| | | var tooltip = function (frameDiv) { |
| | | |
| | | var div = document.createElement('DIV'); |
| | | div.className = "twipsy right"; |
| | | |
| | | var arrow = document.createElement('DIV'); |
| | | arrow.className = "twipsy-arrow"; |
| | | div.appendChild(arrow); |
| | | |
| | | var title = document.createElement('DIV'); |
| | | title.className = "twipsy-inner"; |
| | | div.appendChild(title); |
| | | |
| | | this._div = div; |
| | | this._title = title; |
| | | this.message = ''; |
| | | |
| | | // add to frame div and display coordinates |
| | | frameDiv.appendChild(div); |
| | | var that = this; |
| | | div.onmousemove = function (evt) { |
| | | that.showAt({ x: evt.clientX, y: evt.clientY }, that.message); |
| | | }; |
| | | }; |
| | | |
| | | tooltip.prototype.setVisible = function (visible) { |
| | | this._div.style.display = visible ? 'block' : 'none'; |
| | | }; |
| | | |
| | | tooltip.prototype.showAt = function (position, message) { |
| | | if (position && message) { |
| | | this.setVisible(true); |
| | | this._title.innerHTML = message; |
| | | this._div.style.left = position.x + 10 + "px"; |
| | | this._div.style.top = (position.y - this._div.clientHeight / 2) + "px"; |
| | | this.message = message; |
| | | } |
| | | }; |
| | | |
| | | return new tooltip(frameDiv); |
| | | } |
| | | window.MYcreateTooltip = createTooltip;//全局使用 |
| | | |
| | | var domHtmls = [//默认 |
| | | { |
| | | name: '可视分析', |
| | |
| | | classs: 'digTheEarth-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | // , {//方量分析//做好 |
| | | // name: '方量分析', |
| | | // classs: 'volumeAnalysis-tool', |
| | | // img: './images/addL/pdpx.png' |
| | | // } |
| | | ]; |
| | | |
| | | that.beginSpatialAnalysis(domHtmls); |
| | |
| | | {//清除模型 |
| | | name: '清除模型', |
| | | classs: 'modesssss2222', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | , {//地形开挖,//做好 |
| | | name: '地形开挖', |
| | | classs: 'digTheEarth-tool', |
| | | img: './images/addL/pdpx.png' |
| | | }, {//方量分析//做好 |
| | | name: '方量分析', |
| | | classs: 'volumeAnalysis-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | ]; |
| | |
| | | |
| | | }) |
| | | |
| | | //方量分析 |
| | | $('.volumeAnalysis-tool').click(function () { |
| | | that.closeOnceUse('volumeAnalysis'); |
| | | $(".jimu-widget-volumeAnalysis").show(); |
| | | topic.publish('beginVolumeAnalysis', 'beginVolumeAnalysis'); |
| | | }) |
| | | |
| | | }, |
| | | closeToolBox: function (item) { |
| | | if (item != this.name) { |
| | |
| | | $(".jimu-widget-SQLQuery").hide(); |
| | | topic.publish('closesSQL', 'closesSQL'); |
| | | //关闭地形开挖 |
| | | if (who != 'digTheEarth') { |
| | | if ($(".jimu-widget-digTheEarth").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-digTheEarth").hide(); |
| | | topic.publish('closesDigTheEarth'); |
| | | console.log('dakai ') |
| | | } |
| | | |
| | | //关闭方量贩分析 |
| | | if ($(".jimu-widget-volumeAnalysis").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-volumeAnalysis").hide(); |
| | | topic.publish('closesVolumeAnalysis'); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onOpen: function () { |
| | | //面板打开的时候触发 (when open this panel trigger) |