Merge branch 'dev' of http://62.234.3.186:3000/sxyanzhu/jhbigscreen into dev
commit
5ea5ce7940
|
@ -20,6 +20,7 @@
|
||||||
<script src="/cesium/Cesium.js?v=20230913"></script>
|
<script src="/cesium/Cesium.js?v=20230913"></script>
|
||||||
<script src="/cesium/BIMGISEngine.js?v=20230920"></script>
|
<script src="/cesium/BIMGISEngine.js?v=20230920"></script>
|
||||||
<script src="/cesium/initApi.js?v=20230920"></script>
|
<script src="/cesium/initApi.js?v=20230920"></script>
|
||||||
|
<!--<script src="./maps/initApi.js"></script> -->
|
||||||
<script src="./js/mapmodle.js"></script>
|
<script src="./js/mapmodle.js"></script>
|
||||||
<!-- <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=6zAD8CIavtzWnkGg0a7roush5maGMIPn"></script> -->
|
<!-- <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=6zAD8CIavtzWnkGg0a7roush5maGMIPn"></script> -->
|
||||||
<script src="https://cdn.makalu.cc/js/echarts/china.js"></script>
|
<script src="https://cdn.makalu.cc/js/echarts/china.js"></script>
|
||||||
|
|
|
@ -10,7 +10,7 @@ window.mapDefault={
|
||||||
"imageryprovider": "tianditu_image",
|
"imageryprovider": "tianditu_image",
|
||||||
"terrainProvider": "http://106.12.253.67:9304/",
|
"terrainProvider": "http://106.12.253.67:9304/",
|
||||||
"mapworldkey": "6215132e0336a3db28ce73f8c9ff6db6",
|
"mapworldkey": "6215132e0336a3db28ce73f8c9ff6db6",
|
||||||
"openearth": false,
|
"openearth": true,
|
||||||
"maxspaceerror": 2000,
|
"maxspaceerror": 2000,
|
||||||
"loading": false,
|
"loading": false,
|
||||||
"bgcolor": "#87CEFA",
|
"bgcolor": "#87CEFA",
|
||||||
|
|
|
@ -188,7 +188,8 @@ export default {
|
||||||
return it;
|
return it;
|
||||||
})]
|
})]
|
||||||
}
|
}
|
||||||
this.deptChange((()=>{}));
|
this.setScreenLiSel1(this.localStorage1);
|
||||||
|
this.deptChange();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.$root.isTypeBuser = this.isTypeBuser;
|
this.$root.isTypeBuser = this.isTypeBuser;
|
||||||
|
@ -343,11 +344,15 @@ export default {
|
||||||
this.data = [{ id: 0, text: '所有项目' }, ...objs];
|
this.data = [{ id: 0, text: '所有项目' }, ...objs];
|
||||||
this.$bus.$emit("loadProjects", this.data);
|
this.$bus.$emit("loadProjects", this.data);
|
||||||
this.$root.projects = this.data;
|
this.$root.projects = this.data;
|
||||||
|
if(this.data.find(it=>it.id==this.localStorage2.id)){
|
||||||
|
this.setScreenLiSel2(this.localStorage2)
|
||||||
|
}else{
|
||||||
if (this.data.length > 0) {
|
if (this.data.length > 0) {
|
||||||
this.setScreenLiSel2(this.data[0], init);
|
this.setScreenLiSel2(this.data[0], init);
|
||||||
} else {
|
} else {
|
||||||
this.setScreenLiSel2(null);
|
this.setScreenLiSel2(null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(cb){
|
if(cb){
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div style="height: 100%;">
|
<div style="height: 100%;position: relative;">
|
||||||
<div style="height: 100%;" v-loading="loading">
|
<div style="height: 100%;" v-loading="loading">
|
||||||
<div id="cesiumContainer" style="height: 100%;"></div>
|
<div id="cesiumContainer" style="height: 100%;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="toolbar" style="position: absolute;z-index: 100;bottom: 30px;right:12px;">
|
||||||
|
<el-switch @change="toggleGis"
|
||||||
|
v-model="showGis" active-text="GIS">
|
||||||
|
</el-switch>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { setToken } from '@/utils/auth';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JhbigscreenMapModle',
|
name: 'JhbigscreenMapModle',
|
||||||
|
@ -14,6 +21,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
showGis:true,
|
||||||
images: [],
|
images: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
mapInfo: null,
|
mapInfo: null,
|
||||||
|
@ -26,20 +34,28 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
toggleGis(){
|
||||||
|
window.mapApi.Public.setGisState(this.showGis);
|
||||||
|
},
|
||||||
initMe() {
|
initMe() {
|
||||||
this.project = this.$root.project||{};
|
this.project = this.$root.project||{};
|
||||||
this.reloadMap();
|
this.reloadMap();
|
||||||
},
|
},
|
||||||
reloadMap() {
|
reloadMap() {
|
||||||
this.mapInfo = {
|
this.mapInfo = {
|
||||||
root: "http://szgc.jhncidg.com:808/mapmodel/Tools/output/model/202308292207450987/root.glt",
|
root: "http://szgc.jhncidg.com:808/mapmodel/tools/output/model/202310241728566044/root.glt",
|
||||||
modelId: '3a0d53cc-ad56-688c-e38d-f907088c2882'
|
modelId: '3a0e7366-ad7b-3dc3-1d86-2331fc1e8578',
|
||||||
|
view:{"heading":4.8798740228358,"pitch":-0.22637630756730465,"position":[1.9366836920898733,0.5884137486301345,31809.670937187617],"headingDegrees":279.59618606401807,"pitchDegrees":-12.970407005361997,"positionWC":{"x":-1909610.0164615875,"y":4984113.66041506,"z":3537723.8441370176}}
|
||||||
};
|
};
|
||||||
this.showMap = true;
|
this.showMap = true;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
setTimeout(this.initMap, 200);
|
setTimeout(this.initMap, 200);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
setView(){
|
||||||
|
let v=this.mapInfo.view;
|
||||||
|
window.mapApi.Camera.setViewPort(v.position,v.heading,v.pitch);
|
||||||
|
},
|
||||||
initMap() {
|
initMap() {
|
||||||
const func = () => {
|
const func = () => {
|
||||||
if (!document.getElementById("cesiumContainer")) {
|
if (!document.getElementById("cesiumContainer")) {
|
||||||
|
@ -51,19 +67,37 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
let v=this.mapInfo.view;
|
||||||
window.initMap();
|
window.initMap();
|
||||||
window.mapApi.Model.add(
|
let time=+new Date();
|
||||||
|
console.log('%c开始加载模型','color:green')
|
||||||
|
window.mapApi.Model.AddModel(
|
||||||
this.mapInfo.root,
|
this.mapInfo.root,
|
||||||
this.mapInfo.modelId,
|
this.mapInfo.modelId,
|
||||||
null,
|
null,
|
||||||
(data) => {
|
(data) => {
|
||||||
|
window.mapApi.Public.setGisState(true);
|
||||||
|
let ts=(+new Date() - time)/1000;
|
||||||
|
console.log('%c模型加载完成,用时'+ts+'s','color:green')
|
||||||
|
setTimeout(()=>{
|
||||||
|
let v=this.mapInfo.view;
|
||||||
|
window.mapApi.Camera.setViewPort(v.position,v.heading,v.pitch);
|
||||||
|
},400);
|
||||||
|
/*
|
||||||
if (Cesium.defined(data)) {
|
if (Cesium.defined(data)) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
|
||||||
|
},3000)
|
||||||
if (Cesium.defined(data.obj) && data.obj instanceof Cesium.Cesium3DTileset) {
|
if (Cesium.defined(data.obj) && data.obj instanceof Cesium.Cesium3DTileset) {
|
||||||
|
setTimeout(()=>{
|
||||||
|
let v=this.mapInfo.view;
|
||||||
|
window.mapApi.Camera.setViewPort(v.position,v.heading,v.pitch);
|
||||||
|
},3000);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
},
|
|
||||||
(data) => {
|
|
||||||
$("#box,#LoadingShadow").hide()
|
$("#box,#LoadingShadow").hide()
|
||||||
|
},
|
||||||
|
{
|
||||||
});
|
});
|
||||||
window.mapApi.Public.Event("LEFT_CLICK", function (click) {
|
window.mapApi.Public.Event("LEFT_CLICK", function (click) {
|
||||||
window.mapApi.Feature.GetFeatureByEvent(click.position, function (json) {
|
window.mapApi.Feature.GetFeatureByEvent(click.position, function (json) {
|
||||||
|
@ -84,9 +118,13 @@ export default {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.cesium-viewer-toolbar{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#cesium-plugin-cube_cesiumContainer {
|
#cesium-plugin-cube_cesiumContainer {
|
||||||
transform: scale(0.6);
|
transform: scale(0.6);
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -30,8 +30,8 @@ module.exports = defineConfig({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'/jhapi':{
|
'/jhapi':{
|
||||||
//target: `http://62.234.3.186/jhapi/`,
|
target: `http://62.234.3.186/jhapi/`,
|
||||||
target: `http://127.0.0.1:8090/jhapi/`,
|
//target: `http://127.0.0.1:8090/jhapi/`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
'^/jhapi':'/'
|
'^/jhapi':'/'
|
||||||
|
|
Loading…
Reference in New Issue