From 1767c2c878ec1892ae560f81b32b5afdd2ceebfd Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Tue, 27 Sep 2022 16:32:03 +0800
Subject: [PATCH] 小程序地图模式根据农场变化坐标
---
src/components/clickMap.vue | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/components/clickMap.vue b/src/components/clickMap.vue
index 9bfb9d4..724f993 100644
--- a/src/components/clickMap.vue
+++ b/src/components/clickMap.vue
@@ -7,6 +7,7 @@
<script>
export default {
+ props:["longitude","latitude"],
data () {
return {
map: "",
@@ -49,9 +50,10 @@
},
mounted () {
let that = this
- this.lng = 115.89886924863
- this.lat = 28.6780931500551
-
+ // this.lng = 115.89886924863
+ // this.lat = 28.6780931500551
+ this.lng = this.longitude
+ this.lat = this.latitude
this.initDate()
this.map.pm.addControls({
@@ -202,13 +204,14 @@
}
},
+
/**
* 地图初始化
*/
initDate () {
this.map = this.$L.map("map", {
center: [this.lat, this.lng], // 地图中心
- zoom: 10, //缩放比列
+ zoom: 15, //缩放比列
zoomControl: false, //禁用 + - 按钮
doubleClickZoom: false, // 禁用双击放大
attributionControl: false // 移除右下角leaflet标识
@@ -245,4 +248,4 @@
height: 100vh;
z-index: 1;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3