|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<!-- <div class='Map' @click="cutVr('fd720_WoDGV0K2r',13)"> -->
|
|
|
- <div class='Map'>
|
|
|
+ <div class="Map">
|
|
|
<div id="mars3dContainer" class="mars3d-container"></div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -48,13 +48,13 @@ export default {
|
|
|
// 倾斜模型加载
|
|
|
loadModel(_map) {
|
|
|
const modelLayer = new mars3d.layer.TilesetLayer({
|
|
|
- name: '雨花台模型',
|
|
|
- url: 'https://testgis.4dage.com/yuhuatai1021-qp/tileset.json',
|
|
|
+ name: "雨花台模型",
|
|
|
+ url: "https://testgis.4dage.com/yuhuatai1021-qp/tileset.json",
|
|
|
maximumMemoryUsage: 2048,
|
|
|
position: { alt: -290 },
|
|
|
preloadFlightDestinations: true,
|
|
|
- flyTo: false
|
|
|
- })
|
|
|
+ flyTo: false,
|
|
|
+ });
|
|
|
_map.addLayer(modelLayer);
|
|
|
},
|
|
|
drawLabel(_layer) {
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
>
|
|
|
雨花台烈士纪念馆
|
|
|
</div>
|
|
|
- <div><img src="/MapBs.png"/></div>
|
|
|
+ <div><img src="/YHT/Qjkk/MapBs.png"/></div>
|
|
|
</div>`,
|
|
|
horizontalOrigin: mars3d.Cesium.HorizontalOrigin.CENTER,
|
|
|
verticalOrigin: mars3d.Cesium.VerticalOrigin.BOTTOM,
|
|
@@ -94,22 +94,20 @@ export default {
|
|
|
// scaleByDistance: new mars3d.Cesium.NearFarScalar(100, 1, 1000, 0.5),
|
|
|
scale: 0.1,
|
|
|
clampToGround: false,
|
|
|
- }
|
|
|
- })
|
|
|
+ },
|
|
|
+ });
|
|
|
graphic.on(mars3d.EventType.click, () => {
|
|
|
- this.cutVr('fd720_WoDGV0K2r', 13);
|
|
|
- })
|
|
|
+ this.cutVr("fd720_WoDGV0K2r", 13);
|
|
|
+ });
|
|
|
|
|
|
_layer.addGraphic(graphic);
|
|
|
},
|
|
|
cutVr(code, index) {
|
|
|
- this.$emit('mapCutVr', code, index)
|
|
|
- }
|
|
|
+ this.$emit("mapCutVr", code, index);
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {
|
|
|
-
|
|
|
- },
|
|
|
+ created() {},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
// 初始化地图实例
|
|
@@ -121,21 +119,27 @@ export default {
|
|
|
let graphicLayer = new mars3d.layer.GraphicLayer();
|
|
|
map.addLayer(graphicLayer);
|
|
|
this.drawLabel(graphicLayer);
|
|
|
- map.setCameraView({ lat: 31.99314, lng: 118.776577, alt: 656, heading: 350, pitch: -43 });
|
|
|
+ map.setCameraView({
|
|
|
+ lat: 31.99314,
|
|
|
+ lng: 118.776577,
|
|
|
+ alt: 656,
|
|
|
+ heading: 350,
|
|
|
+ pitch: -43,
|
|
|
+ });
|
|
|
},
|
|
|
(error) => {
|
|
|
console.log("地图初始化失败", error);
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- beforeCreate() { }, //生命周期 - 创建之前
|
|
|
- beforeMount() { }, //生命周期 - 挂载之前
|
|
|
- beforeUpdate() { }, //生命周期 - 更新之前
|
|
|
- updated() { }, //生命周期 - 更新之后
|
|
|
- beforeDestroy() { }, //生命周期 - 销毁之前
|
|
|
- destroyed() { }, //生命周期 - 销毁完成
|
|
|
- activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
-}
|
|
|
+ beforeCreate() {}, //生命周期 - 创建之前
|
|
|
+ beforeMount() {}, //生命周期 - 挂载之前
|
|
|
+ beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
+ updated() {}, //生命周期 - 更新之后
|
|
|
+ beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
+ destroyed() {}, //生命周期 - 销毁完成
|
|
|
+ activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.Map {
|