From 32ff53f574c1db183a4837b8fb3272c61569db82 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Mon, 21 Jun 2021 15:59:13 +0800
Subject: [PATCH] SQL查询
---
config.json | 4
widgets/null/css/style.css | 26 +
widgets/SQLQuery/Widget.html | 16 +
widgets/SQLQuery/manifest.json | 17 +
widgets/null/nls/zh-cn/strings.js | 5
widgets/null/Widget.js | 66 ++++
widgets/SQLQuery/nls/zh-cn/strings.js | 5
widgets/slope/Widget.js | 11
widgets/visibleArea/Widget.js | 6
jimu.js/MapManager.js | 7
widgets/null/nls/es/strings.js | 5
widgets/slope/Widget.html | 4
widgets/SQLQuery/Widget.js | 314 ++++++++++++++++++++
widgets/SQLQuery/nls/es/strings.js | 5
widgets/null/manifest.json | 17 +
widgets/spatialAnalysis/Widget.js | 213 ++++++-------
widgets/SQLQuery/nls/strings.js | 7
widgets/SQLQuery/css/style.css | 27 +
widgets/null/Widget.html | 6
widgets/null/nls/strings.js | 7
widgets/searchL/Widget.js | 113 ++++---
widgets/spatialAnalysis/Widget.html | 4
22 files changed, 703 insertions(+), 182 deletions(-)
diff --git a/config.json b/config.json
index be20db7..b467f80 100644
--- a/config.json
+++ b/config.json
@@ -248,6 +248,10 @@
{
"name": "模型gif",
"uri": "widgets/modelDiagram/Widget"
+ },
+ {
+ "name": "SQL查询",
+ "uri": "widgets/SQLQuery/Widget"
}
],
"groups": [],
diff --git a/jimu.js/MapManager.js b/jimu.js/MapManager.js
index ffbef35..03284a5 100644
--- a/jimu.js/MapManager.js
+++ b/jimu.js/MapManager.js
@@ -140,12 +140,12 @@
layer = new Cesium.ArcGisMapServerImageryProvider(layerConfig);
}
-
+
layerArr.push(layer);
}
-
+
var pvm = new Cesium.ProviderViewModel({
name: imageryProviderViewModels[i].name,
tooltip: imageryProviderViewModels[i].tooltip,
@@ -179,7 +179,8 @@
return new Cesium.CesiumTerrainProvider({
url: "./dx/",
requestWaterMask: !0,
- requestVertexNormals: !0
+ requestVertexNormals: !0,
+ // isSct: true,//因坡度坡向添加
})
}
})];
diff --git a/widgets/SQLQuery/Widget.html b/widgets/SQLQuery/Widget.html
new file mode 100644
index 0000000..a3022fd
--- /dev/null
+++ b/widgets/SQLQuery/Widget.html
@@ -0,0 +1,16 @@
+<div>
+ <div id="SQLQuerytoolbar" class="param-container tool-bar">
+ <label style="font: 400 13.3333px Arial;">SQL</label><input type="text" id="SQL" value="SMAREA>500">
+ <button type="button" id="SQLQuerysearch" class="button black">查询</button>
+ <br>
+ <select id="SQLQueryposition" style="width: 100%">
+ <option value="1">定位点1</option>
+ <option value="2">定位点2</option>
+ <option value="3">定位点3</option>
+ <option value="4">点位点4</option>
+ </select>
+ </div>
+ <i class="layui-icon closeOUR">
+ ဆ
+ </i></span>
+</div>
\ No newline at end of file
diff --git a/widgets/SQLQuery/Widget.js b/widgets/SQLQuery/Widget.js
new file mode 100644
index 0000000..0cacb16
--- /dev/null
+++ b/widgets/SQLQuery/Widget.js
@@ -0,0 +1,314 @@
+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-SQLQuery',
+ name: 'SQLQuery',
+ flag: false,
+ startup: function () {
+ var that = this;
+ topic.subscribe("beginSQL", lang.hitch(this, this.beginSQL));
+ topic.subscribe("closesSQL", lang.hitch(this, this.closesSQL));
+ // topic.publish('beginSQL', that.beginSQL);
+ $(`.${that.baseClass}`).find('.closeOUR').click(() => {
+ $(`.${that.baseClass}`).hide();
+ that.closesSQL();
+ })
+
+ // that.beginSQL();
+
+ },
+ beginSQL: function () {
+ var that = this
+ , viewer = that.map
+ , 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 widget = viewer.cesiumWidget;
+ var buildingLayer;
+ var IDs = [];
+ $('#loadingbar').remove();
+ var URL_CONFIG = {
+ SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace',
+ }
+ var promise = scene.open(URL_CONFIG.SCENE_CBD);
+ // try {
+ Cesium.when(promise, function (layers) {
+ // console.log(layers, 1111)
+ //设置相机位置、视角,便于观察场景
+ scene.camera.setView({
+ destination: new Cesium.Cartesian3.fromDegrees(116.4566, 39.9149, 5323.445971240632),
+ orientation: {
+ heading: 0,
+ pitch: -1.5188,
+ roll: 0
+ }
+ });
+ var camera = scene.camera;
+
+ buildingLayer = scene.layers.find("Building@CBD");
+ buildingLayer.indexedDBSetting.isAttributesSave = true;//保存属性
+
+ //点击属性查询
+ var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
+ handler.setInputAction(function (evt) {
+ var position = scene.pickPosition(evt.position);
+
+ if (buildingLayer.getSelection().length > 0) {
+ const selectedId = Number(buildingLayer.getSelection()[0]);
+ buildingLayer.getAttributesById([selectedId]).then(function (atts) {
+ if (atts) {
+ console.log(atts);
+
+ viewer.entities.removeAll();
+
+ var length = Object.keys(atts).length;
+ var des;
+ for (var i = 0; i < length; i++) {
+ var key = Object.keys(atts)[i];
+ var value = atts[key];
+
+
+ var index = i.toString();
+ if (i == 0) {
+ des = '<table class="cesium-infoBox-defaultTable"><tbody>' + '<tr><th>' + key + '</th><td>' + value + '</td></tr>';
+ } else if (i == length - 1) {
+ des += '<tr><th>' + key + '</th><td>' + value + '</td></tr>' + "</tbody></table>";
+ } else {
+ des += '<tr><th>' + key + '</th><td>' + value + '</td></tr>';
+ }
+ }
+
+ viewer.entities.add({
+ position: position,
+ billboard: {
+ image: './images/addL/dworgin.png',
+ width: 30,
+ height: 40,
+
+ },
+ name: atts["MODELNAME"],
+ description: des
+ });
+
+ }
+ }
+ )
+ }
+ }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
+
+
+ $("#SQLQuerysearch").click(function () {
+ doSqlQuery($("#SQL").val());
+ });
+ $("#SQLQueryposition").change(function () {
+ if (this.value == "1") {
+ camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(116.45756824765414, 39.9151525065, 303.9282348283207),
+ orientation: {
+ heading: 3.361386,
+ pitch: -0.543285,
+ roll: 6.283185307179563
+ }
+ });
+ }
+ if (this.value == "2") {
+ camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(116.45898554643348, 39.90943026228571, 32.707476595524625),
+ orientation: {
+ heading: 6.016771,
+ pitch: -0.300416,
+ roll: 0.0
+ }
+ });
+ }
+ if (this.value == "3") {
+ camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(116.43518565219966, 39.95097107746538, 2078.0503226706123),
+ orientation: {
+ heading: 2.718565,
+ pitch: -0.415366,
+ roll: 0.0
+ }
+ });
+ }
+ if (this.value == "4") {
+ camera.flyTo({
+ destination: Cesium.Cartesian3.fromDegrees(116.48368313561016, 39.911532190450295, 369.08993153401934),
+ orientation: {
+ heading: 4.771817,
+ pitch: -0.190922,
+ roll: 0.0
+ }
+ });
+ }
+
+ })
+ }, function () {
+ var title = '加载SCP失败,请检查网络连接状态或者url地址是否正确?';
+ widget.showErrorPanel(title, undefined, e);
+ });
+ // } catch (e) {
+ // if (widget._showRenderLoopErrors) {
+ // var title = '渲染时发生错误,已停止渲染。';
+ // widget.showErrorPanel(title, undefined, e);
+ // }
+ // }
+
+ function onQueryComplete(features) {
+ var selectedFeatures = features;
+ viewer.entities.removeAll();
+ for (var i = 0; i < selectedFeatures.length; i++) {
+ var value = selectedFeatures[i].fieldValues["0"];
+ var feature = selectedFeatures[i];
+ for (var j = 0; j < feature.fieldNames.length; j++) {
+ var index = j.toString();
+ if (j == 0) {
+ var des = '<table class="cesium-infoBox-defaultTable"><tbody>' + '<tr><th>' + selectedFeatures[i].fieldNames["0"] + '</th><td>' + selectedFeatures[i].fieldValues["0"] + '</td></tr>';
+ } else if (j == feature.fieldNames.length - 1) {
+ des += '<tr><th>' + selectedFeatures[i].fieldNames[index] + '</th><td>' + selectedFeatures[i].fieldValues[index] + '</td></tr>' + "</tbody></table>";
+ } else {
+ des += '<tr><th>' + selectedFeatures[i].fieldNames[index] + '</th><td>' + selectedFeatures[i].fieldValues[index] + '</td></tr>';
+ }
+ }
+ viewer.entities.add({
+ position: Cesium.Cartesian3.fromDegrees(parseFloat(selectedFeatures[i].fieldValues["12"]), parseFloat(selectedFeatures[i].fieldValues["13"]), parseFloat(selectedFeatures[i].fieldValues["16"])),
+ billboard: {
+ image: './images/addL/dwblue.png',
+ width: 30,
+ height: 40,
+
+ },
+ name: selectedFeatures[i].fieldValues["11"],
+ description: des,
+ SQLData: selectedFeatures[i]//设置数据
+ });
+ IDs.push(parseInt(value) + 11);
+ }
+ if (IDs.length > 0) {
+ buildingLayer.setSelection(IDs);
+ }
+ }
+
+ function doSqlQuery(sqlStr) {
+ var sqlParameter = {
+ "datasetNames": ["二维数据:Building"],
+ getFeatureMode: "SQL",
+ queryParameter: {
+ attributeFilter: sqlStr
+ }
+ };
+ var url = "http://www.supermapol.com/realspace/services/data-cbd/rest/data/featureResults.rjson?returnContent=true";
+ var queryData = JSON.stringify(sqlParameter);
+
+ $.ajax({
+ type: "post",
+ url: url,
+ data: queryData,
+ success: function (result) {
+ var resultObj = JSON.parse(result);
+ console.log(resultObj);
+ if (resultObj.featureCount > 0) {
+ onQueryComplete(resultObj.features);
+ }
+ },
+ error: function (msg) {
+ console.log(msg);
+ },
+ // complete: function () {
+ // console.log("complete");
+ // }
+ })
+
+
+ // $.ajax({
+ // url: url,
+ // async: true,
+ // data: queryData,
+ // method: "POST"
+ // }).done(function (result) {
+ // var resultObj = JSON.parse(result);
+ // console.log(resultObj);
+ // if (resultObj.featureCount > 0) {
+ // onQueryComplete(resultObj.features);
+ // }
+ //
+ // })
+ }
+
+ function processFailed(queryEventArgs) {
+ alert('查询失败!');
+ }
+ that.promise = promise;
+ },
+ promise: '',
+ closesSQL: function () {
+ var that = this
+ , viewer = this.map;
+ viewer.entities.removeAll();
+ Cesium.when(that.promise, function (layer) {
+ for (var i = 0; i < layer.length; i++) {
+ that.map.scene.layers.remove(layer[i].name)
+ }
+ })
+ },
+ 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/SQLQuery/css/style.css b/widgets/SQLQuery/css/style.css
new file mode 100644
index 0000000..fa1d3e2
--- /dev/null
+++ b/widgets/SQLQuery/css/style.css
@@ -0,0 +1,27 @@
+.jimu-widget-SQLQuery {
+ position: fixed !important;
+ top: 72px !important;
+ right: 388px !important;
+ width: 200px !important;
+ height: 120px !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: 25px 5px 0 5px !important;
+}
+
+.jimu-widget-SQLQuery .closeOUR {
+ position: absolute;
+ right: 5px;
+ top: 5px;
+ font-size: 18px;
+ cursor: pointer;
+}
+
+.jimu-widget-SQLQuery .closeOUR:hover {
+ color: red;
+}
\ No newline at end of file
diff --git a/widgets/SQLQuery/manifest.json b/widgets/SQLQuery/manifest.json
new file mode 100644
index 0000000..f8d3da4
--- /dev/null
+++ b/widgets/SQLQuery/manifest.json
@@ -0,0 +1,17 @@
+{
+ "name": "SQLQuery",
+ "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/SQLQuery/nls/es/strings.js b/widgets/SQLQuery/nls/es/strings.js
new file mode 100644
index 0000000..b321c00
--- /dev/null
+++ b/widgets/SQLQuery/nls/es/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "SQLQuery"
+ })
+);
\ No newline at end of file
diff --git a/widgets/SQLQuery/nls/strings.js b/widgets/SQLQuery/nls/strings.js
new file mode 100644
index 0000000..481a53e
--- /dev/null
+++ b/widgets/SQLQuery/nls/strings.js
@@ -0,0 +1,7 @@
+define({
+ root: ({
+ _widgetLabel: "SQLQuery"
+ }),
+ "es": 1,
+ "zh-cn": 1
+});
\ No newline at end of file
diff --git a/widgets/SQLQuery/nls/zh-cn/strings.js b/widgets/SQLQuery/nls/zh-cn/strings.js
new file mode 100644
index 0000000..a9ade2f
--- /dev/null
+++ b/widgets/SQLQuery/nls/zh-cn/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "SQL查询"
+ })
+);
\ No newline at end of file
diff --git a/widgets/null/Widget.html b/widgets/null/Widget.html
new file mode 100644
index 0000000..0b2bdc2
--- /dev/null
+++ b/widgets/null/Widget.html
@@ -0,0 +1,6 @@
+<div>
+ null空项目模板
+ <i class="layui-icon closeOUR">
+ ဆ
+ </i></span>
+</div>
\ No newline at end of file
diff --git a/widgets/null/Widget.js b/widgets/null/Widget.js
new file mode 100644
index 0000000..96a894c
--- /dev/null
+++ b/widgets/null/Widget.js
@@ -0,0 +1,66 @@
+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-null',
+ name: 'null',
+ flag: false,
+ startup: function () {
+ var that = this;
+ topic.subscribe("beginNull", lang.hitch(this, this.beginNull));
+ topic.subscribe("closesNull", lang.hitch(this, this.closesNull));
+ // topic.publish('getbeginSlope', that.beginSlope);
+ $(`.${that.baseClass}`).find('.closeOUR').click(() => {
+ $(`.${that.baseClass}`).hide();
+ that.closesNull();
+ })
+
+ },
+ beginNull: function () {
+
+ },
+ closesNull: function () {
+
+ },
+ 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/null/css/style.css b/widgets/null/css/style.css
new file mode 100644
index 0000000..c1a5ab4
--- /dev/null
+++ b/widgets/null/css/style.css
@@ -0,0 +1,26 @@
+.jimu-widget-null {
+ 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-null .closeOUR {
+ /* position: relative;
+ left: 3px;
+ font-size: 18px; */
+ cursor: pointer;
+}
+
+.jimu-widget-null .closeOUR:hover {
+ color: red;
+}
\ No newline at end of file
diff --git a/widgets/null/manifest.json b/widgets/null/manifest.json
new file mode 100644
index 0000000..c8c69b1
--- /dev/null
+++ b/widgets/null/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/null/nls/es/strings.js b/widgets/null/nls/es/strings.js
new file mode 100644
index 0000000..ee6b4af
--- /dev/null
+++ b/widgets/null/nls/es/strings.js
@@ -0,0 +1,5 @@
+define(
+ ({
+ _widgetLabel: "slope"
+ })
+);
\ No newline at end of file
diff --git a/widgets/null/nls/strings.js b/widgets/null/nls/strings.js
new file mode 100644
index 0000000..960fde1
--- /dev/null
+++ b/widgets/null/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/null/nls/zh-cn/strings.js b/widgets/null/nls/zh-cn/strings.js
new file mode 100644
index 0000000..14c642a
--- /dev/null
+++ b/widgets/null/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 779b71f..c1da02e 100644
--- a/widgets/searchL/Widget.js
+++ b/widgets/searchL/Widget.js
@@ -234,63 +234,72 @@
var pickedObjects = this.map.scene.drillPick(data.position) || 0;
// console.log(pickedObjects);
if (pickedObjects.length != 0) {
- var data = pickedObjects[0].primitive.id.onceData[1];
+ if (pickedObjects[0].primitive.id != undefined) {
+ if (pickedObjects[0].primitive.id.onceData != undefined) {//搜索图标点击事件
+ // console.log('onceData')
+ var data = pickedObjects[0].primitive.id.onceData[1];
- if (pickedObjects[0].primitive.id.onceData[0] == 1) {//全景
- var address = data.panAddress;
- var dom = $('.jimu-widget-searchTabaPopup').find('.header'),
- str = `${data.name}--全景`;
- dom.empty();
- dom.append(str);
- // console.log(data)
+ if (pickedObjects[0].primitive.id.onceData[0] == 1) {//全景
+ var address = data.panAddress;
+ var dom = $('.jimu-widget-searchTabaPopup').find('.header'),
+ str = `${data.name}--全景`;
+ dom.empty();
+ dom.append(str);
+ // console.log(data)
- dom = $('#poput-m-t-quanjing');
- str = `<iframe id="poput-m-t-quanjing-iframe" src="${address}" frameborder="0"></iframe>`;
- dom.empty();
- dom.append(str);
- $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
- $('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
- }
- if (pickedObjects[0].primitive.id.onceData[0] == 2) {//监控
- var dom = $('.jimu-widget-searchTabaPopup').find('.header'),
- str = `${data.name}--实时视频`;
- dom.empty();
- dom.append(str);
- // console.log(data)
- if (data.flv) {
- dom = $('#poput-m-t-video');
- str = `
- <video id="poput-m-t-video-video" ></video>
- `;
- dom.empty();
- dom.append(str);
- if (flvjs.isSupported()) {
- var videoElement = document.getElementById('poput-m-t-video-video');
- var flvPlayer = flvjs.createPlayer({
- type: 'flv',
- url: data.flv
- });
- flvPlayer.attachMediaElement(videoElement);
- flvPlayer.load();
- flvPlayer.play();
+ dom = $('#poput-m-t-quanjing');
+ str = `<iframe id="poput-m-t-quanjing-iframe" src="${address}" frameborder="0"></iframe>`;
+ dom.empty();
+ dom.append(str);
+ $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
+ $('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
}
- window.$myVideoFlvplayer = flvPlayer;
- // var time = setTimeout(() => {
+ if (pickedObjects[0].primitive.id.onceData[0] == 2) {//监控
+ var dom = $('.jimu-widget-searchTabaPopup').find('.header'),
+ str = `${data.name}--实时视频`;
+ dom.empty();
+ dom.append(str);
+ // console.log(data)
+ if (data.flv) {
+ dom = $('#poput-m-t-video');
+ str = `
+ <video id="poput-m-t-video-video" ></video>
+ `;
+ dom.empty();
+ dom.append(str);
+ if (flvjs.isSupported()) {
+ var videoElement = document.getElementById('poput-m-t-video-video');
+ var flvPlayer = flvjs.createPlayer({
+ type: 'flv',
+ url: data.flv
+ });
+ flvPlayer.attachMediaElement(videoElement);
+ flvPlayer.load();
+ flvPlayer.play();
+ }
+ window.$myVideoFlvplayer = flvPlayer;
+ // var time = setTimeout(() => {
- // }, 2000);
- } else {
- var dom = $('#poput-m-t-video'),
- str = `
- <div id="poput-m-t-video-none" >·暂无视频</div>
- `;
- dom.empty();
- dom.append(str);
+ // }, 2000);
+ } else {
+ var dom = $('#poput-m-t-video'),
+ str = `
+ <div id="poput-m-t-video-none" >·暂无视频</div>
+ `;
+ dom.empty();
+ dom.append(str);
+ }
+ $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
+ $('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
+ }
+ if (pickedObjects[0].primitive.id.onceData[0] == 3) {//监测
+ console.log('监测', data)
+ }
+
+
+ } else if (pickedObjects[0].primitive.id.SQLData != undefined) {//SQL查询图标点击事件
+ // console.log('SQLData')
}
- $('.jimu-widget-searchTabaPopup').css({ 'display': 'block' });
- $('.jimu-widget-searchTabaPopup').find('.p-main').eq(0).css({ 'display': 'block' }).siblings().css({ 'display': 'none' });
- }
- if (pickedObjects[0].primitive.id.onceData[0] == 3) {//监测
- console.log('监测', data)
}
}
},
diff --git a/widgets/slope/Widget.html b/widgets/slope/Widget.html
index 8d65660..66d0474 100644
--- a/widgets/slope/Widget.html
+++ b/widgets/slope/Widget.html
@@ -10,9 +10,9 @@
<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="number" id="widemin" min="0" max="9000" 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;">
+ <input type="number" id="widemax" min="0" max="90000" value="10000" style="width: 30px;">
<label>3、显示样式:</label>
<label><input type="radio" id="showcolor" name="fill">显示填充颜色</label>
<label><input type="radio" id="showarrow" name="fill">显示坡向箭头</label>
diff --git a/widgets/slope/Widget.js b/widgets/slope/Widget.js
index a5f81a5..90c394f 100644
--- a/widgets/slope/Widget.js
+++ b/widgets/slope/Widget.js
@@ -41,15 +41,18 @@
// roll: 6.2831853016686185
// }
// });
+ viewer.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
+ url: 'http://www.supermapol.com/realspace/services/3D-ZF_normal/rest/realspace/datas/image'
+ }));
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(8000, new Cesium.Color(255 / 255, 0 / 255, 0 / 255));
+ colorTable.insert(5000, new Cesium.Color(221 / 255, 224 / 255, 7 / 255));
+ colorTable.insert(3000, new Cesium.Color(20 / 255, 187 / 255, 18 / 255));
+ colorTable.insert(2000, 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;
diff --git a/widgets/spatialAnalysis/Widget.html b/widgets/spatialAnalysis/Widget.html
index b4c3336..7a52704 100644
--- a/widgets/spatialAnalysis/Widget.html
+++ b/widgets/spatialAnalysis/Widget.html
@@ -5,8 +5,8 @@
ဆ
</i>
</div>
- <div class="main">
- <ul id="spatialAnalysis-main">
+ <div class="main" id="spatialAnalysis-mains">
+ <ul >11
<!-- <li class="visibleArea-tool"><i><img src="../../images/addL/ksy.png" alt=""></i> <span>可视分析</span></li> -->
<!-- <li class="visibleArea-tool"><i></i> <span>可视分析</span></li>
<li class="profileAnalysis-tool"><i></i> <span>剖面分析</span></li>
diff --git a/widgets/spatialAnalysis/Widget.js b/widgets/spatialAnalysis/Widget.js
index 98e0e0b..0f285c1 100644
--- a/widgets/spatialAnalysis/Widget.js
+++ b/widgets/spatialAnalysis/Widget.js
@@ -40,19 +40,91 @@
name: '剖面分析',
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: 'slope-tool',
// img: './images/addL/pdpx.png'
// }
+ , {//SQL查询,//做好
+ name: 'SQL查询',
+ classs: 'SQLQuery-tool',
+ img: './images/addL/pdpx.png'
+ }
];
- var dom = $('#spatialAnalysis-main');
- var str = '';
+ that.beginSpatialAnalysis(domHtmls);
+
+ $('.ccsliu').click(() => {//测试开关 点击图例其他的图片
+ var domHtmls = [
+ {
+ name: '可视分析',
+ classs: 'visibleArea-tool',
+ img: './images/addL/ksy.png'
+ }, {
+ name: '剖面分析',
+ classs: 'profileAnalysis-tool',
+ img: './images/addL/剖面分析.png'
+ }
+ , {//https://blog.csdn.net/supermapsupport/article/details/100134590
+ //需要iServer发布成三维服务
+ name: '坡度分析',
+ classs: 'slope-tool',
+ img: './images/addL/pdpx.png'
+ }
+ , {//做好静态,
+ name: '建造实体',
+ classs: 'modelDiagram-tool',
+ img: './images/addL/pdpx.png'
+ }
+ , {//SQL查询,//做好
+ name: 'SQL查询',
+ classs: 'SQLQuery-tool',
+ img: './images/addL/pdpx.png'
+ },
+ {//建造模型
+ name: '建造模型',
+ classs: 'modesssssllll',
+ img: './images/addL/pdpx.png'
+ }
+ ,
+ {//清除模型
+ name: '清除模型',
+ classs: 'modesssss2222',
+ img: './images/addL/pdpx.png'
+ }
+ ];
+ that.beginSpatialAnalysis(domHtmls);
+ var promise = false;
+ $('.modesssssllll').click(() => {
+ var URL_CONFIG = {
+ SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace',
+ }
+ promise = this.map.scene.open(URL_CONFIG.SCENE_CBD);
+ })
+ $('.modesssss2222').click(() => {
+ if (promise) {
+ Cesium.when(promise, function (layer) {
+ for (var i = 0; i < layer.length; i++) {
+ that.map.scene.layers.remove(layer[i].name)
+ }
+ })
+ }
+ })
+ })
+
+ },
+ beginSpatialAnalysis: function (domHtmls) {
+ var that = this;
+ var domHtmls = domHtmls;
+ var dom = $('#spatialAnalysis-mains');
+ dom.empty();
+ var str = '<ul>';
for (var k in domHtmls) {
str += `<li class="${domHtmls[k].classs}">
<i class="imgs">
@@ -61,109 +133,31 @@
<span>${domHtmls[k].name}</span>
</li>`
}
- dom.replaceWith(str);
+ str += '</ul>';
+ dom.append(str);
+ // console.log(dom, str)
+ // dom.replaceWith(str);
$('.closesspatialAnalysis').click(() => {
that.closeOnceUse();
$('.jimu-widget-spatialAnalysis').hide();
- // // 关闭可视
- // topic.publish('closev', '');
- // // 关闭剖面
- // topic.publish('closep', '');
- // // 关闭坡度
- // topic.publish('closes', '');
- // $(".jimu-widget-visibleArea").hide();
- // $(".jimu-widget-profileAnalysis").hide();
- // $(".jimu-widget-slope").hide();
- })
+ })
// 可视分析
$('.visibleArea-tool').click(function () {
that.closeOnceUse();
- // that.map.scene.globe.depthTestAgainstTerrain = true;
- // // 关闭量算
- // 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();
- // // 关闭可视
- // // topic.publish('closev', '');
- // // 关闭剖面
- // topic.publish('closep', '');
- // // 关闭坡度
- // topic.publish('closes', '');
- // $(".jimu-widget-profileAnalysis").hide();
- // $(".jimu-widget-slope").hide();
- // $('.tool-y-box').stop().hide();
- // //关闭飞行
- // $('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
- // topic.publish('closeFly', 'closeFly');
$(".jimu-widget-visibleArea").show();
})
// 剖面分析
$('.profileAnalysis-tool').click(function () {
that.closeOnceUse();
- // that.map.scene.globe.depthTestAgainstTerrain = true;
- // // 关闭量算
- // 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();
- // // 关闭可视
- // topic.publish('closev', '');
- // // 关闭剖面
- // // topic.publish('closep', '');
- // // 关闭坡度
- // topic.publish('closes', '');
- // $(".jimu-widget-visibleArea").hide();
- // $(".jimu-widget-slope").hide();
- // $('.tool-y-box').stop().hide();
- // //关闭飞行
- // $('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
- // topic.publish('closeFly', 'closeFly');
$(".jimu-widget-profileAnalysis").show();
})
//坡度分析
$('.slope-tool').click(function () {
that.closeOnceUse();
- // that.map.scene.globe.depthTestAgainstTerrain = true;
- // // 关闭量算
- // 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();
- // // 关闭可视
- // topic.publish('closev', '');
- // // 关闭剖面
- // topic.publish('closep', '');
- // // 关闭坡度
- // // topic.publish('closes', '');
- // $(".jimu-widget-visibleArea").hide();
- // $(".jimu-widget-profileAnalysis").hide();
- // $('.tool-y-box').stop().hide();
- // //关闭飞行
- // $('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
- // topic.publish('closeFly', 'closeFly');
$(".jimu-widget-slope").show();
topic.publish('getbeginSlope', this.beginSlope);
@@ -171,38 +165,17 @@
//模型
$('.modelDiagram-tool').click(function () {
that.closeOnceUse();
- // that.map.scene.globe.depthTestAgainstTerrain = true;
- // // 关闭量算
- // 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();
- // // 关闭可视
- // topic.publish('closev', '');
- // // 关闭剖面
- // topic.publish('closep', '');
- // // 关闭坡度
- // // topic.publish('closes', '');
- // $(".jimu-widget-visibleArea").hide();
- // $(".jimu-widget-profileAnalysis").hide();
- // $('.tool-y-box').stop().hide();
- // $(".jimu-widget-slope").hide();
- // //关闭飞行
- // $('.jimu-widget-visualAngle').find('.v-a-Two').removeClass('on');//清楚样式
- // topic.publish('closeFly', 'closeFly');
-
$('.jimu-widget-modelDiagram').show();
- // topic.publish('getbeginSlope', this.beginSlope);
+ })
+ //sql查询
+ $('.SQLQuery-tool').click(function () {
+ that.closeOnceUse();
+ $(".jimu-widget-SQLQuery").show();
+ topic.publish('beginSQL', this.beginSQL);
+
})
},
-
closeToolBox: function (item) {
if (item != this.name) {
$('.tool-y-box').hide();
@@ -238,6 +211,10 @@
//清除实体
this.map.entities.removeAll();
$(".jimu-widget-modelDiagram").hide();
+ //清除SQL查询
+ $(".jimu-widget-SQLQuery").hide();
+ topic.publish('closesSQL', 'closesSQL');
+
},
onOpen: function () {
//面板打开的时候触发 (when open this panel trigger)
diff --git a/widgets/visibleArea/Widget.js b/widgets/visibleArea/Widget.js
index 5d51872..b49d923 100644
--- a/widgets/visibleArea/Widget.js
+++ b/widgets/visibleArea/Widget.js
@@ -45,6 +45,10 @@
color: new Cesium.Color(1.0, 1.0, 1.0, 1),
intensity: 0.55
};
+ // var URL_CONFIG = {
+ // SCENE_CBD: 'http://www.supermapol.com/realspace/services/3D-CBDCache20200416/rest/realspace',
+ // }
+ // var promise = scene.open(URL_CONFIG.SCENE_CBD);
directionalLight_1 = new Cesium.DirectionalLight(position1, dirLightOptions);//加载光源
scene.addLightSource(directionalLight_1);
var viewPosition;
@@ -272,7 +276,7 @@
viewModel.horizontalFov = viewshed3D.horizontalFov;
viewModel.verticalFov = viewshed3D.verticalFov;
} else {
- console.log('没打开');
+ // console.log('没打开');
}
}, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
--
Gitblit v1.9.3