Bläddra i källkod

图层数据加载

DESKTOP-GBVU60Q\dell 1 år sedan
förälder
incheckning
269319c489
3 ändrade filer med 63 tillägg och 13 borttagningar
  1. 51 1
      src/views/Main/MainView.vue
  2. 2 2
      src/views/Main/components/layer.vue
  3. 10 10
      src/views/Main/components/map.vue

+ 51 - 1
src/views/Main/MainView.vue

@@ -24,11 +24,18 @@
 		<map3d @onload="jtMap3DOnload" ref="refMap3d" class="map3d" />
 		
 		<template v-if="mapLoaded">
+			<!-- 图层控制按钮 -->
+			<div class="layerButton" @click="layerIsShow">
+				<u-button>图层列表</u-button>
+			</div>
+			
 			<!-- 底图组件 -->
 			<basicLayer  style="display: none;" ref="basicLayers"></basicLayer>
 			
 			<!-- 图层列表 -->
-			<layer></layer>
+			<div v-show="layershow" class="layerStyle">
+				<layer></layer>
+			</div>
 			
 			<!-- 控制路由页面是否缓存 -->
 			<router-view v-slot="{ Component }">
@@ -60,6 +67,7 @@
 		data() {
 			return {
 				mapLoaded: false, //保证地图加载完成,在加载子路由
+				layershow: false,//图层是否显示
 			}
 		},
 
@@ -75,6 +83,10 @@
 				console.log('地图实例', jt3d)
 				store.jt3d = jt3d
 			},
+			
+			layerIsShow(){
+				this.layershow = !this.layershow
+			}
 		},
 		mounted() {
 
@@ -92,6 +104,44 @@
 </script>
 
 <style lang="scss" scoped>
+	@charset "UTF-8";
+	@font-face {
+		font-family: "TTTGB-Medium";
+		src: url("@/assets/fonts/fonts/TTTGB-Medium.ttf") format("truetype"),
+			url("@/assets/fonts/fonts/TTTGB-Medium.eot") format("embedded-opentype"),
+			url("@/assets/fonts/fonts/TTTGB-Medium.svg") format("svg");
+		font-weight: normal;
+		font-style: normal;
+	}
+	
+	.layerStyle{
+		position: fixed;
+		left: 400rem;
+		bottom:130rem;
+		width: 320rem;
+		height: 650rem;
+		overflow: hidden;
+		background-color: rgba(5, 45, 115, 0.5) !important;
+		z-index: 11;
+		user-select: none;
+		font-family: "TTTGB-Medium", sans-serif !important;
+	}
+	
+	.layerButton{
+		font-family: "TTTGB-Medium", sans-serif !important;
+		position: fixed;
+		left: 400rem;
+		bottom:70rem;
+		width: 150rem;
+		height: 50rem;
+		background-color: rgba(255,255,255,0.5);
+		color: #000;
+		line-height: 50rem;
+		cursor: pointer;
+		z-index: 11;
+		user-select: none;
+	}
+	
 	.Mainpage {
 		position: relative;
 		top: 0;

+ 2 - 2
src/views/Main/components/layer.vue

@@ -858,9 +858,9 @@
 						res.opacity = Number(res.opacity);
 
 						//默认展开
-						if (res.isexpand === '1') {
+						// if (res.isexpand === '1') {
 							_this.expandedKeys.push(res.id);
-						}
+						// }
 
 						// 复选框默认选中
 						if (res.isinit === '1') {

+ 10 - 10
src/views/Main/components/map.vue

@@ -301,27 +301,27 @@
 			fullMap(jt3d) {
 				// 初始化项目区域范围视角
 				let optionsS = {
-					west: 118.69586,
-					south: 35.91360,
-					east: 122.70061,
-					north: 38.65489,
+					west: 118.0361,
+					south: 36.6357,
+					east: 117.081,
+					north: 35.999,
 					isRemove: false, //定位完成后是否删除
 					duration: 3, //飞行时间
 					heading: 0,
 					pitch: -90,
-					range: 315000
+					range: 155000
 				};
 
 				let optionsE = {
-					west: 118.69586,
-					south: 35.91360,
-					east: 122.70061,
-					north: 38.65489,
+					west: 118.0361,
+					south: 36.6357,
+					east: 117.081,
+					north: 35.999,
 					isRemove: true, //定位完成后是否删除
 					duration: 3, //飞行时间
 					heading: 0,
 					pitch: -60,
-					range: 315000
+					range: 155000
 				};
 
 				var fullMapPromise = jt3d.fullMap(optionsS);