<template>
|
<div class="special" id="special">
|
<div class="specialTools">
|
<div class="specialTool" @click="tdglHandle">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="土地管理"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/ztfx/tdgl.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
<div class="specialTool" @click="stdsj">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="视图大数据平台"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/ztfx/dashuju.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
<div class="specialTool" @click="spjkHandle">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="视频监控"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/ztfx/spjk.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
<div class="specialTool" @click="jjHandle">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="街景"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/ztfx/jiejing.png" />
|
</el-button>
|
</el-tooltip>
|
</div>
|
|
<div class="specialTool" @click="qytj">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="数据汇聚"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button> <img src="@/assets/img/left/ztfx/yqfk.png" /> </el-button
|
></el-tooltip>
|
</div>
|
<div class="specialTool" @click="rangeQuery()">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="范围查询"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button> <img src="@/assets/img/left/ztfx/sjxq.png" /> </el-button
|
></el-tooltip>
|
</div>
|
<!-- <div class="specialTool" @click="guanxian(openGX)">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="地下管线"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button> <img src="@/assets/img/left/ztfx/spl.png" /> </el-button
|
></el-tooltip>
|
</div> -->
|
<!-- <div class="specialTool" @click="sceneRoaming">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="场景漫游"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button>
|
<img src="@/assets/img/left/ztfx/rkqxksh.png" /> </el-button
|
></el-tooltip>
|
</div> -->
|
|
<!-- <div class="specialTool" @click="shipinronghe(videoList)">
|
<el-tooltip
|
class="item"
|
effect="dark"
|
content="视频融合"
|
placement="top-start"
|
popper-class="item_tooltip"
|
>
|
<el-button> <img src="@/assets/img/left/ztfx/spl.png" /> </el-button
|
></el-tooltip>
|
</div> -->
|
</div>
|
</div>
|
</template>
|
|
<style scoped>
|
hr {
|
margin: 10px 0;
|
width: 111%;
|
margin-left: -15px;
|
}
|
|
.el-button:focus,
|
.el-button:hover {
|
background: transparent;
|
}
|
|
.special {
|
position: absolute;
|
left: 65px;
|
bottom: 6px;
|
height: 50px;
|
/* border-radius: 30px; */
|
box-shadow: 0px 0px 7px rgba(76, 165, 248, 0.8) inset;
|
background-color: rgba(14, 50, 143, 0.5);
|
width: 350px;
|
}
|
|
.specialTools {
|
margin-left: 20px;
|
}
|
|
.specialTool {
|
border: 1px solid #999;
|
border-radius: 5px;
|
float: left;
|
width: 40px;
|
height: 40px;
|
margin: 5px;
|
}
|
|
.specialTool img {
|
margin: 4px;
|
}
|
|
.specialTools::-webkit-scrollbar {
|
/*滚动条整体样式*/
|
width: 5px;
|
/*高宽分别对应横竖滚动条的尺寸*/
|
height: 8px;
|
scrollbar-arrow-color: red;
|
}
|
|
/* 滚动条 */
|
.specialTools::-webkit-scrollbar-thumb {
|
border-radius: 5px;
|
-webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
background: rgba(218, 218, 218, 0.5);
|
scrollbar-arrow-color: red;
|
}
|
|
/* 滚动槽 */
|
.specialTools::-webkit-scrollbar-track {
|
-webkit-box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
box-shadow: inset 0 0 5px rgba(218, 218, 218, 0.2);
|
border-radius: 0;
|
background: rgba(218, 218, 218, 0.1);
|
}
|
|
.specialTool:hover {
|
background: rgba(0, 168, 255, 0.16);
|
}
|
|
.tool-title {
|
margin: 1px 10px;
|
}
|
|
.tool-title label {
|
vertical-align: top;
|
}
|
|
.special label {
|
margin-left: 10px;
|
font-size: 17px;
|
font-family: Microsoft YaHei;
|
font-weight: 400;
|
/* color: #3d3d3d; */
|
color: white;
|
}
|
|
.el-button {
|
padding: 0 !important;
|
font-size: 24px;
|
border: unset;
|
float: unset;
|
display: block;
|
background: rgba(0, 0, 0, 0);
|
}
|
|
.el-button label {
|
font-size: 14px;
|
}
|
|
.closeTool {
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
}
|
|
.active {
|
background: rgba(0, 168, 255, 0.16);
|
}
|
</style>
|
<style>
|
#pointInfoBox {
|
/* width: 350px; */
|
padding: 20px;
|
text-align: left;
|
background-image: url("~@/assets/img/new/listbg.png");
|
/* border: 5px #08235f solid; */
|
/* border-radius: 7px; */
|
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.5);
|
color: #fff;
|
}
|
</style>
|
<script>
|
import axios from "axios";
|
import { mapState, mapMutations } from "vuex";
|
import Bus from "../../tools/Bus";
|
import { roman } from "../../../assets/json/index.js";
|
import URLInCode from "@/assets/js/urlInCode";
|
import keyName from "@/utils/poiKeys";
|
import LayerField from "../../../../static/NameConf";
|
let handler;
|
let tooltipHTML;
|
window.divPoint1 = null;
|
window.pickFeature = null;
|
window.imgUrl = null;
|
window.scale = null;
|
let buildingPolygon;
|
let tooltip;
|
let lineArr = [];
|
let video;
|
let promiseS3M;
|
//交通图层
|
let panoramaLayer;
|
export default {
|
name: "special",
|
data() {
|
return {
|
openGX: "open",
|
showPointInfo: true,
|
romanOption: [
|
{ name: "核心区" },
|
{ name: "景观绿地" },
|
{ name: "政务服务" },
|
],
|
showFlag: false,
|
showQYTJ: false,
|
videoList: [
|
{
|
name: "video2",
|
lon: 116.51507,
|
lat: 39.79686,
|
height: 40,
|
// 四周方向
|
heading: 305,
|
// 俯仰角度
|
pitch: -41,
|
// 水平角度
|
horizonAngle: 68,
|
// 垂直角度
|
verticalAngle: 103,
|
// 透明度
|
alpha: 1,
|
// 透明度
|
far: 3000,
|
cameraIndexCode: "2b046ef675704975a8d45f1b00cd946b",
|
},
|
// {
|
// name: "video3",
|
// lon: 116.5146339,
|
// lat: 39.7967196,
|
// height: 60,
|
// // 四周方向
|
// heading: 62,
|
// // 俯仰角度
|
// pitch: -43,
|
// // 水平角度
|
// horizonAngle: 45,
|
// // 垂直角度
|
// verticalAngle: 64,
|
// // 透明度
|
// alpha: 1,
|
// // 透明度
|
// far: 166,
|
// cameraIndexCode: "a0ffb1dedde7468187d0b0f91d431475",
|
// },
|
// {
|
// name: "video4",
|
// lon: 116.51496,
|
// lat: 39.796854,
|
// height: 60,
|
// // 四周方向
|
// heading: 148,
|
// // 俯仰角度
|
// pitch: -39,
|
// // 水平角度
|
// horizonAngle: 40,
|
// // 垂直角度
|
// verticalAngle: 58,
|
// // 透明度
|
// alpha: 1,
|
// // 透明度
|
// far: 219,
|
// cameraIndexCode: "e6ec9aaf9320455ab6c5ea224f3f5f38",
|
// },
|
// {
|
// name: "video1",
|
// lon: 116.51522,
|
// lat: 39.79724,
|
// height: 60,
|
// // 四周方向
|
// heading: 64,
|
// // 俯仰角度
|
// pitch: -47,
|
// // 水平角度
|
// horizonAngle: 30,
|
// // 垂直角度
|
// verticalAngle: 60,
|
// // 透明度
|
// alpha: 1,
|
// // 透明度
|
// far: 166,
|
// cameraIndexCode: "1523335e47a5476f9f65f90f9983e875",
|
// },
|
],
|
// 四周方向
|
heading: 64,
|
// 俯仰角度
|
pitch: -47,
|
// 水平角度
|
horizonAngle: 30,
|
// 垂直角度
|
verticalAngle: 60,
|
// 透明度
|
alpha: 1,
|
// 透明度
|
far: 166,
|
videoarrList: [],
|
};
|
},
|
computed: {
|
...mapState(["viewer1Show", "yqfk", "cesiumInit"]),
|
...mapState(["viewer1Show", "yqfk", "qyEchartsShow"]),
|
},
|
mounted() {},
|
watch: {
|
cesiumInit: {
|
handler(newVal, oldVal) {
|
if (newVal) {
|
if (
|
window._showPointInfo === undefined ||
|
window._showPointInfo === true
|
) {
|
this.showPointInfo = true;
|
setTimeout(() => {
|
this.setCesuimHandle();
|
}, 1000);
|
} else if (window._showPointInfo === false) {
|
this.showPointInfo = false;
|
}
|
}
|
},
|
deep: true,
|
immediate: true,
|
},
|
},
|
methods: {
|
// ...mapMutations(["setViewer1Show", "setYqfk"]),
|
...mapMutations(["setViewer1Show", "setqyEchartsShow"]),
|
spjkLoad() {
|
window.sxtkGeojson = new SmartEarth.ClusterLayer(sgworld.Viewer, {
|
pixelRange: 30,
|
gradient: {
|
0.0001: "rgb(0,191,255)",
|
0.001: "rgb(0,128,0)",
|
0.01: "rgb(255,165,0)",
|
0.1: "rgb(255,0,0)",
|
},
|
style: "clustering",
|
});
|
|
window.sxtkGeojson.dataSource.clustering.minimumClusterSize = 5;
|
// let url = window.sessionStorage.getItem("sxtGeojsonUrl");
|
let url;
|
axios
|
.get(url)
|
.then((data) => {
|
// console.log(data);
|
let features = data.data.features;
|
features.forEach((feature) => {
|
let geom = feature.geometry.coordinates;
|
let properties = feature.properties;
|
let point = new SmartEarth.Degrees(geom[0], geom[1]);
|
// let item = {
|
// lon
|
// };
|
|
let entitie = window.sxtkGeojson.add(point, {
|
image: SmartEarthRootUrl + "Workers/image/sxt.png",
|
});
|
entitie.properties = properties;
|
entitie.tag = "sxt";
|
});
|
|
sgworld.Navigate.flyToObj(window.sxtkGeojson.dataSource);
|
window.sxthandler = new Cesium.ScreenSpaceEventHandler(
|
sgworld.Viewer.scene.canvas
|
);
|
window.sxthandler.setInputAction((event) => {
|
let pick = sgworld.Viewer.scene.pick(event.position);
|
if (pick && pick.id && pick.id.tag == "sxt") {
|
//关闭地块信息弹窗
|
Bus.$emit("closeLandInfoPop", true);
|
//结束之前操作
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
|
sgworld.drawObj &&
|
(sgworld.drawObj.drawHandler &&
|
sgworld.drawObj.drawHandler.destroy(),
|
sgworld.drawObj.end && sgworld.drawObj.end());
|
|
let props = pick.id.properties;
|
let screenHeight =
|
document.body.clientHeight ||
|
document.documentElement.clientHeigh;
|
let offsetTop = screenHeight - 385;
|
offsetTop = offsetTop < 0 ? 0 : offsetTop;
|
|
offsetTop = offsetTop > 100 ? offsetTop - 100 : offsetTop;
|
// console.log(props.installPla._value)
|
layerOpen(props.name._value, {
|
width: 470,
|
height: 385,
|
offset: [offsetTop + "px", "310px"],
|
url:
|
"./static/html/video/video.html?code=" +
|
props.cameraInde._value,
|
fn: {
|
success: (layero, index) => {
|
SmartEarthPopupData.layerContainer = layero;
|
},
|
end: () => {
|
// this.isOpen.ymfx = false;
|
},
|
cancel: () => {
|
sgworld.drawObj &&
|
sgworld.drawObj.end &&
|
sgworld.drawObj.end("cancel");
|
},
|
},
|
});
|
}
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
})
|
.catch((err) => {
|
console.log(err);
|
});
|
},
|
spjkHandle() {
|
if (window.sxtkGeojson) {
|
window.sxtkGeojson.deleteObject();
|
window.sxtkGeojson = null;
|
window.sxthandler.destroy();
|
//关闭弹窗
|
Bus.$emit("closeRightPop", true);
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
return;
|
} else {
|
Bus.$emit("showSPJK");
|
// this.spjkLoad();
|
}
|
},
|
yqfkHandle() {
|
this.setYqfk(!this.yqfk);
|
},
|
rangeQuery() {
|
Bus.$emit("showRangeBox", true);
|
},
|
tdglHandle() {
|
this.setViewer1Show(!this.viewer1Show);
|
},
|
jjHandle() {
|
if (!window.panoramaHandler) {
|
//关闭菜单弹窗
|
Bus.$emit("closeMenuPop", true);
|
var urls = URLInCode.jjLWUrl;
|
// var urls = "http://10.10.4.121:8070/gisserver/wmsserver/YZ_LW";
|
window.panoramaLayer = sgworld.Creator.CreateWMSImageFeatureLayer(
|
"gisserver",
|
{
|
url: urls,
|
queryParameters: {
|
layers: "",
|
},
|
},
|
{},
|
"0",
|
true,
|
function () {}
|
);
|
window.panoramaHandler = new Cesium.ScreenSpaceEventHandler(
|
Viewer.scene.canvas
|
);
|
window.panoramaHandler.setInputAction((event) => {
|
let p;
|
p = sgworld.Navigate.getMouseDegrees(event);
|
let panorama = new yzPanorama();
|
panorama.open({
|
id: "qjMap",
|
closeId: "panoramaClose",
|
lon: p.lon,
|
lat: p.lat,
|
});
|
|
// let StreetUrl = "http://10.10.4.116:8085/yzAdapter/";
|
// let _StreetscapeYZ = new StreetscapeYZ(sgworld, {
|
// StreetUrl: StreetUrl,
|
// lon: p.lon,
|
// lat: p.lat
|
// });
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
} else {
|
try {
|
window.panoramaLayer.deleteObject();
|
} catch (e) {}
|
window.panoramaHandler.destroy();
|
window.panoramaHandler = undefined;
|
}
|
},
|
sjxqHandle() {
|
window._showPointInfo = this.showPointInfo;
|
|
switch (this.showPointInfo) {
|
case true:
|
this.setCesuimHandle();
|
break;
|
case false:
|
if (divPoint1) {
|
sgworld.Creator.DeleteObject(divPoint1);
|
}
|
if (handler) {
|
handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
}
|
break;
|
}
|
},
|
clearSelectObject() {
|
if (window.pickFeature && window.pickFeature.primitive) {
|
window.pickFeature.primitive.image = imgUrl;
|
window.pickFeature.primitive.scale = scale;
|
window.pickFeature = null;
|
}
|
},
|
setCesuimHandle() {
|
var that = this;
|
|
Bus.$on("clearSelectObject", this.clearSelectObject);
|
handler && handler.destroy();
|
handler = new Cesium.ScreenSpaceEventHandler(Viewer.scene.canvas);
|
handler.setInputAction((event) => {
|
let nPickFeature = sgworld.Viewer.scene.pick(event.position);
|
|
if (Cesium.defined(nPickFeature)) {
|
this.resetImg();
|
if (buildingPolygon) {
|
sgworld.Creator.DeleteObject(buildingPolygon);
|
buildingPolygon = null;
|
}
|
if (nPickFeature.primitive instanceof Cesium.Billboard) {
|
if (nPickFeature.id.length > 0) {
|
return;
|
}
|
// this.resetBorder();
|
window.pickFeature = nPickFeature;
|
// console.log(nPickFeature);
|
imgUrl = nPickFeature.primitive.image;
|
scale = nPickFeature.primitive.scale;
|
nPickFeature.primitive.image =
|
window.SmartEarthRootUrl + "Workers/image/point.png";
|
nPickFeature.primitive.scale = 1;
|
//点击弹框
|
let obj = {};
|
let lon;
|
let lat;
|
let isCamera = false;
|
if (nPickFeature.id.tag) {
|
let properties = nPickFeature.id.properties;
|
let propertyNames = nPickFeature.id.properties.propertyNames;
|
if (propertyNames.indexOf("监控名") !== -1) {
|
isCamera = true;
|
obj["JK名称"] = properties["JK名称"]._value;
|
// obj["JK类型"] = properties["JK类型"]._value;
|
// obj["功能"] = properties["功能"]._value;
|
// obj["所在区"] = properties["所在区"]._value;
|
// obj["JK编号"] = properties["JK编号"]._value;
|
obj["JK内码"] = properties["JK内码"]._value;
|
} else {
|
propertyNames.forEach((item) => {
|
obj[item] = properties[item]._value;
|
});
|
}
|
|
let cartographic =
|
window.Viewer.scene.globe.ellipsoid.cartesianToCartographic(
|
nPickFeature.id.position._value
|
);
|
lon = Cesium.Math.toDegrees(cartographic.longitude);
|
lat = Cesium.Math.toDegrees(cartographic.latitude);
|
} else {
|
obj = nPickFeature.id.attributes;
|
lon = nPickFeature.id.positions[0];
|
lat = nPickFeature.id.positions[1];
|
}
|
if (divPoint1) {
|
divPoint1.deleteObject();
|
}
|
if (!isCamera) {
|
tooltipHTML = "";
|
//重置LayerField数据
|
for (let item in LayerField) {
|
LayerField[item] = 0;
|
}
|
// 删除字段
|
let { OBJECTID, ID, BZDZ, Latitude, Longtitude, ...userData } =
|
obj;
|
|
// 判断展示的类型
|
if (
|
userData.hasOwnProperty("部件名称") ||
|
userData.hasOwnProperty("井编号")
|
) {
|
//修改LayerField数据
|
for (let itemName in userData) {
|
let CnName = keyName[itemName] || itemName;
|
if (LayerField.hasOwnProperty(CnName)) {
|
LayerField[CnName] = userData[itemName];
|
if (CnName == "经度" || CnName == "纬度") {
|
let str = Number(LayerField[CnName]);
|
LayerField[CnName] = str.toFixed(6);
|
}
|
}
|
}
|
// 展示LayerField数据
|
for (let item in LayerField) {
|
let value = LayerField[item];
|
value && (tooltipHTML += `<p>${item}:${value || "无"}</p>`);
|
}
|
} else {
|
// 直接展示
|
for (let itemName in userData) {
|
let value = userData[itemName];
|
let CnName = keyName[itemName] || itemName;
|
value &&
|
(tooltipHTML += `<p>${CnName}:${value || "无"}</p>`);
|
console.log(tooltipHTML);
|
}
|
}
|
|
let description = `
|
<div id="pointInfoBox" class="pointInfoBox" style="pointer-events:auto;">
|
<span style="position: absolute; right: 12px; top: 6px;">×</span>
|
${tooltipHTML}
|
</div>
|
`;
|
divPoint1 = sgworld.Creator.createDivPoint(
|
"详细信息",
|
{
|
lon: lon,
|
lat: lat,
|
height: 50,
|
},
|
{
|
type: "custom",
|
offset: ["c", 50],
|
description,
|
onclick(data) {
|
// sgworld.Creator.DeleteObject(divPoint1);
|
divPoint1 && divPoint1.deleteObject();
|
if (window.pickFeature && window.pickFeature.primitive) {
|
window.pickFeature.primitive.image = imgUrl;
|
window.pickFeature.primitive.scale = scale;
|
window.pickFeature = null;
|
}
|
},
|
}
|
);
|
// if (tooltip) {
|
// tooltip.show(false);
|
// tooltip = null;
|
// }
|
// tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, {
|
// color: "black",
|
// addY: -40,
|
// far: 200000,
|
// closeBtn: true,
|
// close: () => {
|
// this.resetImg();
|
// },
|
// });
|
|
// let description = `<div style='background:
|
// rgba(14, 50, 143, 0.6);
|
// border: 1px solid #205fbc;
|
// border-radius: 5px;
|
// color: #fff;
|
// padding: 15px;
|
// box-shadow: 0px 1px 10px 0px rgba(3, 10, 26, 0.38);
|
// '>${tooltipHTML}</div>`;
|
|
// tooltip.showAt(
|
// Cesium.Cartesian3.fromDegrees(lon, lat, 0),
|
// description
|
// );
|
}
|
//关闭地块信息弹窗
|
Bus.$emit("closeLandInfoPop", true);
|
layuiLayer.close(SmartEarthPopupData.layerProp);
|
this.$store.commit("description", obj);
|
} else if (nPickFeature.primitive instanceof Cesium.Cesium3DTileset) {
|
// let cartographic =
|
// window.Viewer.scene.globe.ellipsoid.cartesianToCartographic(
|
// nPickFeature.content.tile.boundingSphere.center
|
// );
|
// let lon = Cesium.Math.toDegrees(cartographic.longitude);
|
// let lat = Cesium.Math.toDegrees(cartographic.latitude);
|
let p = sgworld.Navigate.getMouseDegrees(event);
|
let lon = p.lon;
|
let lat = p.lat;
|
|
axios
|
.get(
|
"http://10.10.4.121:8070/gisserver/wfsserver/yizhuang-building-wfs-1207",
|
{
|
params: {
|
version: "1.3.0",
|
request: "GetFeature",
|
typename: `亦庄建筑外轮廓4326`,
|
propertyname: "*",
|
format: "json",
|
filter: `<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><ogc:Intersects><ogc:PropertyName>SAHEP</ogc:PropertyName><gml:Point > <gml:pos>${lon} ${lat}</gml:pos></gml:Point></ogc:Intersects></ogc:Filter>`,
|
},
|
}
|
)
|
.then((response) => {
|
if (response.data.features.length > 0) {
|
var geometry = [];
|
let POIs = response.data.features[0].geometry.coordinates[0];
|
for (let i = 0; i < POIs.length; i++) {
|
geometry.push({
|
x: parseFloat(POIs[i][0]),
|
y: parseFloat(POIs[i][1]),
|
z: 0,
|
});
|
}
|
buildingPolygon = sgworld.Creator.createPolygon(
|
geometry,
|
{
|
fillColor: "#00ff0050",
|
outlineColor: "#ff0000",
|
outlineWidth: 2,
|
},
|
1,
|
0,
|
"面"
|
);
|
}
|
});
|
}
|
// else if (nPickFeature.primitive instanceof Cesium.GroundPrimitive) {
|
// let wmsLayer = this.$store.state.selectedLayers.filter((item) => {
|
// return item.name == "行政区划图";
|
// });
|
// if (wmsLayer[0]) {
|
// let p = sgworld.Navigate.getMouseDegrees(event);
|
|
// axios
|
// .get(
|
// "http://10.10.4.116:8070/gisserver/rest/services/XingZhengQuHuaTu/MapServer/identify",
|
// {
|
// params: {
|
// geometry: `${p.lon},${p.lat}`,
|
// geometryType: "esriGeometryPoint",
|
// layers: "all",
|
// tolerance: 1,
|
// mapExtent:
|
// "116.389809720644,39.586819997000134,116.72107119373061,39.859910895000155",
|
// imageDisplay: "600,550,96",
|
// returnGeometry: true,
|
// },
|
// }
|
// )
|
// .then((res) => {
|
// if (res.data.results.length != 0) {
|
// this.resetImg();
|
// this.resetBorder();
|
// let area = res.data.results.filter(
|
// (item) => item.geometry.rings != undefined
|
// );
|
// let poi = area[0].geometry.rings;
|
// poi.forEach((ring) => {
|
// ring.forEach((item, index, arr) => {
|
// arr[index] = {
|
// x: parseFloat(item[0]),
|
// y: parseFloat(item[1]),
|
// z: 0,
|
// };
|
// });
|
// });
|
// poi.forEach((item, index) => {
|
// lineArr[index] = sgworld.Creator.createWall(
|
// `新建墙${index}`,
|
// item,
|
// {
|
// minHeight: 0,
|
// maxHeight: 200,
|
// fill: true,
|
// material: Cesium.Color.YELLOW,
|
// outline: true,
|
// outlineColor: Cesium.Color.YELLOW,
|
// outlineWidth: 1.0,
|
// }
|
// );
|
// });
|
// tooltipHTML = "";
|
// for (let i in area[0].attributes) {
|
// let value = area[0].attributes[i];
|
// value && (tooltipHTML += `<p>${i}:${value || "无"}</p>`);
|
// }
|
|
// if (tooltip) {
|
// tooltip.show(false);
|
// tooltip = null;
|
// }
|
// tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, {
|
// color: "black",
|
// addY: 0,
|
// far: 200000,
|
// closeBtn: true,
|
// close: () => {
|
// this.resetImg();
|
// this.resetBorder();
|
// },
|
// });
|
// let description = `<div style=' border: 1px solid #fff;border-radius: 5px;background: rgba(0, 0, 0, 0.8);color: #fff;padding: 15px;'>${tooltipHTML}</div>`;
|
// tooltip.showAt(
|
// Cesium.Cartesian3.fromDegrees(p.lon, p.lat, 0),
|
// description
|
// );
|
// }
|
// });
|
// }
|
// }
|
}
|
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
},
|
stdsj() {
|
window.open(
|
"http://10.9.2.29:8080/#/login?token=1ed14c5157acb8088efe65bc93a032c3"
|
);
|
},
|
closeJm() {
|
this.$parent.$parent.$parent.isShowSpeAnalyse = false;
|
},
|
resetImg() {
|
if (window.pickFeature && window.pickFeature.primitive) {
|
window.pickFeature.primitive.image = imgUrl;
|
window.pickFeature.primitive.scale = scale;
|
window.pickFeature = null;
|
}
|
},
|
// resetBorder() {
|
// lineArr.forEach((item, index) => {
|
// if (lineArr[index]) {
|
// sgworld.Creator.DeleteObject(lineArr[index]);
|
// lineArr[index] = null;
|
// }
|
// });
|
// },
|
stdsjHandle() {
|
window.open(
|
"http://10.9.2.29:8080/#/login?token=1ed14c5157acb8088efe65bc93a032c3"
|
);
|
},
|
tdglHandle() {
|
this.setViewer1Show(!this.viewer1Show);
|
},
|
qytj() {
|
this.setqyEchartsShow(!this.qyEchartsShow);
|
},
|
sceneRoaming() {
|
if (this.showFlag) {
|
document.getElementById("scroll").style.display = "none";
|
} else {
|
document.getElementById("scroll").style.display = "block";
|
}
|
this.showFlag = !this.showFlag;
|
},
|
setRomanFly(result) {
|
this.showFlag = false;
|
document.getElementById("scroll").style.display = "none";
|
var val = roman.filter((res) => {
|
if (res.name == result.name) {
|
return res;
|
}
|
});
|
var degreesArr = val[0].value;
|
|
sgworld.Creator.getFlyData(degreesArr, (data) => {
|
data.showPoint = false;
|
data.showLine = true;
|
data.mode = 1;
|
// 弹窗数据
|
window.PathAnimationData = {
|
flyData: data,
|
};
|
window.PathAnimationData.winIndex = layer.open({
|
type: 2,
|
title: "路径动画",
|
shade: false,
|
area: ["352px", "690px"],
|
offset: "r",
|
skin: "other-class",
|
content: SmartEarthRootUrl + "Workers/path/Path.html",
|
end: function () {
|
PathAnimationData.fly && PathAnimationData.fly.exit();
|
},
|
});
|
});
|
},
|
|
handleCommand(command) {
|
switch (command) {
|
case "qytj":
|
this.qytj();
|
break;
|
case "spjkHandle":
|
this.spjkHandle();
|
break;
|
case "stdsjHandle":
|
this.stdsjHandle();
|
break;
|
}
|
},
|
|
// 视频融合
|
async shipinronghe(item) {
|
var that = this;
|
if (that.videoarrList.length > 0) {
|
for (var i = 0; i < that.videoarrList.length; i++) {
|
that.videoarrList[i].destroy();
|
that.videoarrList[i] = undefined;
|
}
|
that.videoarrList = [];
|
} else {
|
for (var i = 0; i < item.length; i++) {
|
let position = new SmartEarth.Degrees(
|
item[i].lon,
|
item[i].lat,
|
item[i].height
|
);
|
await $.ajax({
|
url:
|
"http://10.10.4.116:8086/getCamerasInfoHls?cameraIndexCode=" +
|
item[i].cameraIndexCode,
|
// url: "http://10.10.4.116:8086/getCamerasInfoHls?cameraIndexCode=49ee9fed701444738112e80a4835122c",
|
success: function (result) {
|
video = sgworld.Creator.Video3D({
|
cameraPosition: position, //相机安装位置
|
heading: item[i].heading, //64
|
pitch: item[i].pitch, //-47
|
url: JSON.parse(result).data.url, //视频
|
type: "hls",
|
horizonAngle: item[i].horizonAngle, //相机水平视角30
|
verticalAngle: item[i].verticalAngle, //相机垂直视角60
|
offset: 0.1, //视频四周羽化比例
|
near: 1, //最近投射面距离
|
far: item[i].far, //最远投射面距离166
|
alpha: item[i].alpha, //透明度1
|
useLine: false, //是否试用辅助线
|
success() {
|
sgworld.Navigate.flyToObj(video);
|
},
|
});
|
that.videoarrList.push(video);
|
},
|
});
|
}
|
}
|
},
|
updateVideo() {
|
video &&
|
video.updateVideo({
|
horizonAngle: this.horizonAngle, //相机水平视角
|
verticalAngle: this.verticalAngle, //相机垂直视角
|
alpha: this.alpha, //透明度
|
far: this.far, //透明度
|
heading: this.heading, //透明度
|
pitch: this.pitch, //透明度
|
});
|
},
|
// 清除
|
clear() {
|
video && video.destroy();
|
video = undefined;
|
},
|
guanxian(params) {
|
if (params == "open") {
|
promiseS3M = sgworld.coreMap.scene.open(
|
"http://192.162.2.2:8090/iserver/services/3D-GX/rest/realspace"
|
);
|
this.openGX = "close";
|
} else {
|
promiseS3M.then((res) => {
|
res.forEach((item) => {
|
item.visible = false;
|
});
|
});
|
}
|
},
|
read(wkt) {
|
var regExes = {
|
typeStr: /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
|
emptyTypeStr: /^\s*(\w+)\s*EMPTY\s*$/,
|
spaces: /\s+/,
|
parenComma: /\)\s*,\s*\(/,
|
doubleParenComma: /\)\s*\)\s*,\s*\(\s*\(/, // can't use {2} here
|
trimParens: /^\s*\(?(.*?)\)?\s*$/,
|
};
|
/**
|
* Object with properties corresponding to the geometry types. Property values
|
* are functions that do the actual parsing.
|
* @private
|
*/
|
var parse$1 = {
|
/**
|
* Return point geometry given a point WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the point.
|
* @return {Point} A point geometry.
|
* @private
|
*/
|
point: function point(str) {
|
if (str === undefined) {
|
return [];
|
}
|
|
var coords = str.trim().split(regExes.spaces);
|
return [Number.parseFloat(coords[0]), Number.parseFloat(coords[1])];
|
},
|
|
/**
|
* Return a multipoint geometry given a multipoint WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the multipoint.
|
* @return {Point} A multipoint feature.
|
* @private
|
*/
|
multipoint: function multipoint(str) {
|
var this$1 = this;
|
|
if (str === undefined) {
|
return [];
|
}
|
|
var point;
|
var points = str.trim().split(",");
|
var components = [];
|
for (var i = 0, len = points.length; i < len; ++i) {
|
point = points[i].replace(regExes.trimParens, "$1");
|
components.push(parse$1.point(point));
|
}
|
return components;
|
},
|
|
/**
|
* Return a linestring geometry given a linestring WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the linestring.
|
* @return {LineString} A linestring geometry.
|
* @private
|
*/
|
linestring: function linestring(str) {
|
if (str === undefined) {
|
return [];
|
}
|
|
var points = str.trim().split(",");
|
var components = [];
|
var coords;
|
for (var i = 0, len = points.length; i < len; ++i) {
|
coords = points[i].trim().split(regExes.spaces);
|
components.push([
|
Number.parseFloat(coords[0]),
|
Number.parseFloat(coords[1]),
|
]);
|
}
|
return components;
|
},
|
|
/**
|
* Return a linearring geometry given a linearring WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the linearring.
|
* @return {LinearRing} A linearring geometry.
|
* @private
|
*/
|
linearring: function linearring(str) {
|
if (str === undefined) {
|
return [];
|
}
|
|
var points = str.trim().split(",");
|
var components = [];
|
var coords;
|
for (var i = 0, len = points.length; i < len; ++i) {
|
coords = points[i].trim().split(regExes.spaces);
|
components.push([
|
Number.parseFloat(coords[0]),
|
Number.parseFloat(coords[1]),
|
]);
|
}
|
return components;
|
},
|
|
/**
|
* Return a multilinestring geometry given a multilinestring WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the multilinestring.
|
* @return {MultiLineString} A multilinestring geometry.
|
* @private
|
*/
|
multilinestring: function multilinestring(str) {
|
var this$1 = this;
|
|
if (str === undefined) {
|
return [];
|
}
|
|
var line;
|
var lines = str.trim().split(regExes.parenComma);
|
var components = [];
|
for (var i = 0, len = lines.length; i < len; ++i) {
|
line = lines[i].replace(regExes.trimParens, "$1");
|
components.push(parse$1.linestring(line));
|
}
|
return components;
|
},
|
|
/**
|
* Return a polygon geometry given a polygon WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the polygon.
|
* @return {Polygon} A polygon geometry.
|
* @private
|
*/
|
polygon: function polygon(str) {
|
var this$1 = this;
|
|
if (str === undefined) {
|
return [];
|
}
|
|
var ring, linestring, linearring;
|
var rings = str.trim().split(regExes.parenComma);
|
var shell;
|
var holes = [];
|
//for (var i = 0, len = rings.length; i < len; ++i) {
|
ring = rings[0].replace(regExes.trimParens, "$1");
|
linestring = ring;
|
//}
|
return linestring;
|
},
|
|
/**
|
* Return a multipolygon geometry given a multipolygon WKT fragment.
|
*
|
* @param {String} str A WKT fragment representing the multipolygon.
|
* @return {MultiPolygon} A multipolygon geometry.
|
* @private
|
*/
|
multipolygon: function multipolygon(str) {
|
var this$1 = this;
|
|
if (str === undefined) {
|
return [];
|
}
|
|
var polygon;
|
var polygons = str.trim().split(regExes.doubleParenComma);
|
var components = [];
|
for (var i = 0, len = polygons.length; i < len; ++i) {
|
polygon = polygons[i].replace(regExes.trimParens, "$1");
|
components.push(parse$1.polygon(polygon));
|
}
|
return components;
|
},
|
};
|
|
var geometry, type, str;
|
wkt = wkt.replace(/[\n\r]/g, " ");
|
var matches = regExes.typeStr.exec(wkt);
|
if (wkt.search("EMPTY") !== -1) {
|
matches = regExes.emptyTypeStr.exec(wkt);
|
matches[2] = undefined;
|
}
|
if (matches) {
|
type = matches[1].toLowerCase();
|
str = matches[2];
|
if (parse$1[type]) {
|
geometry = parse$1[type].apply(this, [str]);
|
}
|
}
|
|
if (geometry === undefined) {
|
throw new Error("Could not parse WKT " + wkt);
|
}
|
|
return geometry;
|
},
|
},
|
};
|
</script>
|