From 16cdc43d5eefa486c6c3a490003a44930b700ae9 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 17 Jun 2021 17:37:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
---
config.json | 8
widgets/profileAnalysis/nls/zh-cn/strings.js | 5
widgets/slope/css/style.css | 22 +
widgets/Tool/Widget.html | 3
widgets/visibleArea/css/style.css | 68 +-
widgets/slope/nls/es/strings.js | 5
widgets/legends/Widget.js | 3
widgets/profileAnalysis/nls/es/strings.js | 5
widgets/slope/manifest.json | 17
widgets/slope/nls/strings.js | 7
widgets/slope/Widget.js | 325 +++++++++++++++++
widgets/visibleArea/Widget.js | 2
widgets/profileAnalysis/Widget.html | 32 +
widgets/slope/Widget.html | 37 +
widgets/Tool/Widget.js | 112 +++++
widgets/MapPrinting/css/style.css | 9
widgets/profileAnalysis/manifest.json | 17
widgets/profileAnalysis/nls/strings.js | 7
widgets/searchL/Widget.js | 2
widgets/slope/nls/zh-cn/strings.js | 5
widgets/profileAnalysis/css/style.css | 53 ++
widgets/profileAnalysis/Widget.js | 373 +++++++++++++++++++
22 files changed, 1,055 insertions(+), 62 deletions(-)
diff --git a/config.json b/config.json
index aca3030..205bc79 100644
--- a/config.json
+++ b/config.json
@@ -224,6 +224,14 @@
{
"name": "可视化分析",
"uri": "widgets/visibleArea/Widget"
+ },
+ {
+ "name": "坡度坡向分析",
+ "uri": "widgets/slope/Widget"
+ },
+ {
+ "name": "剖面分析",
+ "uri": "widgets/profileAnalysis/Widget"
}
diff --git a/widgets/MapPrinting/css/style.css b/widgets/MapPrinting/css/style.css
index 3d60ab9..1e28593 100644
--- a/widgets/MapPrinting/css/style.css
+++ b/widgets/MapPrinting/css/style.css
@@ -57,14 +57,9 @@
}
.MapPrinting-flex-x {
- cursor: pointer;
- /* background-color: rgba(62,159,252, 0.75); */
- /* border: 1px solid rgba(62,159,252, 0.75); */
- font-size: 26px;
- /* border-radius: 10px; */
- /* padding: 5px; */
position: relative;
- top: -2px;
+ font-size: 18px;
+ cursor: pointer;
}
.MapPrinting-flex-x :hover{
color: red;
diff --git a/widgets/Tool/Widget.html b/widgets/Tool/Widget.html
index abab6c8..f296b9a 100644
--- a/widgets/Tool/Widget.html
+++ b/widgets/Tool/Widget.html
@@ -10,6 +10,9 @@
<li class="sign-tool"><i></i> <span>我的标记</span></li>
<li class="CoorPosition-tool"><i></i> <span>坐标定位</span></li>
<li class="MapPrinting-tool"><i></i> <span>场景快照</span></li>
+ <li class="visibleArea-tool"><i></i> <span>可视分析</span></li>
+ <li class="profileAnalysis-tool"><i></i> <span>剖面分析</span></li>
+ <li class="slope-tool"><i></i> <span>坡度分析</span></li>
<!-- <li class="superposition-tool"><i></i> <span>叠加分析</span></li>
<li class="buffer-tool"><i></i> <span>缓冲分析</span></li> -->
</ul>
diff --git a/widgets/Tool/Widget.js b/widgets/Tool/Widget.js
index 7c22602..4289d78 100644
--- a/widgets/Tool/Widget.js
+++ b/widgets/Tool/Widget.js
@@ -3,16 +3,16 @@
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
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,
@@ -51,10 +51,13 @@
$('.jimu-widget-Sign').hide();
$('.jimu-widget-CoorPosition').hide();
$('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
$('.jimu-widget-Measurement').show();
- $('.tool-y-box').stop().hide();
})
@@ -70,10 +73,13 @@
topic.publish('closeFlyRoute', 'FlyRoute');
$('.jimu-widget-CoorPosition').hide();
$('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
topic.publish('openRolling', 'Rolling');
- $('.tool-y-box').stop().hide();
})
@@ -88,10 +94,13 @@
topic.publish('closeFlyRoute', 'FlyRoute');
$('.jimu-widget-CoorPosition').hide();
$('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
topic.publish('openSplitScreen', 'SplitScreen');
- $('.tool-y-box').stop().hide();
})
// 我的标记
@@ -106,10 +115,13 @@
topic.publish('closeFlyRoute', 'FlyRoute');
$('.jimu-widget-CoorPosition').hide();
$('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
topic.publish('openSign', 'Sign');
- $('.tool-y-box').stop().hide();
})
@@ -126,9 +138,13 @@
topic.publish('closeSign', 'Sign');
topic.publish('closeFlyRoute', 'FlyRoute');
$('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
+
$('.jimu-widget-CoorPosition').show();
- $('.tool-y-box').stop().hide();
})
@@ -146,13 +162,77 @@
topic.publish('closeSign', 'Sign');
topic.publish('closeFlyRoute', 'FlyRoute');
$('.jimu-widget-CoorPosition').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
+
$('.jimu-widget-MapPrinting').show();
- $('.tool-y-box').stop().hide();
})
+ // 可视分析
+ $('.visibleArea-tool').click(function () {
+ // 关闭量算
+ topic.publish('closeMeasurement', 'Measurement');
+ // 关闭卷帘
+ topic.publish('closeRolling', 'Rolling');
+ // 关闭分屏
+ topic.publish('closeSplitScreen', 'SplitScreen');
+ // 关闭标记
+ topic.publish('closeSign', 'Sign');
+ topic.publish('closeFlyRoute', 'FlyRoute');
+ $('.jimu-widget-CoorPosition').hide();
+ $('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
+
+ $(".jimu-widget-visibleArea").show();
+ })
+
+ $('.profileAnalysis-tool').click(function () {
+
+ // 关闭量算
+ topic.publish('closeMeasurement', 'Measurement');
+ // 关闭卷帘
+ topic.publish('closeRolling', 'Rolling');
+ // 关闭分屏
+ topic.publish('closeSplitScreen', 'SplitScreen');
+ // 关闭标记
+ topic.publish('closeSign', 'Sign');
+ topic.publish('closeFlyRoute', 'FlyRoute');
+ $('.jimu-widget-CoorPosition').hide();
+ $('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-slope").hide();
+ $('.tool-y-box').stop().hide();
+
+ $(".jimu-widget-profileAnalysis").show();
+ })
+
+ $('.slope-tool').click(function () {
+
+ // 关闭量算
+ topic.publish('closeMeasurement', 'Measurement');
+ // 关闭卷帘
+ topic.publish('closeRolling', 'Rolling');
+ // 关闭分屏
+ topic.publish('closeSplitScreen', 'SplitScreen');
+ // 关闭标记
+ topic.publish('closeSign', 'Sign');
+ topic.publish('closeFlyRoute', 'FlyRoute');
+ $('.jimu-widget-CoorPosition').hide();
+ $('.jimu-widget-MapPrinting').hide();
+ $(".jimu-widget-visibleArea").hide();
+ $(".jimu-widget-profileAnalysis").hide();
+ $('.tool-y-box').stop().hide();
+
+ $(".jimu-widget-slope").show();
+ topic.publish('getbeginSlope', this.beginSlope);
+ })
},
diff --git a/widgets/legends/Widget.js b/widgets/legends/Widget.js
index 2522a80..cc5440d 100644
--- a/widgets/legends/Widget.js
+++ b/widgets/legends/Widget.js
@@ -31,9 +31,6 @@
// 暴露在外的接口
topic.subscribe("getLegendsData", lang.hitch(this, this.onGetLegendsData));
- $('.ccsliu').click(() => {
- $(".jimu-widget-visibleArea").show();
- })
},
onGetLegendsData: function (item) {
var val = item == ' ' ? '' : item;
diff --git a/widgets/profileAnalysis/Widget.html b/widgets/profileAnalysis/Widget.html
new file mode 100644
index 0000000..c5fb4cc
--- /dev/null
+++ b/widgets/profileAnalysis/Widget.html
@@ -0,0 +1,32 @@
+<div>
+ <!-- <div id="cesiumContainer"></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="toolbar" class="param-container tool-bar">
+ <button type="button" id="chooseViews" class="button black">剖面分析</button>
+ <button type="button" id="clears" class="button black">清除</button>
+ <i class="layui-icon closes">
+ ဆ
+ </i>
+ </div>
+ <canvas style="position : absolute; right : 7px; bottom : -530px;background-color:rgba(65, 65, 65, 0.5)" id="pro"
+ height="0" width="0"></canvas>
+</div>
\ No newline at end of file
diff --git a/widgets/profileAnalysis/Widget.js b/widgets/profileAnalysis/Widget.js
new file mode 100644
index 0000000..602ea9f
--- /dev/null
+++ b/widgets/profileAnalysis/Widget.js
@@ -0,0 +1,373 @@
+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-profileAnalysis',
+ name: 'profileAnalysis',
+ flag: false,
+ startup: function () {
+ var that = this;
+ var viewer = that.map;
+ var scene = viewer.scene;
+ 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"
+
+ }
+ 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);
+ $("#toolbar").show();
+ $('#loadingbar').remove();
+ if (!scene.pickPositionSupported) {
+ alert('不支持深度纹理,剖面分析功能无法使用!');
+ }
+ //创建剖面分析对象
+ var profile = new Cesium.Profile(scene);
+
+ 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);
+ }
+
+ var tooltip = createTooltip(document.body);
+ var widget = viewer.cesiumWidget;
+ try {
+ //添加S3M图层 // 舍弃
+
+ // var ground1Promise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_GROUND1, {
+ // name: 'ground1'
+ // });
+ // var buildPromise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_BUILD, {
+ // name: 'build'
+ // });
+ // var lakePromise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_LAKE, {
+ // name: 'lake'
+ // });
+ // var treePromise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_TREE, {
+ // name: 'tree'
+ // });
+ // var roadPromise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_ROAD, {
+ // name: 'road'
+ // });
+ // var bridgePromise = scene.addS3MTilesLayerByScp(URL_CONFIG.SCP_CBD_BRIDGE, {
+ // name: 'bridge'
+ // });
+ // var promiseSet = [ground1Promise, buildPromise, lakePromise, treePromise, roadPromise, bridgePromise];
+ // Cesium.when.all(promiseSet, function (layer) {
+ // scene.camera.setView({ //图层加载完成,设置相机位置
+ // destination: Cesium.Cartesian3.fromDegrees(116.4473, 39.9011, 127),
+ // orientation: {
+ // heading: 0.2732,
+ // pitch: -0.1583,
+ // roll: 0
+ // }
+ // });
+ // for (var i = 0; i < layer.length; i++) {
+ // layer[i].selectEnabled = false;
+ // }
+ // }, function (e) {
+ // if (widget._showRenderLoopErrors) {
+ // var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
+ // widget.showErrorPanel(title, undefined, e);
+ // }
+ // });
+ var handlerLine = new Cesium.DrawHandler(viewer, Cesium.DrawMode.Line);
+ handlerLine.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');
+ }
+ });
+ handlerLine.movingEvt.addEventListener(function (windowPosition) {
+ if (handlerLine.isDrawing) {
+ tooltip.showAt(windowPosition, '<p>右键单击结束绘制</p>');
+ } else {
+ tooltip.showAt(windowPosition, '<p>点击绘制第一个点</p>');
+ }
+
+ });
+ var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
+
+ handlerLine.drawEvt.addEventListener(function (result) {
+ tooltip.setVisible(false);
+ var line = result.object;
+ var startPoint = line._positions[0];
+ var endPoint = line._positions[line._positions.length - 1];
+
+ var scartographic = Cesium.Cartographic.fromCartesian(startPoint);
+ var slongitude = Cesium.Math.toDegrees(scartographic.longitude);
+ var slatitude = Cesium.Math.toDegrees(scartographic.latitude);
+ var sheight = scartographic.height;
+
+ var ecartographic = Cesium.Cartographic.fromCartesian(endPoint);
+ var elongitude = Cesium.Math.toDegrees(ecartographic.longitude);
+ var elatitude = Cesium.Math.toDegrees(ecartographic.latitude);
+ var eheight = ecartographic.height;
+
+ //设置坡面分析的开始和结束位置
+ profile.startPoint = [slongitude, slatitude, sheight];
+ profile.endPoint = [elongitude, elatitude, eheight];
+
+ profile.extendHeight = 40;
+
+ //分析完毕的回调函数
+ profile.getBuffer(function (buffer) {
+
+ var canvas = document.getElementById("pro");
+ canvas.height = profile._textureHeight;
+ canvas.width = profile._textureWidth;
+ var ctx = canvas.getContext("2d");
+ var imgData = ctx.createImageData(profile._textureWidth, profile._textureHeight);
+ imgData.data.set(buffer);
+ //在canvas上绘制图片
+ ctx.putImageData(imgData, 0, 0);
+ $("#pro").width(600);
+ $("#pro").height(450);
+ });
+
+ profile.build();
+ });
+
+ document.getElementById("chooseViews").onclick = function () {
+ //先清除之前绘制的线
+ console.log('kais')
+ handlerLine.clear();
+ $("#pro").width(0);
+ $("#pro").height(0);
+ if (handlerLine.active) {
+ return;
+ } else {
+ handlerLine.activate();
+ //由于剖面分析只能绘制直线,此处绘制时单击两次就触发结束事件
+ handler.setInputAction(function (e) {
+ if (handlerLine.polyline._actualPositions.length == 2) {
+ var result = {};
+ result.object = handlerLine.polyline;
+ handlerLine.drawEvt.raiseEvent(result);
+ handlerLine.deactivate();
+ handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
+ }
+ }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
+ }
+
+ };
+ document.getElementById("clears").onclick = function () {
+ handlerLine.clear();
+ $("#pro").width(0);
+ $("#pro").height(0);
+ }
+
+ } catch (e) {
+ // if (scene.context.depthTexture) {
+ // swal("剖面分析", "该浏览器不支持深度纹理检测", "warning");
+ // }
+ console.log(e)
+ }
+
+ $('.jimu-widget-profileAnalysis').find(".closes").click(function () {
+ $(".jimu-widget-profileAnalysis").hide();
+ handlerLine.clear();
+ $("#pro").width(0);
+ $("#pro").height(0);
+ })
+
+ },
+
+ onOpen: function () {
+
+ },
+
+ onClose: function () {
+ //面板关闭的时候触发 (when this panel is closed trigger)
+ },
+
+ onMinimize: function () {
+ this.resize();
+ },
+
+ onMaximize: function () {
+ this.resize();
+ },
+
+ resize: function () {
+
+ },
+
+ destroy: function () {
+ //销毁的时候触发
+ //todo
+ //do something before this func
+ this.inherited(arguments);
+ }
+
+ });
+ });
diff --git a/widgets/profileAnalysis/css/style.css b/widgets/profileAnalysis/css/style.css
new file mode 100644
index 0000000..3ca7e1a
--- /dev/null
+++ b/widgets/profileAnalysis/css/style.css
@@ -0,0 +1,53 @@
+.jimu-widget-profileAnalysis {
+ position: fixed !important;
+ top: 96px !important;
+ right: 10px !important;
+ width: 200px !important;
+ height: 40px !important;
+ background-color: rgb(255, 255, 255);
+ font-size: 14px;
+ color: rgb(0, 0, 0);
+ font-size: 16px;
+ z-index: 11 !important;
+ border-radius: 10px;
+ display: none;
+ box-shadow: 0 0 8px #fff;
+ padding: 0px 5px !important;
+}
+
+.jimu-widget-profileAnalysis #toolbar {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ font-size: 14px;
+}
+
+.jimu-widget-profileAnalysis #toolbar #chooseViews, .jimu-widget-profileAnalysis #toolbar #clears {
+ width: auto;
+ padding: 0 8px;
+ height: 30px;
+ border-radius: 5px;
+ background-color: #fff;
+ border: 1px solid transparent;
+ box-shadow: 3px 3px 15px -5px #39A5FD;
+ cursor: pointer;
+}
+
+.jimu-widget-profileAnalysis #toolbar #chooseViews:hover, .jimu-widget-profileAnalysis #toolbar #clears:hover {
+ background-color: #3E9FFC;
+ box-shadow: 3px 3px 20px -4px #000000;
+ filter: grayscale(100%) brightness(200%);
+}
+
+.jimu-widget-profileAnalysis #toolbar .closes {
+ position: relative;
+ left: 3px;
+ font-size: 18px;
+ cursor: pointer;
+}
+
+.jimu-widget-profileAnalysis #toolbar .closes:hover {
+ color: red;
+}
\ No newline at end of file
diff --git a/widgets/profileAnalysis/manifest.json b/widgets/profileAnalysis/manifest.json
new file mode 100644
index 0000000..46b5f16
--- /dev/null
+++ b/widgets/profileAnalysis/manifest.json
@@ -0,0 +1,17 @@
+{
+ "name": "profileAnalysis",
+ "2D": true,
+ "3D": true,
+ "platform": "HTML",
+ "version": "2.10",
+ "wabVersion": "2.10",
+ "author": "liuyg",
+ "description": "",
+ "copyright": "",
+ "license": "",
+ "properties": {
+ "hasConfig": false,
+ "inPanel": false,
+ "hasVersionManager": false
+ }
+}
\ No newline at end of file
diff --git a/widgets/profileAnalysis/nls/es/strings.js b/widgets/profileAnalysis/nls/es/strings.js
new file mode 100644
index 0000000..f2c6b15
--- /dev/null
+++ b/widgets/profileAnalysis/nls/es/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "profileAnalysis"
+ })
+);
\ No newline at end of file
diff --git a/widgets/profileAnalysis/nls/strings.js b/widgets/profileAnalysis/nls/strings.js
new file mode 100644
index 0000000..080056f
--- /dev/null
+++ b/widgets/profileAnalysis/nls/strings.js
@@ -0,0 +1,7 @@
+define({
+ root: ({
+ _widgetLabel: "profileAnalysis"
+ }),
+ "es": 1,
+ "zh-cn": 1
+});
\ No newline at end of file
diff --git a/widgets/profileAnalysis/nls/zh-cn/strings.js b/widgets/profileAnalysis/nls/zh-cn/strings.js
new file mode 100644
index 0000000..1addcc6
--- /dev/null
+++ b/widgets/profileAnalysis/nls/zh-cn/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "剖面分析"
+ })
+);
\ No newline at end of file
diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
index 3f87560..356343d 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -233,7 +233,7 @@
clickHand: function clickHand(data) {
var pickedObjects = this.map.scene.drillPick(data.position) || 0;
// console.log(pickedObjects);
- if (pickedObjects.length != 0) {
+ if (pickedObjects.length != 0 && pickedObjects.id != undefined) {
var data = pickedObjects[0].primitive.id.onceData[1];
if (pickedObjects[0].primitive.id.onceData[0] == 1) {//全景
diff --git a/widgets/slope/Widget.html b/widgets/slope/Widget.html
new file mode 100644
index 0000000..c761d59
--- /dev/null
+++ b/widgets/slope/Widget.html
@@ -0,0 +1,37 @@
+<div>
+ <div id="float"
+ style="background:#95e8f9;width: 250px;height: 470px;top: 15px;left: 1.5%;opacity: 1">
+ <div id="con" style="background:#95e8f9;width: 230px;height: 450px;top: 85px;left: 1.1%;margin: 10px">
+ <label for="calMode">1、计算模式:</label>
+ <select id="calMode">
+ <option value="calModeall_plane">指定多边形区域</option>
+ <option value="calModeall_any">全部区域参与分析</option>
+ <option value="calModeall_none">全部区域不参与分析</option>
+ </select><br>
+ <label>2、坡度区间:</label>
+ <label> 起:</label>
+ <input type="range" id="wideminR" min="0" max="90" value="0" style="width: 170px" ;>
+ <input type="number" id="widemin" min="0" max="90" value="0" style="width: 30px"> <label> 终:</label>
+ <input type="range" id="widemaxR" min="0" max="90" value="78" style="width: 170px">
+ <input type="number" id="widemax" min="0" max="90" value="78" style="width: 30px;">
+ <label>3、显示样式:</label>
+ <label><input type="radio" id="showcolor" name="fill">显示填充颜色</label>
+ <label><input type="radio" id="showarrow" name="fill">显示坡向箭头</label>
+ <label><input type="radio" id="showall" name="fill" checked="checked">填充颜色和坡向箭头</label>
+ <label>4、颜色条带:</label>
+ <div id="bar">
+ <select id="colorTable1" class="selectpicker">
+ <option value="1" data-content="<span class='label band4'> </span>"> </option>
+ <option value="2" data-content="<span class='label band2'> </span>"> </option>
+ <option value="3" data-content="<span class='label band3'> </span>"> </option>
+ <option value="4" data-content="<span class='label band1'> </span>"> </option>
+ <option value="5" data-content="<span class='label band5'> </span>"> </option>
+ </select>
+ </div>
+ <br>
+ <label>5、透明调节:</label>
+ <input type="number" step="0.1" id="trans" min="0" max="1" value="0.5" style="width:100px">
+ <input type="button" id="cance" value="清除结果">
+ </div>
+ </div>
+</div>
\ No newline at end of file
diff --git a/widgets/slope/Widget.js b/widgets/slope/Widget.js
new file mode 100644
index 0000000..8ea8799
--- /dev/null
+++ b/widgets/slope/Widget.js
@@ -0,0 +1,325 @@
+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-slope',
+ name: 'slope',
+ flag: false,
+ startup: function () {
+ var that = this;
+ topic.subscribe("getbeginSlope", lang.hitch(this, this.beginSlope));
+ // topic.publish('getbeginSlope', that.beginSlope);
+
+ },
+ beginSlope: function () {
+ console.log('beginSlope');
+ var that = this;
+ var viewer = that.map;
+ var scene = viewer.scene;
+ scene.globe.enableLighting = true;
+ //添加SuperMap iServer发布的影像服务
+ viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+ url: 'http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image'
+ }));
+ // viewer.scene.camera.setView({
+ // destination: Cesium.Cartesian3.fromDegrees(87.1, 27.8, 8000.0),
+ // orientation: {
+ // heading: 6.10547067016156,
+ // pitch: -0.8475077031996778,
+ // roll: 6.2831853016686185
+ // }
+ // });
+ var slope = new Cesium.SlopeSetting();
+ slope.DisplayMode = Cesium.SlopeSettingEnum.DisplayMode.FACE_AND_ARROW;
+ slope.MaxVisibleValue = document.getElementById("widemax").value;
+ slope.MinVisibleValue = document.getElementById("widemin").value;
+ var colorTable = new Cesium.ColorTable();
+ colorTable.insert(80, new Cesium.Color(255 / 255, 0 / 255, 0 / 255));
+ colorTable.insert(50, new Cesium.Color(221 / 255, 224 / 255, 7 / 255));
+ colorTable.insert(30, new Cesium.Color(20 / 255, 187 / 255, 18 / 255));
+ colorTable.insert(20, new Cesium.Color(0, 161 / 255, 1));
+ colorTable.insert(0, new Cesium.Color(9 / 255, 9 / 255, 255 / 255));
+ var wide;
+ wide = Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_REGION;
+ slope.ColorTable = colorTable;
+ slope.Opacity = 0.5;
+
+ 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 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 (windowPosition.x < 200 && windowPosition.y < 150) {
+ tooltip.setVisible(false);
+ return;
+ }
+ });
+ handlerPolygon.drawEvt.addEventListener(function (result) {
+ if (!result.object.positions) {
+ handlerPolygon.polygon.show = false;
+ handlerPolygon.polyline.show = false;
+ handlerPolygon.deactivate();
+ handlerPolygon.activate();
+ return;
+ }
+ var array = [].concat(result.object.positions);
+ tooltip.setVisible(false);
+ var positions = [];
+ 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;
+ if (positions.indexOf(longitude) == -1 && positions.indexOf(latitude) == -1) {
+ positions.push(longitude);
+ positions.push(latitude);
+ positions.push(h);
+ }
+ }
+
+ slope.CoverageArea = positions;
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ handlerPolygon.polygon.show = false;
+ handlerPolygon.polyline.show = true;
+ handlerPolygon.deactivate();
+ handlerPolygon.activate();
+ });
+ handlerPolygon.activate();
+ document.getElementById("cance").onclick = function () {
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_NONE
+ };
+ handlerPolygon.polygon.show = false;
+ handlerPolygon.polyline.show = false;
+ };
+ viewer._cesiumWidget._creditContainer.style.display = "none";
+ $("#split").on("click", function () {
+ $("#float").slideToggle(500);
+ }
+ );
+ $("#trans").on("input change", function () {
+ slope.Opacity = this.value;
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ });
+ $("#wideminR").on("input change", function () {
+ var a = document.getElementById("widemin");
+ a.value = this.value;
+ slope.MinVisibleValue = this.value;
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ });
+ $("#widemin").on("input change", function () {
+ var a = document.getElementById("widemin");
+ a.value = this.value;
+ });
+ $("#widemaxR").on("input change", function () {
+ var a = document.getElementById("widemax");
+ a.value = this.value;
+ slope.MaxVisibleValue = this.value;
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ });
+ $("#widemax").on("input change", function () {
+ var a = document.getElementById("widemaxR");
+ a.value = this.value;
+ });
+ $("#calMode").on("input change", function () {
+ var index = document.getElementById("calMode").selectedIndex;
+ switch (index) {
+ case 0:
+ wide = Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_REGION;
+ break;
+ case 1:
+ wide = Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_ALL;
+ break;
+ case 2:
+ wide = Cesium.HypsometricSettingEnum.AnalysisRegionMode.ARM_NONE;
+ break;
+ default:
+ break;
+ }
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ });
+ $(":radio[name='fill']").change(function () {
+ if (document.getElementById("showcolor").checked) {
+ slope.DisplayMode = Cesium.SlopeSettingEnum.DisplayMode.FACE;
+ } else if (document.getElementById("showarrow").checked) {
+ slope.DisplayMode = Cesium.SlopeSettingEnum.DisplayMode.ARROW;
+ } else {
+ slope.DisplayMode = Cesium.SlopeSettingEnum.DisplayMode.FACE_AND_ARROW;
+ }
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ }
+ )
+ $("#colorTable1").on("input change", function () {
+ colorTable.remove(0);
+ colorTable.remove(20);
+ colorTable.remove(30);
+ colorTable.remove(50);
+ colorTable.remove(80);
+ var value = document.getElementById("colorTable1").selectedIndex;
+ switch (value) {
+ case 0:
+ colorTable.insert(0, new Cesium.Color(9 / 255, 9 / 255, 255 / 255));
+ colorTable.insert(20, new Cesium.Color(0, 161 / 255, 1));
+ colorTable.insert(30, new Cesium.Color(20 / 255, 187 / 255, 18 / 255));
+ colorTable.insert(50, new Cesium.Color(221 / 255, 224 / 255, 7 / 255));
+ colorTable.insert(80, new Cesium.Color(255 / 255, 0 / 255, 0 / 255));
+ break;
+ case 1:
+ colorTable.insert(0, new Cesium.Color(162 / 255, 251 / 255, 194 / 255));
+ colorTable.insert(20, new Cesium.Color(180 / 255, 200 / 255, 170 / 255));
+ colorTable.insert(30, new Cesium.Color(200 / 255, 160 / 255, 130 / 255));
+ colorTable.insert(50, new Cesium.Color(225 / 255, 130 / 255, 130 / 255));
+ colorTable.insert(80, new Cesium.Color(1, 103 / 255, 103 / 255));
+ break;
+ case 2:
+ colorTable.insert(0, new Cesium.Color(230 / 255, 198 / 255, 1));
+ colorTable.insert(20, new Cesium.Color(210 / 255, 150 / 255, 1));
+ colorTable.insert(30, new Cesium.Color(190 / 255, 100 / 255, 1));
+ colorTable.insert(50, new Cesium.Color(165, 50 / 255, 1));
+ colorTable.insert(80, new Cesium.Color(157 / 255, 0, 1));
+ break;
+ case 3:
+ colorTable.insert(0, new Cesium.Color(0, 39 / 255, 148 / 255));
+ colorTable.insert(20, new Cesium.Color(0, 39 / 255, 148 / 255));
+ colorTable.insert(30, new Cesium.Color(70 / 255, 116 / 255, 200 / 255));
+ colorTable.insert(50, new Cesium.Color(149 / 255, 232 / 255, 249 / 255));
+ colorTable.insert(80, new Cesium.Color(149 / 255, 232 / 255, 249 / 255));
+ break;
+ case 4:
+ colorTable.insert(0, new Cesium.Color(186 / 255, 1, 190 / 255));
+ colorTable.insert(20, new Cesium.Color(186 / 255, 1, 180 / 255));
+ colorTable.insert(30, new Cesium.Color(106 / 255, 255 / 255, 170 / 255));
+ colorTable.insert(50, new Cesium.Color(26 / 255, 255 / 255, 160 / 255));
+ colorTable.insert(80, new Cesium.Color(26 / 255, 255 / 255, 156 / 255));
+ break;
+ default:
+ break;
+ }
+ slope.ColorTable = colorTable;
+ viewer.scene.globe.SlopeSetting = {
+ slopeSetting: slope,
+ analysisMode: wide
+ };
+ });
+
+ if (!scene.pickPositionSupported) {
+ alert('不支持深度纹理,无法绘制多边形,根据多边形显示分析区域功能无法使用!');
+ }
+ $('#toolbar').show();
+ $('#btnContainer').show();
+ $('#loadingbar').remove();
+ },
+ 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);
+ }
+
+ });
+ });
diff --git a/widgets/slope/css/style.css b/widgets/slope/css/style.css
new file mode 100644
index 0000000..e0d05c8
--- /dev/null
+++ b/widgets/slope/css/style.css
@@ -0,0 +1,22 @@
+.jimu-widget-slope {
+ position: fixed !important;
+ top: 96px !important;
+ right: 10px !important;
+ width: 200px !important;
+ height: 40px !important;
+ background-color: rgb(255, 255, 255);
+ font-size: 14px;
+ color: rgb(0, 0, 0);
+ font-size: 16px;
+ z-index: 11 !important;
+ border-radius: 10px;
+ display: none;
+ box-shadow: 0 0 8px #fff;
+ padding: 0px 5px !important;
+}
+
+.jimu-widget-slope #float {
+ position: relative !important;
+ top: 50px !important;
+ left: -60px !important;
+}
\ No newline at end of file
diff --git a/widgets/slope/manifest.json b/widgets/slope/manifest.json
new file mode 100644
index 0000000..c8c69b1
--- /dev/null
+++ b/widgets/slope/manifest.json
@@ -0,0 +1,17 @@
+{
+ "name": "slope",
+ "2D": true,
+ "3D": true,
+ "platform": "HTML",
+ "version": "2.10",
+ "wabVersion": "2.10",
+ "author": "liuyg",
+ "description": "",
+ "copyright": "",
+ "license": "",
+ "properties": {
+ "hasConfig": false,
+ "inPanel": false,
+ "hasVersionManager": false
+ }
+}
\ No newline at end of file
diff --git a/widgets/slope/nls/es/strings.js b/widgets/slope/nls/es/strings.js
new file mode 100644
index 0000000..ee6b4af
--- /dev/null
+++ b/widgets/slope/nls/es/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "slope"
+ })
+);
\ No newline at end of file
diff --git a/widgets/slope/nls/strings.js b/widgets/slope/nls/strings.js
new file mode 100644
index 0000000..960fde1
--- /dev/null
+++ b/widgets/slope/nls/strings.js
@@ -0,0 +1,7 @@
+define({
+ root: ({
+ _widgetLabel: "slope"
+ }),
+ "es": 1,
+ "zh-cn": 1
+});
\ No newline at end of file
diff --git a/widgets/slope/nls/zh-cn/strings.js b/widgets/slope/nls/zh-cn/strings.js
new file mode 100644
index 0000000..14c642a
--- /dev/null
+++ b/widgets/slope/nls/zh-cn/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "坡度坡向分析"
+ })
+);
\ No newline at end of file
diff --git a/widgets/visibleArea/Widget.js b/widgets/visibleArea/Widget.js
index 0879683..39a1418 100644
--- a/widgets/visibleArea/Widget.js
+++ b/widgets/visibleArea/Widget.js
@@ -271,7 +271,7 @@
viewModel.horizontalFov = viewshed3D.horizontalFov;
viewModel.verticalFov = viewshed3D.verticalFov;
} else {
- console.log('没打开')
+ console.log('没打开');
}
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
diff --git a/widgets/visibleArea/css/style.css b/widgets/visibleArea/css/style.css
index 1e74713..db350db 100644
--- a/widgets/visibleArea/css/style.css
+++ b/widgets/visibleArea/css/style.css
@@ -1,20 +1,18 @@
.jimu-widget-visibleArea {
position: fixed !important;
- top: 100px !important;
- right: 50px !important;
+ top: 96px !important;
+ right: 10px !important;
width: 200px !important;
- height: 50px !important;
- background-color: rgb(218, 218, 218);
+ height: 40px !important;
+ background-color: rgb(255, 255, 255);
font-size: 14px;
- /* border: 1px solid rgb(69, 154, 251); */
- /* opacity : .8; */
color: rgb(0, 0, 0);
font-size: 16px;
- z-index: 101;
- border-radius: 5px;
+ z-index: 11;
+ border-radius: 10px;
display: none;
box-shadow: 0 0 8px #fff;
- padding: 0px 10px !important;
+ padding: 0px 5px !important;
}
.jimu-widget-visibleArea input[type=range] {
@@ -43,47 +41,49 @@
display: flex;
align-items: center;
justify-content: space-around;
+ font-size: 14px;
}
.jimu-widget-visibleArea #toolbar #chooseView, .jimu-widget-visibleArea #toolbar #clear {
width: auto;
padding: 0 8px;
- height: 35px;
+ height: 30px;
border-radius: 5px;
background-color: #fff;
border: 1px solid transparent;
box-shadow: 3px 3px 15px -5px #39A5FD;
+ cursor: pointer;
+}
+
+.jimu-widget-visibleArea #toolbar #chooseView:hover, .jimu-widget-visibleArea #toolbar #clear:hover {
+ background-color: #3E9FFC;
+ box-shadow: 3px 3px 20px -4px #000000;
+ filter: grayscale(100%) brightness(200%);
}
.jimu-widget-visibleArea #toolbar .closes {
- position: absolute;
- top: -20px;
- right: -13px;
- width: 24px;
- height: 24px;
- color: #fff;
- font-size: 14px;
- line-height: 24px;
- text-align: center;
- background: #3E9FFC;
- border-radius: 50%;
- border: 1px solid #3E9FFC;
+ position: relative;
+ left: 3px;
+ font-size: 18px;
cursor: pointer;
}
+
+.jimu-widget-visibleArea #toolbar .closes:hover {
+ color: red;
+}
+
.jimu-widget-visibleArea #wrapper .close {
+ display: inline-block;
position: absolute;
- top: -20px;
- right: -13px;
- width: 24px;
- height: 24px;
- color: #fff;
- font-size: 14px;
- line-height: 24px;
- text-align: center;
- background: #3E9FFC;
- border-radius: 50%;
- border: 1px solid #3E9FFC;
+ right: 10px;
+ top: 10px;
+ font-size: 20px;
cursor: pointer;
+ z-index: 16;
+}
+
+.jimu-widget-visibleArea #wrapper .close:hover {
+ color: red;
}
.jimu-widget-visibleArea #wrapper {
@@ -91,7 +91,7 @@
height: 399px;
position: absolute;
top: 70px !important;
- left: -30px !important;
+ left: -65px !important;
padding: 18px 6% 20px 6%;
background: rgb(247, 247, 247);
border-radius: 5px;
--
Gitblit v1.9.3