Fly 4 ay önce
ebeveyn
işleme
50b46a4664

+ 2 - 2
components/Touchbox/Touchbox.vue

@@ -11,7 +11,7 @@
 		data() {
 			return {
 				windowHeight: 0,
-				touchHeight: uni.upx2px(80),
+				touchHeight: uni.upx2px(100),
 				popupHeight: 0,
 				oldHeight: 0,
 				scrollHeight: 0,
@@ -136,7 +136,7 @@
 
 		.tap-touch-line {
 			width: 100%;
-			height: 80rpx;
+			height: 100rpx;
 			position: relative;
 
 			&:before {

+ 24 - 20
components/tiandituMap/tiandituMap.vue

@@ -28,7 +28,7 @@
 		},
 		data() {
 			return {
-				checkedDot:false,
+				checkedDot: false,
 				Tmap: null,
 				option: {
 					type: '',
@@ -123,7 +123,7 @@
 				}
 			}
 		},
-		
+
 		mounted() {
 
 		},
@@ -140,7 +140,7 @@
 				// 	}
 				// 	console.log("this.MyLngLat = " , this.MyLngLat)
 				// 	this.setMyIcon()
-				
+
 				EventBus.$emit('TianDiTuSearch', (res) => {
 					const { longitude, latitude } = res;
 					this.SelectedDot({ longitude, latitude })
@@ -177,19 +177,19 @@
 				try {
 					console.log('------------------')
 					// 地图移动,判断是否缩放/移动地图,还是通过点位定位
-					if(!this.checkedDot){
+					if (!this.checkedDot) {
 						// 自然缩放移动,刷新接口
 						const v = e.target.getCenter()
 						const Lng = v.getLng();
 						const Lat = v.getLat();
 						this.$emit("moveMap", { Lng, Lat })
-					}else{
+					} else {
 						// 点位移动,做处理
 						this.$nextTick(() => {
 							this.checkedDot = false;
 						})
 					}
-					
+
 				} catch (error) {
 					//TODO handle the exception
 				}
@@ -197,10 +197,10 @@
 
 			// 点击地图标注的点位
 			clickMapSite({ type, target, lnglat, containerPoint }) {
+				console.log('clickMapSite === ', 1)
 				const Lng = lnglat.getLng();
 				const Lat = lnglat.getLat();
 				this.$emit('handleMapSite', { Lng, Lat })
-
 			},
 			// 天地图缩放事件
 			handleZoomEvent(event) {
@@ -233,18 +233,19 @@
 			},
 			setViewport() {
 				try {
-				console.log('window.devicePixelRatio = ', window.devicePixelRatio)
-					console.log('window.getResolution 1 = 1 ', Tmap , window.screen.width * window.devicePixelRatio)
-					const w =  window.screen.width * window.devicePixelRatio
+					console.log('window.devicePixelRatio = ', window.devicePixelRatio)
+					console.log('window.getResolution 1 = 1 ', Tmap, window.screen.width * window.devicePixelRatio)
+					const w = window.screen.width * window.devicePixelRatio
 					const meta = document.createElement('meta')
 					meta.name = 'viewport'
-					meta.content = `width=device-width,initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0, user-scalable=no` 
+					meta.content =
+						`width=device-width,initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0, user-scalable=no`
 					// meta.content = `initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no` 
 					// meta.media = `(device-height: 568px)` 
-					
+
 					document.head.appendChild(meta)
-					
-					
+
+
 				} catch (err) {
 					console.log('---------- ', err)
 				}
@@ -314,14 +315,14 @@
 				this.setIcon(lng, lat, true)
 				Tmap.centerAndZoom(new T.LngLat(lng, lat), 15);
 			},
-			setIcon(lng, lat, isClear, iconU, info) {
+			setIcon(lng, lat, isClear, iconU, info, max = false) {
 				if (isClear) {
 					this.clearIcon()
 				}
 				const icon = new T.Icon({
 					iconUrl: iconU || this.options.png,
-					iconSize: new T.Point(45, 45),
-					iconAnchor: new T.Point(15, 30)
+					iconSize: max ? new T.Point(60, 60) : new T.Point(45, 45),
+					iconAnchor: new T.Point(15, 45)
 				});
 				const marker = new T.Marker(new T.LngLat(lng, lat), {
 					icon
@@ -391,10 +392,13 @@
 					console.log("天地图获取定位 = error ", error)
 				}
 			},
-			SelectedDot(res , dot = false) {
+			SelectedDot(res, dot = false, level = 16) {
 				this.checkedDot = dot
 				const { longitude, latitude } = res;
-				Tmap.panTo(new T.LngLat(longitude, latitude), 16); // 移动到选中的点位
+				Tmap.panTo(new T.LngLat(longitude, latitude), level); // 移动到选中的点位
+			},
+			setMaxIcon() {
+
 			},
 			setMyIcon() {
 				const { lng, lat } = this.MyLngLat || {}
@@ -408,7 +412,7 @@
 					icon
 				});
 
-				Tmap.addOverLay(marker);
+				// Tmap.addOverLay(marker);
 				try {
 					marker.removeEventListener("click", () => {});
 				} catch (error) {}

+ 1 - 1
config/index.js

@@ -12,5 +12,5 @@ export default {
 	// 天地图
 	tianKey:'1edd9c001a8425cb93631398109d5ab2',
 	
-	type:'H6' , // h5 / h6,  web端打包需要修改 manifest.json web配置的基础运行路径
+	type:'H5' , // H5 / H6,  web端打包需要修改 manifest.json web配置的基础运行路径
 }

+ 1 - 1
manifest.json

@@ -76,7 +76,7 @@
             "maps" : {}
         },
         "router" : {
-            "base" : "/h6/"
+            "base" : "/h5/"
         }
     }
 }

+ 27 - 5
pages/map/index.vue

@@ -12,7 +12,7 @@
 			:zIndex="1001" @currentHeight="e => TouchHeight = e">
 			<scroll-view :style="{'height':TouchHeight - 15  +'px' }" scroll-y="true" :show-scrollbar="false">
 				<template v-for="item in siteListArr">
-					<siteListModel :info="item" @checkSiteDetails="checkSiteDetails" />
+					<siteListModel :info="item" @checkSiteDetails="handleMapSite" />
 				</template>
 			</scroll-view>
 		</Touchbox>
@@ -88,7 +88,8 @@
 										mapTypeIcon,
 										el);
 									if (index === 0 && this.searchDot) {
-										this.$refs.tiandituMapRefs.Trenderjs.SelectedDot(el, true)
+										this.$refs.tiandituMapRefs.Trenderjs.SelectedDot(el, true,
+											12)
 									}
 								})
 
@@ -127,12 +128,33 @@
 			},
 			// 点击地图标注点位
 			handleMapSite(parmas = {}) {
-				const { Lng, Lat } = parmas;
-				const item = (this.siteListArr || []).find(el => el.longitude == Lng && el.latitude == Lat);
-				this.checkSiteDetails(item)
+				// const { Lng, Lat } = parmas;
+				const Lng = parmas.Lng || parmas.longitude;
+				const Lat = parmas.Lat || parmas.latitude;
+				// const item = (this.siteListArr || []).find(el => el.longitude == Lng && el.latitude == Lat);
+				// this.checkSiteDetails(item)
+				
+				// 放大选中的图标
+				let maxIcon = false;
+				this.$refs.tiandituMapRefs.clearIcon().then(res => {
+					(this.siteListArr || []).forEach(el => {
+						const { longitude, latitude, mapTypeIcon } = el;
+						if (el.longitude == Lng && el.latitude == Lat) {
+							maxIcon = true
+							this.checkSiteDetails(el)
+						} else {
+							maxIcon = false
+						}
+						this.$refs.tiandituMapRefs.setIcon(longitude, latitude, false,
+							mapTypeIcon,
+							el, maxIcon);
+					})
+				});
+
 			},
 			// 查看点位详情
 			checkSiteDetails(info) {
+				console.log('111' , info)
 				if (info) {
 					this.$refs.tiandituMapRefs.Trenderjs.SelectedDot(info, true)
 					// EventBus.$emit('TianDiTuSite', info)

+ 1 - 1
pages/map/map.js

@@ -14,7 +14,7 @@ export default {
 				}
 				return el
 			})
-			console.log('all === ', all)
+			// console.log('all === ', all)
 			return all
 		},
 	}