Skip to content

Commit 62abb02

Browse files
author
潘卓然ParnDeedlit
committed
【站点】【修复】【修复Openlayer-API的冲突】
2 parents cbec1bd + 3861bc2 commit 62abb02

File tree

15 files changed

+239
-51
lines changed

15 files changed

+239
-51
lines changed

src/cesiumjs/ui/query/G3DDocQuery.js

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CesiumZondy } from '../../core/Base';
2-
import axios from 'axios';
2+
import {IgsServiceBase} from "../../../service/baseserver";
33

44
/**
55
* @author IGServer-邬俊惠
@@ -167,22 +167,29 @@ export class G3DDocQuery {
167167
var postData = null;
168168
if (type && type.toLowerCase() === 'post') {
169169
postData = querystring;
170-
axios.post(url, postData)
171-
.then(res => {
172-
successCallback && successCallback(res.data, res, o.layerIndex);
173-
})
174-
.catch(error=>{
175-
errorCallback && errorCallback(error);
176-
});
170+
let service = new IgsServiceBase(url, {
171+
eventListeners: {
172+
scope: o,
173+
processCompleted: successCallback,
174+
processFailed: errorCallback
175+
}
176+
});
177+
service.processAsync({
178+
method: "POST",
179+
data: postData
180+
});
177181
} else {
178182
url = url + "?" + querystring;
179-
axios.get(url)
180-
.then(res => {
181-
successCallback && successCallback(res.data, res, o.layerIndex);
182-
})
183-
.catch(error=>{
184-
errorCallback && errorCallback(error);
185-
});
183+
let service = new IgsServiceBase(url, {
184+
eventListeners: {
185+
scope: o,
186+
processCompleted: successCallback,
187+
processFailed: errorCallback
188+
}
189+
});
190+
service.processAsync({
191+
method: "GET"
192+
});
186193
}
187194
}
188195
}

src/cesiumjs/ui/query/MapDocQuery.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CesiumZondy } from '../../core/Base';
2-
import axios from 'axios';
2+
import {IgsServiceBase} from "../../../service/baseserver";
33

44
/**
55
* @author 技术支持-何振涛
@@ -165,13 +165,14 @@ export class MapDocQuery {
165165
queryString += '&rule=' + o.rule;
166166
let url = 'http://' + o.ip + ':' + o.port + '/igs/rest/mrfs/docs/' + o.docName + '/' + o.mapIndex + '/' + o.layerID + '/' + queryString;
167167

168-
axios.get(url)
169-
.then(res => {
170-
successCallback && successCallback(res.data, res, o);
171-
})
172-
.catch(error=>{
173-
errorCallback && errorCallback(error);
174-
});
168+
let service = new IgsServiceBase(url, {
169+
eventListeners: {
170+
scope: o,
171+
processCompleted: successCallback,
172+
processFailed: errorCallback
173+
}
174+
});
175+
service.processAsync();
175176
}
176177
}
177178

-210 KB
Loading

website/public/static/demo/cesium/example/clientView/clientView-fire.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
});
6262

6363
//视点跳转(经度,纬度,视角高度,方位角,俯仰角,翻滚角)
64-
sceneManager.flyToEx(114.39969287363587, 30.46955973483767, {
65-
height: 139,
64+
sceneManager.flyToEx(114.397769287363587, 30.4720973483767, {
65+
height: 260,
6666
heading: 140,
6767
pitch: -20,
6868
roll: 0

website/public/static/demo/cesium/example/drawGraphic/drawGraphic-line.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646

4747
//视点跳转(经度,纬度,视角高度,方位角,俯仰角,翻滚角)
4848
sceneManager.flyToEx(114.40031449725147, 30.502857738644277, {
49-
height: 80,
49+
height:260,
5050
heading: -17,
51-
pitch: -15,
51+
pitch: -25,
5252
roll: 0
5353
});
5454

website/public/static/demo/cesium/example/drawGraphic/drawGraphic-polygon.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646

4747
//视点跳转(经度,纬度,视角高度,方位角,俯仰角,翻滚角)
4848
sceneManager.flyToEx(114.40172155802372, 30.5040187748838, {
49-
height: 125,
49+
height: 260,
5050
heading: -46,
51-
pitch: -18,
51+
pitch: -30,
5252
roll: 0
5353
});
5454

website/public/static/demo/cesium/example/track/track-flow.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@
8585
);
8686
//视点跳转(经度,纬度,视角高度,方位角,俯仰角,翻滚角)
8787
sceneManager.flyToEx(114.39362878111456, 30.50652200986956, {
88-
height: 180,
88+
height: 280,
8989
heading: -1,
90-
pitch: -44,
90+
pitch: -60,
9191
roll: 0
9292
});
9393

website/public/static/demo/config/config-headers.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
{
1414
"title": "插件",
1515
"icon": "iconchajian",
16-
"links": [["插件列表", "详细图表", "插件标签", "提交bug", "其他"]],
16+
"links": [["插件列表", "详细图表", "插件标签", "提交bug"]],
1717
"hightlights": [[false, false, false, false, false]],
18-
"routes": [["/total/plugins", "/total/detailChart", "/total/pluginTags", "/total/bugCommit", "/total/other"]]
18+
"routes": [["/total/plugins", "/total/detailChart", "/total/pluginTags", "/total/bugCommit"]]
1919
},
2020
{
2121
"title": "协议",
@@ -497,8 +497,7 @@
497497
"./docs/openlayers/module-%25E8%25A6%2581%25E7%25B4%25A0%25E6%259C%258D%25E5%258A%25A1.html",
498498
"./docs/openlayers/module-%25E5%2587%25A0%25E4%25BD%2595%25E5%2588%2586%25E6%259E%2590%25E6%259C%258D%25E5%258A%25A1.html",
499499
"./docs/openlayers/module-%25E4%25B8%2593%25E9%25A2%2598%25E5%259B%25BE%25E6%259C%258D%25E5%258A%25A1.html",
500-
"./docs/openlayers/module-%25E5%2588%2586%25E6%259E%2590%25E6%259C%258D%25E5%258A%25A1.html",
501-
"./docs/openlayers/module-%25E5%25AE%25A2%25E6%2588%25B7%25E7%25AB%25AF%25E5%258F%25AF%25E8%25A7%2586%25E5%258C%2596.html"
500+
"./docs/openlayers/module-%25E5%2588%2586%25E6%259E%2590%25E6%259C%258D%25E5%258A%25A1.html"
502501
],
503502
["https://openlayers.org/en/latest/apidoc/"]
504503
]

website/public/static/demo/config/config-vue-cesium.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@
262262
"detail": "",
263263
"icon": "viewshed.png",
264264
"update": "最后更新时间:2021-06-07"
265+
},
266+
{
267+
"name": "洪水淹没分析",
268+
"file": "flood",
269+
"diffcult": "2",
270+
"detail": "",
271+
"icon": "flood.png",
272+
"update": "最后更新时间:2021-06-07"
265273
}
266274
]
267275
}
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
7+
<title>Vue-洪水淹没</title>
8+
<script include="vue,antd" exclude="plugin,cesium" src="./static/libs/include-cesium-local.js"></script>
9+
<style type="text/css">
10+
#app {
11+
height: 100vh;
12+
width: 100vw;
13+
}
14+
</style>
15+
</head>
16+
17+
<body>
18+
<div id="app">
19+
<mapgis-web-scene
20+
libPath="cesium/Cesium.js"
21+
pluginPath="cesium/webclient-cesium-plugin.min.js"
22+
v-on:load="handleLoad"
23+
>
24+
<mapgis-3d-ogc-wmts-layer
25+
:base-url="urlT"
26+
:wmts-layer="layer"
27+
:tile-matrix-set="tileMatrixSetID"
28+
:format="format"
29+
:tiling-scheme="srs"
30+
:token="token"
31+
></mapgis-3d-ogc-wmts-layer>
32+
<mapgis-3d-terrain-provider :url="demUrl" :v-if="showDem"></mapgis-3d-terrain-provider>
33+
<mapgis-3d-flood-no-slot
34+
:start-height="startHeight"
35+
:min-height="minHeight"
36+
:current-height="currentHeight"
37+
:max-height="maxHeight"
38+
:flood-color="floodColor"
39+
:flood-speed="floodSpeed"
40+
:specular-intensity="specularIntensity"
41+
:amplitude="amplitude"
42+
:animation-speed="animationSpeed"
43+
:frequency="frequency"
44+
v-on:load="load"
45+
>
46+
</mapgis-3d-flood-no-slot>
47+
</mapgis-web-scene>
48+
</div>
49+
50+
<script>
51+
new Vue({
52+
el: "#app",
53+
data() {
54+
return {
55+
//地形url
56+
demUrl: undefined,
57+
showDem: false,
58+
//天地图参数
59+
urlT: "http://t0.tianditu.gov.cn/img_c/wmts",
60+
tileMatrixSetID: "c",
61+
srs: "EPSG:4326",
62+
layer: "img",
63+
format: "tiles",
64+
token: {
65+
key: "tk",
66+
value: "f5347cab4b28410a6e8ba5143e3d5a35"
67+
},
68+
//初始淹没高度,淹没总高度为currentHeight - startHeight - minHeight
69+
startHeight: 0,
70+
//初始淹没点
71+
minHeight: 2800,
72+
//当前淹没高度
73+
currentHeight: 0,
74+
//最大淹没高度
75+
maxHeight: 6000,
76+
//淹没颜色
77+
floodColor: "#4e81bb",
78+
//洪水上涨速度
79+
floodSpeed: 300,
80+
//洪水反射光线强度
81+
specularIntensity: 1,
82+
//洪水水波高度
83+
amplitude: 10,
84+
//洪水水纹速度
85+
animationSpeed: 0.01,
86+
//洪水水纹频率
87+
frequency: 1000,
88+
//洪水分析组件对象
89+
floodAnalyse: undefined
90+
};
91+
},
92+
methods: {
93+
handleLoad(e) {
94+
const { component, Cesium } = e;
95+
Cesium.Ion.defaultAccessToken =
96+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiM2Q0ZGMxYy1iZGZkLTQ4OWItODlhMy1iOWNkMDE0M2U3YWEiLCJpZCI6NTEzNSwiaWF0IjoxNjA2MjE0OTkyfQ.2aktNrUASlLsPwSFtkgKBTQLJTAnOTyjgKDRQmnafiE';
97+
const { webGlobe } = component;
98+
webGlobe.viewer.camera.setView({
99+
direction: { x: 0.4680575394156845, y: -0.8267033643312148, z: 0.31222377744109403 },
100+
position: { x: -674271.5790185562, y: 5530042.656916835, z: 3232882.3357299212 }
101+
});
102+
//构造视图功能管理对象(视图)
103+
var sceneManager = new CesiumZondy.Manager.SceneManager({
104+
viewer: webGlobe.viewer
105+
});
106+
//视点跳转(经度,纬度,视角高度,方位角,俯仰角,翻滚角)
107+
sceneManager.flyToEx(94.73761648879076, 29.44177452960854, {
108+
height: 5900,
109+
heading: 60,
110+
pitch: -16,
111+
roll: 0
112+
});
113+
114+
this.demUrl = new Cesium.IonResource.fromAssetId(1);
115+
this.showDem = true;
116+
117+
console.log('地图加初始化完毕!', webGlobe.viewer.camera);
118+
}
119+
}
120+
})
121+
</script>
122+
</body>
123+
124+
</html>

0 commit comments

Comments
 (0)