9 files modified
15 files added
| | |
| | | { |
| | | "name": "空间查询", |
| | | "uri": "widgets/spatialQuery/Widget" |
| | | }, |
| | | { |
| | | "name": "多边形裁剪", |
| | | "uri": "widgets/polygonClipping/Widget" |
| | | }, |
| | | { |
| | | "name": "通视分析", |
| | | "uri": "widgets/throughSee/Widget" |
| | | } |
| | | ], |
| | | "groups": [], |
| | |
| | | // 模块描述:显示坐标 |
| | | /////////////////////////////////////////////////////////////////////////// |
| | | define([ |
| | | 'dojo/_base/declare', |
| | | 'dojo/_base/lang', |
| | | 'dojo/_base/array', |
| | | 'dojo/_base/html', |
| | | 'dojo/topic', |
| | | 'jimu/BaseWidget', |
| | | 'jimu/utils', |
| | | 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css', |
| | | 'libs/zTree_v3/js/jquery.ztree.all' |
| | | ], |
| | | 'dojo/_base/declare', |
| | | 'dojo/_base/lang', |
| | | 'dojo/_base/array', |
| | | 'dojo/_base/html', |
| | | 'dojo/topic', |
| | | 'jimu/BaseWidget', |
| | | 'jimu/utils', |
| | | 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css', |
| | | 'libs/zTree_v3/js/jquery.ztree.all' |
| | | ], |
| | | function (declare, |
| | | lang, |
| | | array, |
| | |
| | | var val = $('#left-navigation-bar-main-input').val(); |
| | | if (val != '') { |
| | | var clearOur = () => { |
| | | let dom = $(`[data-id]`); |
| | | dom.removeClass('layui-tree-spread'); |
| | | let domDiv = dom.find('.layui-tree-pack'); |
| | | domDiv.css({ |
| | | 'display': 'none' |
| | | }) |
| | | }, |
| | | let dom = $(`[data-id]`); |
| | | dom.removeClass('layui-tree-spread'); |
| | | let domDiv = dom.find('.layui-tree-pack'); |
| | | domDiv.css({ |
| | | 'display': 'none' |
| | | }) |
| | | }, |
| | | a, useit = (d) => { |
| | | for (var k in d) { |
| | | if (d[k].who == 'father') { |
| | |
| | | } |
| | | }, |
| | | |
| | | closeToolBox: function (item) {}, |
| | | closeToolBox: function (item) { }, |
| | | |
| | | onOpen: function () { |
| | | //面板打开的时候触发 (when open this panel trigger) |
| | |
| | | |
| | | tree.render({ |
| | | elem: '#left-tree-list' //默认是点击节点可进行收缩 |
| | | , |
| | | , |
| | | data: data, |
| | | id: 'demoId1', |
| | | showCheckbox: true, //是否显示复选框 |
| | |
| | | that[item.id] = scene.open(host + partOfUrl, undefined, { |
| | | autoSetView: false //不自动定位 |
| | | }); |
| | | console.log(222) |
| | | topic.publish('appendTilt', 'Layermanagement', item); |
| | | topic.publish('appendTiltS', 'spatialAnalysis', item); |
| | | topic.publish('addLayersLegends', 'legends', item); |
| | |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | console.log(444) |
| | | topic.publish('appendItem', 'Layermanagement', item, that[item.id]); |
| | | topic.publish('appendItemS', 'spatialAnalysis', item, that[item.id]); |
| | | topic.publish('addLayersLegends', 'legends', item); |
| | |
| | | dataType: 'JSON', |
| | | success: function (res) { |
| | | |
| | | |
| | | // console.log(111) |
| | | that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({ |
| | | url: res[0].path, |
| | | })); |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } else { |
| | |
| | | that[obj.data.id] = scene.open(host + partOfUrl, undefined, { |
| | | autoSetView: false //不自动定位 |
| | | }); |
| | | console.log(333) |
| | | topic.publish('appendTilt', 'Layermanagement', obj.data); |
| | | topic.publish('appendTiltS', 'spatialAnalysis', obj.data); |
| | | topic.publish('addLayersLegends', 'legends', obj.data); |
| | |
| | | destination: rectangle |
| | | }); |
| | | }); |
| | | console.log(555) |
| | | topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]); |
| | | topic.publish('appendItemS', 'spatialAnalysis', obj.data, that[obj.data.id]); |
| | | topic.publish('addLayersLegends', 'legends', obj.data); |
| | |
| | | title: '采集站点', |
| | | id: 1, |
| | | field: '1' |
| | | // , checked: true |
| | | , |
| | | // , checked: true |
| | | , |
| | | spread: true, |
| | | children: [{ |
| | | title: '南矶山保护区', |
| | | id: 11, |
| | | field: '1-1' |
| | | // , checked: true |
| | | , |
| | | // , checked: true |
| | | , |
| | | spread: true, |
| | | children: [{ |
| | | title: '北深渊', |
| | |
| | | that.closesDigTheEarth(); |
| | | }) |
| | | |
| | | $("#beginigTheEarth").click(()=>{ |
| | | that.beginDigTheEarth(); |
| | | $("#beginigTheEarth").click(() => { |
| | | that.beginDigTheEarth(); |
| | | |
| | | }) |
| | | }, |
| | |
| | | // roll: 6.2831853016686185 |
| | | // } |
| | | // }); |
| | | |
| | | |
| | | var tooltip = window.MYcreateTooltip(viewer._element); |
| | | // console.log(viewer._element, 534) |
| | | //绘制多边形 |
| | | var handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon, 0); |
| | | handlerPolygon.activeEvt.addEventListener(function (isActive) { |
| | |
| | | } |
| | | }); |
| | | handlerPolygon.movingEvt.addEventListener(function (windowPosition) { |
| | | // console.log(windowPosition,534) |
| | | // console.log(handlerPolygon.isDrawing,555) |
| | | // console.log(viewer._element, 534) |
| | | if (windowPosition.x < 200 && windowPosition.y < 150) { |
| | | tooltip.setVisible(false); |
| | | return; |
| | |
| | | // } |
| | | // handlerPolygon.polygon.show = false; |
| | | // handlerPolygon.polyline.show = false; |
| | | |
| | | that.closesDigTheEarth(); |
| | | }; |
| | | |
| | |
| | | $('#toolbardigTheEarth').show(); |
| | | $('#loadingbar').remove(); |
| | | that.handlerPolygon = handlerPolygon; |
| | | that.tooltip = tooltip; |
| | | }, |
| | | handlerPolygon: '', |
| | | tooltip: '', |
| | | closesDigTheEarth: function () { |
| | | // console.log('gaunbi'); |
| | | var that = this; |
| | |
| | | that.handlerPolygon.polyline.show = false; |
| | | } |
| | | that.handlerPolygon.deactivate(); |
| | | |
| | | that.tooltip.setVisible(false); |
| | | }, |
| | | onOpen: function () { |
| | | |
| New file |
| | |
| | | <div> |
| | | <div id='loadingbar' class="spinner"> |
| | | <div class="spinner-container container1"> |
| | | <div class="circle1"></div> |
| | | <div class="circle2"></div> |
| | | <div class="circle3"></div> |
| | | <div class="circle4"></div> |
| | | </div> |
| | | <div class="spinner-container container2"> |
| | | <div class="circle1"></div> |
| | | <div class="circle2"></div> |
| | | <div class="circle3"></div> |
| | | <div class="circle4"></div> |
| | | </div> |
| | | <div class="spinner-container container3"> |
| | | <div class="circle1"></div> |
| | | <div class="circle2"></div> |
| | | <div class="circle3"></div> |
| | | <div class="circle4"></div> |
| | | </div> |
| | | </div> |
| | | <div id="toolbarpolygonClipping" class="param-container tool-bar"> |
| | | <table> |
| | | <tr> |
| | | <td> |
| | | <button type="button" id="polygon" class="button black">绘制裁剪面</button> |
| | | </td> |
| | | <td> |
| | | <button type="button" id="clear" class="button black">清除</button> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | <select id="clip-modepolygonClipping" class="cesium-button"> |
| | | <option value="clip-outside">开挖外部</option> |
| | | <option value="clip-inside">开挖内部</option> |
| | | </select> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | </div> |
| | | <i class="layui-icon closeOUR"> |
| | | ဆ |
| | | </i></span> |
| | | </div> |
| New file |
| | |
| | | define([ |
| | | 'dojo/_base/declare', |
| | | 'dojo/_base/lang', |
| | | 'dojo/_base/array', |
| | | 'dojo/_base/html', |
| | | 'dojo/topic', |
| | | 'jimu/BaseWidget', |
| | | ], |
| | | function (declare, |
| | | lang, |
| | | array, |
| | | html, |
| | | topic, |
| | | BaseWidget |
| | | ) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-polygonClipping', |
| | | name: 'polygonClipping', |
| | | flag: false, |
| | | startup: function () { |
| | | var that = this; |
| | | topic.subscribe("beginpolygonClipping", lang.hitch(this, this.beginpolygonClipping)); |
| | | topic.subscribe("closespolygonClipping", lang.hitch(this, this.closespolygonClipping)); |
| | | // topic.publish('getbeginSlope', that.beginSlope); |
| | | $(`.${that.baseClass}`).find('.closeOUR').click(() => { |
| | | $(`.${that.baseClass}`).hide(); |
| | | that.closespolygonClipping(); |
| | | }) |
| | | |
| | | |
| | | // that.beginpolygonClipping(); |
| | | |
| | | }, |
| | | beginpolygonClipping: function () { |
| | | console.log(`${this.name}--kaishi`); |
| | | var that = this; |
| | | |
| | | |
| | | |
| | | // 初始化viewer部件 |
| | | var viewer = this.map; |
| | | // viewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({ |
| | | // url: 'https://dev.virtualearth.net', |
| | | // mapStyle: Cesium.BingMapsStyle.AERIAL, |
| | | // key: window.MYURL_CONFIG.BING_MAP_KEY |
| | | // })); |
| | | var scene = viewer.scene; |
| | | var positions = [], regions = [], geometry = null, clipMode = Cesium.ModifyRegionMode.CLIP_OUTSIDE; |
| | | console.log(Cesium.SpatialQuery3D); |
| | | var spatialQuery = new Cesium.SpatialQuery3D(scene); |
| | | // try { |
| | | //场景添加S3M图层服务 |
| | | var promise = scene.open('http://www.supermapol.com/realspace/services/3D-BIMbuilding/rest/realspace'); |
| | | Cesium.when(promise, function (layers) { |
| | | // 精准定位 |
| | | scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3(-2180753.065987198, 4379023.266141494, 4092583.575045952), |
| | | orientation: { |
| | | heading: 4.0392222751147955, |
| | | pitch: 0.010279641987852584, |
| | | roll: 1.240962888005015e-11 |
| | | } |
| | | }); |
| | | |
| | | if (!scene.pickPositionSupported) { |
| | | alert('不支持深度纹理,无法拾取位置!'); |
| | | } |
| | | for (var layer of layers) { |
| | | layer.selectEnabled = false; |
| | | // 设置被裁剪对象的颜色 |
| | | layer.clipLineColor = new Cesium.Color(1, 1, 1, 0); |
| | | } |
| | | |
| | | var tooltip = createTooltip(document.body); |
| | | var handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon, 0); |
| | | handlerPolygon.activeEvt.addEventListener(function (isActive) { |
| | | if (isActive == true) { |
| | | viewer.enableCursorStyle = false; |
| | | viewer._element.style.cursor = ''; |
| | | $('body').removeClass('drawCur').addClass('drawCur'); |
| | | } else { |
| | | viewer.enableCursorStyle = true; |
| | | $('body').removeClass('drawCur'); |
| | | } |
| | | }); |
| | | handlerPolygon.movingEvt.addEventListener(function (windowPosition) { |
| | | if (handlerPolygon.isDrawing) { |
| | | tooltip.showAt(windowPosition, '<p>点击确定多边形顶点</p><p>右键单击结束绘制</p>'); |
| | | } else { |
| | | tooltip.showAt(windowPosition, '<p>点击绘制第一个点</p>'); |
| | | } |
| | | }); |
| | | handlerPolygon.drawEvt.addEventListener(function (result) { |
| | | tooltip.setVisible(false); |
| | | handlerPolygon.polygon.show = false; |
| | | handlerPolygon.polyline.show = false; |
| | | if (clipMode === Cesium.ModifyRegionMode.CLIP_OUTSIDE) { |
| | | positions = []; |
| | | for (var pt of result.object.positions) { |
| | | var cartographic = Cesium.Cartographic.fromCartesian(pt); |
| | | var longitude = Cesium.Math.toDegrees(cartographic.longitude); |
| | | var latitude = Cesium.Math.toDegrees(cartographic.latitude); |
| | | var height = cartographic.height; |
| | | positions.push(longitude, latitude, height); |
| | | } |
| | | regions = []; |
| | | regions.push(positions); |
| | | geometry = regions; |
| | | for (var layer of layers) { |
| | | layer.setModifyRegions(regions, clipMode); |
| | | } |
| | | } else { |
| | | for (var layer of layers) { |
| | | var array = [].concat(result.object.positions); |
| | | var point3ds = new Cesium.Point3Ds(); |
| | | regions = []; |
| | | for (var i = 0, len = array.length; i < len; i++) { |
| | | var cartographic = Cesium.Cartographic.fromCartesian(array[i]); |
| | | var longitude = Cesium.Math.toDegrees(cartographic.longitude); |
| | | var latitude = Cesium.Math.toDegrees(cartographic.latitude); |
| | | var h = cartographic.height; |
| | | var pnt = new Cesium.Point3D(longitude, latitude, h); |
| | | point3ds.add(pnt); |
| | | } |
| | | regions.push(point3ds); |
| | | geometry = null; |
| | | geometry = new Cesium.GeoRegion3D(regions); |
| | | geometry.extrudedHeight = -100; |
| | | geometry.isLatLon = false; |
| | | spatialQuery.build(); |
| | | layer.setCustomClipGeometry({ |
| | | geometry: geometry, |
| | | clippingType: Cesium.ClippingType.KeepOutside, |
| | | spatialQuery: spatialQuery |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | $('#polygon').click(function () { |
| | | handlerPolygon.activate(); |
| | | }); |
| | | |
| | | $('#clear').click(function () { |
| | | handlerPolygon.clear(); |
| | | // 清除裁剪结果 |
| | | if (clipMode === Cesium.ModifyRegionMode.CLIP_OUTSIDE) { |
| | | for (var layer of layers) { |
| | | layer.clearModifyRegions(); |
| | | } |
| | | } else { |
| | | for (var layer of layers) { |
| | | layer.clearCustomClipGeometry(); |
| | | } |
| | | geometry = null; |
| | | } |
| | | positions = []; |
| | | regions = []; |
| | | }); |
| | | |
| | | $('#clip-modepolygonClipping').on('propertychange input', function () { |
| | | clipMode = $(this).val() === 'clip-inside' ? Cesium.ModifyRegionMode.CLIP_INSIDE : Cesium.ModifyRegionMode.CLIP_OUTSIDE; |
| | | if (clipMode === Cesium.ModifyRegionMode.CLIP_OUTSIDE) { |
| | | for (var layer of layers) { |
| | | layer.clearModifyRegions(); |
| | | } |
| | | } else { |
| | | for (var layer of layers) { |
| | | layer.clearCustomClipGeometry(); |
| | | } |
| | | } |
| | | geometry = null; |
| | | positions = []; |
| | | regions = []; |
| | | }); |
| | | |
| | | $('#clip-modepolygonClipping').on('propertychange input', function () { |
| | | clipMode = $(this).val() === 'clip-inside' ? Cesium.ModifyRegionMode.CLIP_INSIDE : Cesium.ModifyRegionMode.CLIP_OUTSIDE; |
| | | if (clipMode === Cesium.ModifyRegionMode.CLIP_INSIDE) { |
| | | for (var layer of layers) { |
| | | if (geometry !== null) { |
| | | layer.setCustomClipGeometry({ |
| | | geometry: geometry, |
| | | clippingType: Cesium.ClippingType.KeepInside, |
| | | spatialQuery: spatialQuery |
| | | }); |
| | | geometry = null; |
| | | } else { |
| | | alert("请点击绘制裁剪面"); |
| | | } |
| | | } |
| | | } else { |
| | | if (geometry !== null) { |
| | | for (var layer of layers) { |
| | | layer.setModifyRegions(regions, clipMode); |
| | | } |
| | | geometry = null; |
| | | } else { |
| | | alert("请点击绘制裁剪面"); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | $('#toolbarpolygonClipping').show(); |
| | | $('#loadingbar').remove(); |
| | | }, function (e) { |
| | | if (widget._showRenderLoopErrors) { |
| | | var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | widget.showErrorPanel(title, undefined, e); |
| | | } |
| | | }); |
| | | // } |
| | | // catch (e) { |
| | | // if (widget._showRenderLoopErrors) { |
| | | // var title = '渲染时发生错误,已停止渲染。'; |
| | | // widget.showErrorPanel(title, undefined, e); |
| | | // } |
| | | // } |
| | | |
| | | }, |
| | | closespolygonClipping: function (froms) { |
| | | console.log(`${this.name}--guanbi`); |
| | | }, |
| | | onOpen: function () { |
| | | |
| | | }, |
| | | |
| | | onClose: function () { |
| | | //面板关闭的时候触发 (when this panel is closed trigger) |
| | | console.log('jies') |
| | | }, |
| | | |
| | | onMinimize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | onMaximize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | resize: function () { |
| | | |
| | | }, |
| | | |
| | | destroy: function () { |
| | | //销毁的时候触发 |
| | | //todo |
| | | //do something before this func |
| | | this.inherited(arguments); |
| | | } |
| | | |
| | | }); |
| | | }); |
| New file |
| | |
| | | .jimu-widget-polygonClipping { |
| | | position: fixed !important; |
| | | top: 72px !important; |
| | | right: 388px !important; |
| | | width: 200px !important; |
| | | height: 40px !important; |
| | | background-color: rgb(255, 255, 255); |
| | | font-size: 14px; |
| | | color: rgb(0, 0, 0); |
| | | z-index: 12 !important; |
| | | border-radius: 10px; |
| | | display: none; |
| | | box-shadow: 0 0 8px #fff; |
| | | padding: 0px 5px !important; |
| | | } |
| | | |
| | | .jimu-widget-polygonClipping .closeOUR { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: 5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .jimu-widget-polygonClipping .closeOUR:hover { |
| | | color: red; |
| | | } |
| | | |
| | | /* .jimu-widget-polygonClipping .but { |
| | | line-height: 30px; |
| | | width: 80px; |
| | | height: 30px; |
| | | font-size: 16px; |
| | | border-radius: 5px; |
| | | box-shadow: 2px 2px 15px -5px #378ef1; |
| | | border: 1px solid transparent; |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .jimu-widget-polygonClipping .but:hover { |
| | | box-shadow: 2px 2px 25px -5px #1679eb; |
| | | } */ |
| New file |
| | |
| | | { |
| | | "name": "polygonClipping", |
| | | "2D": true, |
| | | "3D": true, |
| | | "platform": "HTML", |
| | | "version": "2.10", |
| | | "wabVersion": "2.10", |
| | | "author": "liuyg", |
| | | "description": "", |
| | | "copyright": "", |
| | | "license": "", |
| | | "properties": { |
| | | "hasConfig": false, |
| | | "inPanel": false, |
| | | "hasVersionManager": false |
| | | } |
| | | } |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "polygonClipping" |
| | | }) |
| | | ); |
| New file |
| | |
| | | define({ |
| | | root: ({ |
| | | _widgetLabel: "polygonClipping" |
| | | }), |
| | | "es": 1, |
| | | "zh-cn": 1 |
| | | }); |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "多边形裁剪" |
| | | }) |
| | | ); |
| | |
| | | } |
| | | //创建剖面分析对象 |
| | | var profile = new Cesium.Profile(scene); |
| | | |
| | | function createTooltip(frameDiv) {//抄录createTooltip函数 |
| | | |
| | | var tooltip = function (frameDiv) { |
| | |
| | | this.message = message; |
| | | } |
| | | }; |
| | | |
| | | return new tooltip(frameDiv); |
| | | } |
| | | |
| | | var tooltip = createTooltip(document.body); |
| | | var widget = viewer.cesiumWidget; |
| | | try { |
| | | //添加S3M图层 // 舍弃 |
| | | //添加S3M图层 // 舍弃 |
| | | |
| | | // var ground1Promise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, { |
| | | // name: 'ground1' |
| New file |
| | |
| | | define([], function () { |
| | | function createTooltip(frameDiv) {//抄录createTooltip函数 |
| | | var oldDiv = document.getElementsByClassName('mytwipsy'); |
| | | // console.log(oldDiv) |
| | | if (oldDiv.length != 0) { |
| | | oldDiv[0].remove(); |
| | | } |
| | | var tooltip = function (frameDiv) { |
| | | var div = document.createElement('DIV'); |
| | | div.className = "mytwipsy myright"; |
| | | div.style.position = 'absolute'; |
| | | div.style.backgroundColor = '#fff'; |
| | | div.style.borderRadius = '5px'; |
| | | div.style.boxShadow = '2px 2px 15px -5px #39A5FD'; |
| | | div.style.padding = '2px 5px 2px 5px'; |
| | | div.style.fontSize = '14px'; |
| | | |
| | | 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 + 40 + "px"; |
| | | this._div.style.top = (position.y - this._div.clientHeight / 2) + "px"; |
| | | this.message = message; |
| | | } |
| | | }; |
| | | |
| | | return new tooltip(frameDiv); |
| | | } |
| | | window.MYcreateTooltip = createTooltip;//全局使用 |
| | | |
| | | var URL_CONFIG = { |
| | | BINGMAP: "//dev.virtualearth.net" |
| | | , BING_MAP_KEY: "AkOyUpgDCoz063AWW1WfHnxp5222UBdxLOp1XvRv0tuebQnr2S7UcZkiLgME7gX0" |
| | | , SCENE_BIMBUILDING: "http://www.supermapol.com/realspace/services/3D-BIMbuilding/rest/realspace" |
| | | , SCENE_CBD: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace" |
| | | , SCENE_CHONGQING_TX: "http://www.supermapol.com/realspace/services/3D-CQmodel_wireframe_2000/rest/realspace" |
| | | , SCENE_CLIP: "http://www.supermapol.com/realspace/services/3D-clip_fengbian/rest/realspace" |
| | | , SCENE_FEATUREVALUE: "http://www.supermapol.com/realspace/services/3D-featureValue_building9/rest/realspace/datas/%E4%B9%9D%E5%8F%B7@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_BUILDIBG: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/building_udb@building/config" |
| | | , SCENE_GTC_FLOOR9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E6%8B%89%E4%BD%8E%E6%A5%BC%E5%B1%82@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_GROUND: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%9C%B0%E9%9D%A2/config" |
| | | , SCENE_GTC_HILL: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%B1%B1/config" |
| | | , SCENE_GTC_LB9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E6%8B%89%E4%BD%8E%E6%A5%BC%E6%9D%BF@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_LWALL9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E6%8B%89%E4%BD%8E%E5%A2%99@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_LWINDOW9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E6%8B%89%E4%BD%8E%E7%AA%97@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_UINSIDE: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%86%85%E9%83%A8%E7%BB%93%E6%9E%84@%E5%AE%A4%E5%86%85/config" |
| | | , SCENE_GTC_UNIT9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%90%88%E5%B9%B6%E5%90%8E@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_UOUTSIDE: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%A4%96%E9%83%A8%E7%BB%93%E6%9E%84@%E5%AE%A4%E5%86%85/config" |
| | | , SCENE_GTC_UWINDOW: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/U%E5%9E%8B%E5%BB%BA%E7%AD%91%E7%AA%97@%E5%AE%A4%E5%86%85/config" |
| | | , SCENE_GTC_WALL9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%90%88%E5%B9%B6%E5%89%8D%E5%A2%99@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_GTC_WINDOW9: "http://www.supermapol.com/realspace/services/3D-data_all/rest/realspace/datas/%E5%90%88%E5%B9%B6%E5%89%8D%E6%A5%BC%E6%9D%BF@%E4%B9%9D%E5%8F%B7%E6%A5%BC/config" |
| | | , SCENE_HISTOGRAM: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace" |
| | | , SCENE_JINJIANG: "http://www.supermapol.com/realspace/services/3D-jinjiang/rest/realspace" |
| | | , SCENE_MODELUPDATE: "http://www.supermapol.com/realspace/services/3D-MoXingGengXin/rest/realspace" |
| | | , SCENE_MOVINGLIGHT: "http://www.supermapol.com/realspace/services/3D-BIMMoXing/rest/realspace" |
| | | , SCENE_NIAOCHAO: "http://www.supermapol.com/realspace/services/3D-OlympicGreen20200416/rest/realspace" |
| | | , SCENE_OLYMPIC: "http://www.supermapol.com/realspace/services/3D-Olympic/rest/realspace" |
| | | , SCENE_OLYMPIC_GREEN: "http://www.supermapol.com/realspace/services/3D-SampleCodeForFan20200420/rest/realspace" |
| | | , SCENE_OLYMPIC_NIGHT: "http://www.supermapol.com/realspace/services/3D-OlympicGreenNight/rest/realspace" |
| | | , SCENE_POINTCLOUD: "http://www.supermapol.com/realspace/services/3D-cloud/rest/realspace" |
| | | , SCENE_POLYLINEGROW_BUINDINGS: "http://www.supermapol.com/realspace/services/3D-buildings1122/rest/realspace" |
| | | , SCENE_RECT: "http://www.supermapol.com/realspace/services/3D-Text01/rest/realspace" |
| | | , SCENE_SGNS: "http://www.supermapol.com/realspace/services/3D-SGNS/rest/realspace" |
| | | , SCENE_SICHUAN: "http://www.supermapol.com/realspace/services/3D-dixingyingxiang/rest/realspace" |
| | | , SCENE_SRSB: "http://www.supermapol.com/realspace/services/3D-srsb/rest/realspace" |
| | | , SCENE_SUOFEIYA: "http://www.supermapol.com/realspace/services/3D-suofeiya_church/rest/realspace" |
| | | , SCENE_TISHUJU: "http://www.supermapol.com/realspace/services/3D-tishuju/rest/realspace" |
| | | , SCENE_VOLUME_NEAREST: "http://www.supermapol.com/realspace/services/3D-compare/rest/realspace" |
| | | , SCENE_WIREFRAME: "http://www.supermapol.com/realspace/services/3D-wireFrame/rest/realspace" |
| | | , SCENE_WebGLCBD: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace" |
| | | , SCENE_XGPARK: "http://www.supermapol.com/realspace/services/3D-yanmofenxi/rest/realspace" |
| | | , SCP_BIM: "https://www.supermapol.com/realspace/services/3D-S3MData/rest/realspace/datas/T8H_NoLod/config" |
| | | , SCP_CBD_BRIDGE: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace/datas/Ground_qiao@CBD/config" |
| | | , SCP_CBD_BUILD: "http://www.supermapol.com/realspace/services/3D-CBD/rest/realspace/datas/Building@CBD/config" |
| | | , SCP_CBD_GROUND1: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace/datas/Ground_1@CBD/config" |
| | | , SCP_CBD_GROUND2: "http://www.supermapol.com/realspace/services/3D-WebGLCBD/rest/realspace/datas/Ground_2@%E6%96%B0CBD/config" |
| | | , SCP_CBD_LAKE: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace/datas/Lake@CBD/config" |
| | | , SCP_CBD_ROAD: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace/datas/Ground_Daolu@CBD/config" |
| | | , SCP_CBD_TREE: "http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace/datas/Tree@CBD/config" |
| | | , SCP_FCFH_DATA: "http://www.supermapol.com/realspace/services/data-FCFH_Shangdong/rest/data" |
| | | , SCP_FCFH_QX: "http://www.supermapol.com/realspace/services/3D-FCFH_Shangdong/rest/realspace/datas/config/config" |
| | | , SCP_FCFH_VECTOR_EXTRUDE: "http://www.supermapol.com/realspace/services/3D-individualHouse/rest/realspace/datas/%E4%B8%93%E9%A2%98%E6%88%B7%E5%9E%8B%E9%9D%A2_%E6%8B%89%E4%BC%B8/config" |
| | | , SCP_HISTOGRAM1: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace/datas/Point2D_3000_5000/config" |
| | | , SCP_HISTOGRAM2: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace/datas/Point2D_10000_max/config" |
| | | , SCP_HISTOGRAM3: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace/datas/Point2D_min_1000/config" |
| | | , SCP_HISTOGRAM4: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace/datas/Point2D_5000_10000/config" |
| | | , SCP_HISTOGRAM5: "http://www.supermapol.com/realspace/services/3D-Histogram/rest/realspace/datas/Point2D_1000_3000/config" |
| | | , SCP_JINJIANG: "http://www.supermapol.com/realspace/services/3D-jinjiang/rest/realspace/datas/jinjiang/config" |
| | | , SCP_NIAOCHAO: "http://www.supermapol.com/realspace/services/3D-niaocao_water/rest/realspace/datas/%E9%B8%9F%E5%B7%A2%E4%BA%94%E6%9C%9F/config" |
| | | , SCP_NIAOCHAO_WATER: "http://www.supermapol.com/realspace/services/3D-Olympic/rest/realspace/datas/NewDataset@water-caijian/config" |
| | | , SCP_OLYMPIC_BILLBOARD: "http://www.supermapol.com/realspace/services/3D-WebGLOlympicGreen/rest/realspace/datas/BillBoard@OlympicGreen/config" |
| | | , SCP_OLYMPIC_BUILD: "http://www.supermapol.com/realspace/services/3D-WebGLOlympicGreen/rest/realspace/datas/Building@OlympicGreen/config" |
| | | , SCP_OLYMPIC_GROUND: "http://www.supermapol.com/realspace/services/3D-WebGLOlympicGreen/rest/realspace/datas/Ground@OlympicGreen/config" |
| | | , SCP_OLYMPIC_TREE: "http://www.supermapol.com/realspace/services/3D-WebGLOlympicGreen/rest/realspace/datas/Tree@OlympicGreen/config" |
| | | , SCP_OLYMPIC_WATER: "http://www.supermapol.com/realspace/services/3D-WebGLOlympicGreen/rest/realspace/datas/Waters@OlympicGreen/config" |
| | | , SCP_PIPELINE: "https://www.supermapol.com/realspace/services/3D-pipeline_s3m/rest/realspace/datas/NetWork@Pipe3D/config" |
| | | , SCP_POINTCLOUD: "http://www.supermapol.com/realspace/services/3D-cloud/rest/realspace/datas/POINTCLOUD23/config" |
| | | , SCP_SGNS: "http://www.supermapol.com/realspace/services/3D-SGNS/rest/realspace/datas/siguniang/config" |
| | | , SCP_SRSB: "http://www.supermapol.com/realspace/services/3D-srsb/rest/realspace/datas/srsb/config" |
| | | , SCP_SRSB_WATER: "http://www.supermapol.com/realspace/services/3D-srsb/rest/realspace/datas/%E6%B0%B4%E9%9D%A2@vector/config" |
| | | , SCP_SUOFEIYA: "http://www.supermapol.com/realspace/services/3D-suofeiya_church/rest/realspace/datas/Config/config" |
| | | , SCP_VECTOR_LINE: "http://www.supermapol.com/realspace/services/3D-China/rest/realspace/datas/Line/config" |
| | | , SCP_VECTOR_POLYGON: "http://www.supermapol.com/realspace/services/3D-China/rest/realspace/datas/%E4%B8%93%E9%A2%98%E5%9B%BE/config" |
| | | , SCP_VECTOR_TEXT: "http://www.supermapol.com/realspace/services/3D-China/rest/realspace/datas/text/config" |
| | | , SCP_WORLD_COUNTRY_VECTOR: "http://www.supermapol.com/realspace/services/3D-Countries-World2/rest/realspace/datas/Countries_1@World/config" |
| | | , SCP_WORLD_COUNTRY_VECTOR2: " http://www.supermapol.com/realspace/services/3D-ShiJieGuoJiaBianJie/rest/realspace" |
| | | , SCP_XGPARK: "http://www.supermapol.com/realspace/services/3D-yanmofenxi/rest/realspace/datas/sci_park/config" |
| | | , STK: "https://www.supermapol.com/realspace/services/3D-stk_terrain/rest/realspace/datas/info/data/path" |
| | | , SUPERMAP_IMG_MEC: "http://www.supermapol.com/realspace/services/map-China400/rest/maps/China400" |
| | | , SUPERMAP_IMG_WGS: "http://www.supermapol.com/realspace/services/map-World/rest/maps/World_Google" |
| | | , SiChuan_IMG: "http://www.supermapol.com/realspace/services/3D-dixingyingxiang/rest/realspace/datas/MosaicResult" |
| | | , SiChuan_TERRAIN: "http://www.supermapol.com/realspace/services/3D-dixingyingxiang/rest/realspace/datas/DatasetDEM" |
| | | , TDT_IMG: "https://[subdomain].tianditu.com/img_w/wmts" |
| | | , TDT_LABEL: "https://[subdomain].tianditu.com/cia_w/wmts" |
| | | , TENSE_IMG0: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0300@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG1: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0310@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG2: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0330@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG3: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0340@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG4: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0350@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG5: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0400@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG6: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0410@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG7: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0420@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG8: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0430@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG9: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0440@%E6%88%BF%E5%B1%B1" |
| | | , TENSE_IMG10: "http://www.supermapol.com/realspace/services/3D-HuanJingJianCe-2/rest/realspace/datas/rs0450@%E6%88%BF%E5%B1%B1" |
| | | , TOKEN_TIANDITU: "4a00a1dc5387b8ed8adba3374bd87e5e" |
| | | , ZF_IMG: "http://www.supermapol.com/realspace/services/3D-dxyx_ios2/rest/realspace/datas/MosaicResult_2@IMAGE_1" |
| | | , ZF_IMG2: "http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image" |
| | | , ZF_TERRAIN: "http://www.supermapol.com/realspace/services/3D-dxyx_ios2/rest/realspace/datas/DatasetDEM_1@sichuanTer" |
| | | , ZF_TERRAIN2: "http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/srtm_54_07@zhufeng" |
| | | |
| | | } |
| | | |
| | | window.MYURL_CONFIG = URL_CONFIG;//全局使用 |
| | | |
| | | }); |
| | |
| | | 'jimu/BaseWidget', |
| | | 'jimu/utils', |
| | | 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css', |
| | | 'libs/zTree_v3/js/jquery.ztree.all' |
| | | 'libs/zTree_v3/js/jquery.ztree.all', |
| | | './Cesiumadd' |
| | | ], |
| | | function (declare, |
| | | lang, |
| | |
| | | startup: function () { |
| | | 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;//全局使用 |
| | | |
| | | |
| | | //关键词&&坐标 |
| | | $("#i-f-gjz").click(function () { |
| | |
| | | if (d == []) { |
| | | if (n == 0) { |
| | | this.beginLayUi(d); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "全景站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "全景站点"); |
| | | } else if (n == 1) { |
| | | this.beginLayUi(1, d); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监控.png", "监控站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监控.png", "监控站点"); |
| | | } else if (n == 2) { |
| | | this.beginLayUi(1, 1, d); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "监测站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "监测站点"); |
| | | } |
| | | } else { |
| | | var i = 1; |
| | |
| | | var data = d; |
| | | if (n == 0) { |
| | | this.beginLayUi(data); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "全景站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/全景.png", "全景站点"); |
| | | } else if (n == 1) { |
| | | this.beginLayUi(1, data); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监控.png", "监控站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监控.png", "监控站点"); |
| | | } else if (n == 2) { |
| | | this.beginLayUi(1, 1, data); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监测.png", "监测站点"); |
| | | topic.publish('getLegendsData', "legends", d, "./images/addL/监测.png", "监测站点"); |
| | | } |
| | | } |
| | | }, |
| | |
| | | slope.ColorTable = colorTable; |
| | | slope.Opacity = 1; |
| | | |
| | | function createTooltip(frameDiv) {//创建需要的函数 |
| | | |
| | | 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); |
| | | } |
| | | |
| | | var tooltip = createTooltip(viewer._element); |
| | | var tooltip = window.MYcreateTooltip(viewer._element); |
| | | //绘制多边形 |
| | | var handlerPolygon = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Polygon, 0); |
| | | handlerPolygon.activeEvt.addEventListener(function (isActive) { |
| | |
| | | classs: 'profileAnalysis-tool', |
| | | img: './images/addL/剖面分析.png' |
| | | } |
| | | // , {//做好静态, |
| | | // name: '建造实体', |
| | | // classs: 'modelDiagram-tool', |
| | | // img: './images/addL/pdpx.png' |
| | | // } |
| | | , {//做好静态, |
| | | name: '建造实体', |
| | | classs: 'modelDiagram-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | // , {//https://blog.csdn.net/supermapsupport/article/details/100134590 |
| | | // //需要iServer发布成三维服务 |
| | | // name: '坡度分析', |
| | |
| | | classs: 'digTheEarth-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | // , {//方量分析//做好 |
| | | // name: '方量分析', |
| | | // classs: 'volumeAnalysis-tool', |
| | | // img: './images/addL/pdpx.png' |
| | | // } |
| | | , {//方量分析//做好 |
| | | name: '方量分析', |
| | | classs: 'volumeAnalysis-tool', |
| | | img: './images/addL/pdpx.png' |
| | | }, |
| | | {//通视分析 |
| | | name: '通视分析', |
| | | classs: 'throughSee-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | ]; |
| | | |
| | | that.beginSpatialAnalysis(domHtmls); |
| | |
| | | , {//空间查询 |
| | | name: '空间查询', |
| | | classs: 'spatialQuery-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | , {//多边形裁剪 |
| | | name: '多边形裁剪', |
| | | classs: 'polygonClipping-tool', |
| | | img: './images/addL/pdpx.png' |
| | | }, |
| | | {//通视分析 |
| | | name: '通视分析', |
| | | classs: 'throughSee-tool', |
| | | img: './images/addL/pdpx.png' |
| | | } |
| | | , |
| | |
| | | topic.publish('beginSpatialQuery', 'beginSpatialQuery'); |
| | | }) |
| | | |
| | | // var datas = [//layui舍弃 |
| | | // { |
| | | // title: '默认:天地图影像' |
| | | // // , child: [ |
| | | // // { |
| | | // // title: 'menu item 3-2-1' |
| | | // // , id: 105 |
| | | // // } |
| | | // // ] |
| | | // } |
| | | // ] |
| | | // // that.beginRool(datas); |
| | | // that.datas = datas; |
| | | // // 注册添加工具事件--规定操作图层 |
| | | // topic.subscribe("addSelectLayerTool", lang.hitch(this, this.addSelectLayerTool)); |
| | | // // 注册删除工具事件--规定操作图层 |
| | | // topic.subscribe("removeSelectLayerTool", lang.hitch(this, this.removeSelectLayerTool)); |
| | | //多边形裁剪 |
| | | $('.polygonClipping-tool').click(function () { |
| | | that.closeOnceUse(); |
| | | $(".jimu-widget-polygonClipping").show(); |
| | | topic.publish('beginpolygonClipping', 'beginpolygonClipping'); |
| | | }) |
| | | |
| | | //通视分析 |
| | | $('.throughSee-tool').click(function () { |
| | | that.closeOnceUse(); |
| | | $(".jimu-widget-throughSee").show(); |
| | | topic.publish('beginthroughSee', 'beginthroughSee'); |
| | | }) |
| | | |
| | | |
| | | $('.SelectLayerTool').click(() => { |
| | | $('#SelectLayerToolItem').toggle(); |
| | |
| | | } |
| | | }, |
| | | removeItemS: function (item, obj) { |
| | | // console.log('r1') |
| | | console.log(obj, 'r1') |
| | | if (item == this.name) { |
| | | var liList = $("#SelectLayerToolItemTitle li"); |
| | | for (var i = 0; i < liList.length; i++) { |
| | | if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') { |
| | | $(liList[i]).remove(); |
| | | var dom = $('.SelectLayerTool').attr("title"); |
| | | console.log(dom == obj.title, this.liClick) |
| | | if (dom == obj.title) { |
| | | this.liClick('默认:天地图影像', '默认:天地图影像'); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }, |
| | | removeTiltS: function (item, obj) { |
| | | console.log(obj, 'r2') |
| | | // console.log('r2') |
| | | if (item == this.name) { |
| | | var liList = $("#SelectLayerToolItemTitle li"); |
| | | for (var i = 0; i < liList.length; i++) { |
| | | if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id + 's') { |
| | | $(liList[i]).remove(); |
| | | var dom = $('.SelectLayerTool').attr("title"); |
| | | if (dom == obj.title) { |
| | | this.liClick('默认:天地图影像', '默认:天地图影像'); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | // datas: [],//layui舍弃 |
| | | // addSelectLayerTool: function (num, val) { |
| | | // console.log(num, val); |
| | | // var that = this |
| | | // , d = that.datas; |
| | | // //三维数据处理 添加全部 9 添加时删除 10 删除全部 6 //添加单个 9 添加时删除 10 删除全部 6 |
| | | // // var sanwei = {}; |
| | | // // if (num == 9) { |
| | | // // sanwei.title = '三维倾斜数据' |
| | | // // } |
| | | // // d.push({ |
| | | // // title: val.title |
| | | // // }) |
| | | // // that.beginRool(that.datas); |
| | | // beginRool: function (data) { |
| | | // //选择图层Layui |
| | | // layui.use(['dropdown', 'util', 'layer', 'table'], function () { |
| | | // var dropdown = layui.dropdown |
| | | // , layer = layui.layer; |
| | | // dropdown.render({ |
| | | // elem: '.SelectLayerTool' |
| | | // , data: data |
| | | // , click: function (obj) { |
| | | // layer.tips('选择了:' + obj.title, this.elem, { tips: [1, '#5FB878'] }); |
| | | // var dom = $('.SelectLayerTool'); |
| | | // dom.empty(); |
| | | // var str = `${obj.title} <i class="layui-icon layui-icon-down layui-font-12"></i>` |
| | | // dom.append(str); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // }, |
| | | // removeSelectLayerTool: function (num, val) { |
| | | // console.log(num, val) |
| | | // }, |
| | | beginRool: function (data) { |
| | | //选择图层Layui |
| | | layui.use(['dropdown', 'util', 'layer', 'table'], function () { |
| | | var dropdown = layui.dropdown |
| | | , layer = layui.layer; |
| | | dropdown.render({ |
| | | elem: '.SelectLayerTool' |
| | | , data: data |
| | | , click: function (obj) { |
| | | layer.tips('选择了:' + obj.title, this.elem, { tips: [1, '#5FB878'] }); |
| | | var dom = $('.SelectLayerTool'); |
| | | dom.empty(); |
| | | var str = `${obj.title} <i class="layui-icon layui-icon-down layui-font-12"></i>` |
| | | dom.append(str); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | closeToolBox: function (item) { |
| | | if (item != this.name) { |
| | | $('.tool-y-box').hide(); |
| | |
| | | $(".jimu-widget-spatialQuery").hide(); |
| | | topic.publish('closesSpatialQuery'); |
| | | } |
| | | |
| | | //关闭多边形裁剪 |
| | | if ($(".jimu-widget-polygonClipping").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-polygonClipping").hide(); |
| | | topic.publish('closespolygonClipping'); |
| | | } |
| | | //关闭通视分析 |
| | | if ($(".jimu-widget-throughSee").is(":visible")) {//判断是否隐藏 |
| | | $(".jimu-widget-throughSee").hide(); |
| | | // topic.publish('closesthroughSee'); |
| | | } |
| | | |
| | | }, |
| | | onOpen: function () { |
| | | //面板打开的时候触发 (when open this panel trigger) |
| | | // var domHtmls = [ |
| | | // { |
| | | // name: '可视分析', |
| | | // classs: 'visibleArea-tool' |
| | | // }, { |
| | | // name: '剖面分析', |
| | | // classs: 'profileAnalysis-tool' |
| | | // }, { |
| | | // name: '坡度分析', |
| | | // classs: 'slope-tool' |
| | | // }, |
| | | // ]; |
| | | // var dom = $('#spatialAnalysis-main'); |
| | | // var str = ''; |
| | | // for (var k in domHtmls) { |
| | | // str += `<li class="${domHtmls[k].classs}"><i></i> <span>${domHtmls[k].name}</span></li>` |
| | | // } |
| | | // dom.replaceWith(str); |
| | | }, |
| | | |
| | | onClose: function () { |
| | |
| | | padding: 5px; |
| | | text-align: center; |
| | | overflow: hidden; |
| | | height: calc(100% - 40px); |
| | | height: calc(100% - 90px); |
| | | width: 100%; |
| | | margin: 0; |
| | | overflow: auto; |
| New file |
| | |
| | | <div> |
| | | <div id='toolbarthroughSee' class="param-container tool-bar"> |
| | | <button type="button" id="addViewPointthroughSee" class="button black">添加观察点</button> |
| | | <button type="button" id="addTargetPointthroughSee" class="button black">添加目标点</button> |
| | | <button type="button" id="clearthroughSee" class="button black">清除</button> |
| | | </div> |
| | | <i class="layui-icon closeOUR"> |
| | | ဆ |
| | | </i></span> |
| | | </div> |
| New file |
| | |
| | | define([ |
| | | 'dojo/_base/declare', |
| | | 'dojo/_base/lang', |
| | | 'dojo/_base/array', |
| | | 'dojo/_base/html', |
| | | 'dojo/topic', |
| | | 'jimu/BaseWidget', |
| | | ], |
| | | function (declare, |
| | | lang, |
| | | array, |
| | | html, |
| | | topic, |
| | | BaseWidget |
| | | ) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-throughSee', |
| | | name: 'throughSee', |
| | | flag: false, |
| | | startup: function () { |
| | | var that = this; |
| | | topic.subscribe("beginthroughSee", lang.hitch(this, this.beginthroughSee)); |
| | | topic.subscribe("closesthroughSee", lang.hitch(this, this.closesthroughSee)); |
| | | // topic.publish('getbeginSlope', that.beginSlope); |
| | | $(`.${that.baseClass}`).find('.closeOUR').click(() => { |
| | | $(`.${that.baseClass}`).hide(); |
| | | that.closesthroughSee(); |
| | | }) |
| | | |
| | | |
| | | // that.beginthroughSee(); |
| | | |
| | | }, |
| | | beginthroughSee: function () { |
| | | console.log(`${this.name}--kaishi`); |
| | | var that = this; |
| | | |
| | | var viewer = that.map; |
| | | |
| | | if (!viewer.scene.pickPositionSupported) { |
| | | alert('不支持深度纹理,通视分析功能无法使用(无法添加观测点目标点)!'); |
| | | } |
| | | $("#toolbarthroughSee").show(); |
| | | $('#loadingbar').remove(); |
| | | var scene = viewer.scene; |
| | | scene.shadowMap.darkness = 1.275; //设置第二重烘焙纹理的效果(明暗程度) |
| | | scene.skyAtmosphere.brightnessShift = 0.4; //修改大气的亮度 |
| | | scene.debugShowFramesPerSecond = false; |
| | | scene.hdrEnabled = false; |
| | | scene.sun.show = false; |
| | | // 01设置环境光的强度-新处理CBD场景 |
| | | scene.lightSource.ambientLightColor = new Cesium.Color(0.65, 0.65, 0.65, 1); |
| | | // 添加光源 |
| | | var position1 = new Cesium.Cartesian3.fromDegrees(116.261209157595, 39.3042238956531, 480); |
| | | //光源方向点 |
| | | |
| | | var targetPosition1 = new Cesium.Cartesian3.fromDegrees(116.261209157595, 39.3042238956531, 430); |
| | | var dirLightOptions = { |
| | | targetPosition: targetPosition1, |
| | | color: new Cesium.Color(1.0, 1.0, 1.0, 1), |
| | | intensity: 0.55 |
| | | }; |
| | | directionalLight_1 = new Cesium.DirectionalLight(position1, dirLightOptions); |
| | | scene.addLightSource(directionalLight_1); |
| | | var sightline = new Cesium.Sightline(scene); |
| | | |
| | | var widget = viewer.cesiumWidget; |
| | | // try { |
| | | |
| | | var promise = scene.open(window.MYURL_CONFIG.SCENE_CBD); |
| | | Cesium.when.all(promise, function (layer) { |
| | | scene.camera.setView({ |
| | | destination: new Cesium.Cartesian3.fromDegrees(116.44621857300415, 39.899281526734555, 216.7793905027196), |
| | | orientation: { |
| | | heading: 0.41348036210986194, |
| | | pitch: -0.13636490404291735, |
| | | roll: 6.283185307179563 |
| | | } |
| | | }); |
| | | for (var i = 0; i < layer.length; i++) { |
| | | layer[i].selectEnabled = false; |
| | | } |
| | | |
| | | sightline.build(); |
| | | }, function (e) { |
| | | if (widget._showRenderLoopErrors) { |
| | | var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?'; |
| | | widget.showErrorPanel(title, undefined, e); |
| | | } |
| | | }); |
| | | // } catch (e) { |
| | | // if (widget._showRenderLoopErrors) { |
| | | // var title = '渲染时发生错误,已停止渲染。'; |
| | | // widget.showErrorPanel(title, undefined, e); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | var addViewFlag = false;//当前点击状态是否是 添加观察点 |
| | | var addTargetFlag = false;//当前点击状态是否是 添加目标点 |
| | | var mv = false;//当前点击状态是否是 添加观察点 |
| | | var tf = false;//当前点击状态是否是 添加目标点 |
| | | |
| | | var num = 0;//添加的目标点的点号 |
| | | var couldRemove = false;//是否能移除目标点 |
| | | var tooltip = window.MYcreateTooltip(viewer._element) |
| | | var handlerPoint = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Point); |
| | | handlerPoint.drawEvt.addEventListener(function (result) { |
| | | //添加观察点 |
| | | if (addViewFlag) { |
| | | var point = result.object; |
| | | // point.show = false; |
| | | var position = result.object.position; |
| | | |
| | | //将获取的点的位置转化成经纬度 |
| | | var cartographic = Cartesian2toDegrees(position); |
| | | |
| | | //设置观察点 |
| | | sightline.viewPosition = cartographic; |
| | | addViewFlag = false; |
| | | } |
| | | handlerPoint.deactivate(); |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas); |
| | | |
| | | document.getElementById("addViewPointthroughSee").onclick = function () { |
| | | if (tf == false) { |
| | | addViewFlag = true; |
| | | |
| | | if (handlerPoint.active) { |
| | | return; |
| | | } |
| | | viewer.entities.removeAll(); |
| | | if (couldRemove) { |
| | | sightline.removeAllTargetPoint(); |
| | | } |
| | | handlerPoint.activate(); |
| | | handler.setInputAction(function (evt) { |
| | | |
| | | //鼠标移动,更新最后一次添加的目标点的位置 |
| | | var position = scene.pickPosition(evt.endPosition); |
| | | |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | |
| | | if (addViewFlag || addTargetFlag) { |
| | | viewer.enableCursorStyle = false; |
| | | viewer._element.style.cursor = ''; |
| | | $('body').removeClass('drawCur').addClass('drawCur'); |
| | | } |
| | | //鼠标移动事件,更新点 |
| | | handler.setInputAction(function (evt) { |
| | | tooltip.showAt(evt.endPosition, '<p>点击确定观察点</p>'); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | //鼠标点击事件,添加点 |
| | | handler.setInputAction(function (e) { |
| | | $('body').removeClass('drawCur'); |
| | | mv = true; |
| | | tooltip.setVisible(false); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | } else { |
| | | layer.tips('正在添加目标点,请先右键关闭', $('#addViewPointthroughSee'), { tips: [1, 'red'] }); |
| | | } |
| | | } |
| | | |
| | | |
| | | document.getElementById("addTargetPointthroughSee").onclick = function () { |
| | | if (mv) { |
| | | addViewFlag = false; |
| | | addTargetFlag = true; |
| | | tf = true; |
| | | if (addViewFlag || addTargetFlag) { |
| | | viewer.enableCursorStyle = false; |
| | | viewer._element.style.cursor = ''; |
| | | $('body').removeClass('drawCur').addClass('drawCur'); |
| | | } |
| | | |
| | | //鼠标点击事件,添加点 |
| | | handler.setInputAction(function (e) { |
| | | var position = scene.pickPosition(e.position); |
| | | addTarget(position); |
| | | }, Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | |
| | | //鼠标移动事件,更新点 |
| | | handler.setInputAction(function (evt) { |
| | | |
| | | //鼠标移动,更新最后一次添加的目标点的位置 |
| | | var position = scene.pickPosition(evt.endPosition); |
| | | |
| | | if (num > 0) { |
| | | sightline.removeTargetPoint("point0"); |
| | | |
| | | var cartographic = Cartesian2toDegrees(position); |
| | | |
| | | var flag = sightline.addTargetPoint({ |
| | | position: cartographic, |
| | | name: "point0" |
| | | }); |
| | | } |
| | | tooltip.showAt(evt.endPosition, '<p>点击确定目标点右键结束</p>'); |
| | | }, Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | |
| | | //鼠标右键事件,结束 |
| | | handler.setInputAction(function () { |
| | | viewer.enableCursorStyle = true; |
| | | $('body').removeClass('drawCur'); |
| | | tooltip.setVisible(false); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE); |
| | | handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK); |
| | | tf = false; |
| | | }, Cesium.ScreenSpaceEventType.RIGHT_CLICK); |
| | | } else { |
| | | layer.tips('未添加观察点', $('#addTargetPointthroughSee'), { tips: [1, 'red'] }); |
| | | } |
| | | }; |
| | | |
| | | document.getElementById("clearthroughSee").onclick = function () { |
| | | if (tf == false) { |
| | | addViewFlag = false; |
| | | addTargetFlag = false; |
| | | mv = false; |
| | | tf = false; |
| | | handlerPoint.clear(); |
| | | viewer.entities.removeAll(); |
| | | if (couldRemove) { |
| | | sightline.removeAllTargetPoint(); |
| | | couldRemove = false; |
| | | } |
| | | viewer.enableCursorStyle = true; |
| | | $('body').removeClass('drawCur'); |
| | | } else { |
| | | layer.tips('正在添加目标点,请先右键关闭', $('#addViewPointthroughSee'), { tips: [1, 'red'] }); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //添加通视点 |
| | | function addTarget(CartesianPosition) { |
| | | if (addViewFlag === false && addTargetFlag) { |
| | | num += 1; |
| | | //将获取的点的位置转化成经纬度 |
| | | var cartographic = Cartesian2toDegrees(CartesianPosition); |
| | | //添加目标点 |
| | | var name = "point" + num; |
| | | var flag = sightline.addTargetPoint({ |
| | | position: cartographic, |
| | | name: name |
| | | }); |
| | | couldRemove = true; |
| | | } |
| | | } |
| | | |
| | | //笛卡尔转换为经纬度 |
| | | function Cartesian2toDegrees(position) { |
| | | var cartographic = Cesium.Cartographic.fromCartesian(position); |
| | | var longitude = Cesium.Math.toDegrees(cartographic.longitude); |
| | | var latitude = Cesium.Math.toDegrees(cartographic.latitude); |
| | | var height = cartographic.height; |
| | | |
| | | return [longitude, latitude, height]; |
| | | } |
| | | |
| | | that.promise = promise; |
| | | that.addViewFlag = addViewFlag; |
| | | that.addTargetFlag = addTargetFlag; |
| | | that.handlerPoint = handlerPoint; |
| | | |
| | | }, |
| | | promise: '', |
| | | addViewFlag: '', |
| | | addTargetFlag: '', |
| | | handlerPoint: '', |
| | | closesthroughSee: function (froms) { |
| | | console.log(`${this.name}--guanbi`); |
| | | that = this; |
| | | |
| | | Cesium.when.all(that.promise, function (layer) { |
| | | for (var i = 0; i < layer.length; i++) { |
| | | that.map.scene.layers.remove(layer[i].name) |
| | | } |
| | | }) |
| | | that.addViewFlag = false; |
| | | that.addTargetFlag = false; |
| | | that.handlerPoint.clear(); |
| | | that.map.entities.removeAll(); |
| | | if (couldRemove) { |
| | | sightline.removeAllTargetPoint(); |
| | | couldRemove = false; |
| | | } |
| | | that.map.enableCursorStyle = true; |
| | | $('body').removeClass('drawCur'); |
| | | }, |
| | | onOpen: function () { |
| | | |
| | | }, |
| | | |
| | | onClose: function () { |
| | | //面板关闭的时候触发 (when this panel is closed trigger) |
| | | console.log('jies') |
| | | }, |
| | | |
| | | onMinimize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | onMaximize: function () { |
| | | this.resize(); |
| | | }, |
| | | |
| | | resize: function () { |
| | | |
| | | }, |
| | | |
| | | destroy: function () { |
| | | //销毁的时候触发 |
| | | //todo |
| | | //do something before this func |
| | | this.inherited(arguments); |
| | | } |
| | | |
| | | }); |
| | | }); |
| New file |
| | |
| | | .jimu-widget-throughSee { |
| | | position: fixed !important; |
| | | top: 72px !important; |
| | | right: 388px !important; |
| | | width: 230px !important; |
| | | height: 40px !important; |
| | | background-color: rgb(255, 255, 255); |
| | | font-size: 14px; |
| | | color: rgb(0, 0, 0); |
| | | z-index: 12 !important; |
| | | border-radius: 10px; |
| | | /* display: none; */ |
| | | box-shadow: 0 0 8px #fff; |
| | | padding: 0px 5px !important; |
| | | line-height: 41px; |
| | | } |
| | | |
| | | .jimu-widget-throughSee .closeOUR { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -2.5px; |
| | | font-size: 18px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .jimu-widget-throughSee .closeOUR:hover { |
| | | color: red; |
| | | } |
| | | |
| | | .jimu-widget-throughSee button { |
| | | line-height: 30px; |
| | | /* width: 80px; */ |
| | | height: 30px; |
| | | font-size: 14px; |
| | | border-radius: 5px; |
| | | box-shadow: 2px 2px 15px -5px #378ef1; |
| | | border: 1px solid transparent; |
| | | background-color: #fff; |
| | | padding: 0 2px; |
| | | margin-right: 2px; |
| | | } |
| | | |
| | | .jimu-widget-throughSee button:hover { |
| | | box-shadow: 2px 2px 25px -5px #1679eb; |
| | | } |
| New file |
| | |
| | | { |
| | | "name": "throughSee", |
| | | "2D": true, |
| | | "3D": true, |
| | | "platform": "HTML", |
| | | "version": "2.10", |
| | | "wabVersion": "2.10", |
| | | "author": "liuyg", |
| | | "description": "", |
| | | "copyright": "", |
| | | "license": "", |
| | | "properties": { |
| | | "hasConfig": false, |
| | | "inPanel": false, |
| | | "hasVersionManager": false |
| | | } |
| | | } |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "throughSee" |
| | | }) |
| | | ); |
| New file |
| | |
| | | define({ |
| | | root: ({ |
| | | _widgetLabel: "throughSee" |
| | | }), |
| | | "es": 1, |
| | | "zh-cn": 1 |
| | | }); |
| New file |
| | |
| | | define( |
| | | ({ |
| | | _widgetLabel: "通视分析" |
| | | }) |
| | | ); |
| | |
| | | } |
| | | // }) |
| | | that.handlerPolygon = handlerPolygon; |
| | | that.tooltip = tooltip; |
| | | |
| | | }, |
| | | handlerPolygon: '', |
| | | tooltip: '', |
| | | closesVolumeAnalysis: function (froms) { |
| | | // console.log('guanbi'); |
| | | this.map.scene.globe.removeAllModifyRegion(); |
| | |
| | | document.getElementById("fillVolumeVolumeAnalysis").value = ""; |
| | | document.getElementById("remainderAreaVolumeAnalysis").value = ""; |
| | | this.handlerPolygon.clear(); |
| | | this.tooltip.setVisible(false); |
| | | }, |
| | | onOpen: function () { |
| | | |