|
@@ -129,16 +129,24 @@
|
|
|
:key="baiduMapKey"
|
|
:key="baiduMapKey"
|
|
|
ref="myMap">
|
|
ref="myMap">
|
|
|
<!-- :minClusterSize="minClusterSize"-->
|
|
<!-- :minClusterSize="minClusterSize"-->
|
|
|
- <bml-marker-clusterer :averageCenter="false" :styles="styless">
|
|
|
|
|
|
|
+ <!-- <bml-marker-clusterer :averageCenter="false" :styles="styless">
|
|
|
<bm-marker
|
|
<bm-marker
|
|
|
v-for="(marker, index) of listData"
|
|
v-for="(marker, index) of listData"
|
|
|
:key="new Date().getTime() + index"
|
|
:key="new Date().getTime() + index"
|
|
|
:position="{ lng: marker.lon, lat: marker.lat }"
|
|
:position="{ lng: marker.lon, lat: marker.lat }"
|
|
|
@click="infoShow(marker, index)"
|
|
@click="infoShow(marker, index)"
|
|
|
:icon="{ url: mpFn(marker, 2), size: { width: 34, height: 40 } }"></bm-marker>
|
|
:icon="{ url: mpFn(marker, 2), size: { width: 34, height: 40 } }"></bm-marker>
|
|
|
- </bml-marker-clusterer>
|
|
|
|
|
- <bm-marker :position="{ lng: lonmy, lat: latmy }"></bm-marker>
|
|
|
|
|
- <!-- +0.00003-->
|
|
|
|
|
|
|
+ </bml-marker-clusterer> -->
|
|
|
|
|
+ <!-- 地图中心坐标 -->
|
|
|
|
|
+ <bm-marker
|
|
|
|
|
+ :position="{ lng: currentCenter.lng, lat: currentCenter.lat }"
|
|
|
|
|
+ :dragging="true"
|
|
|
|
|
+ animation="BMAP_ANIMATION_BOUNCE"
|
|
|
|
|
+ :icon="{
|
|
|
|
|
+ url: 'http://developer.baidu.com/map/jsdemo/img/location.gif',
|
|
|
|
|
+ size: { width: 14, height: 23 },
|
|
|
|
|
+ }">
|
|
|
|
|
+ </bm-marker>
|
|
|
<bm-marker
|
|
<bm-marker
|
|
|
:position="{ lng: info.lon, lat: info.lat }"
|
|
:position="{ lng: info.lon, lat: info.lat }"
|
|
|
:top="true"
|
|
:top="true"
|
|
@@ -162,10 +170,15 @@
|
|
|
lineHeight: '50px',
|
|
lineHeight: '50px',
|
|
|
}"
|
|
}"
|
|
|
:offset="{ width: -10, height: -10 }" />
|
|
:offset="{ width: -10, height: -10 }" />
|
|
|
- <!-- <bm-geolocation @locationSuccess="locationSuccess" anchor="BMAP_ANCHOR_BOTTOM_RIGHT" :showAddressBar="true" :autoLocation="true" :offset="{width:5,height:280}"></bm-geolocation>-->
|
|
|
|
|
</baidu-map>
|
|
</baidu-map>
|
|
|
- <img src="./../../assets/list.png" @click="onClickLeft" class="mapimg" />
|
|
|
|
|
- <img src="./../../assets/sbpm.png" @click="onMaps" class="mapimg" style="bottom: 286px" />
|
|
|
|
|
|
|
+ <img src="./../../assets/sbpm.png" @click="onMaps" class="mapimg" style="bottom: 340px" />
|
|
|
|
|
+ <img
|
|
|
|
|
+ src="./../../assets/list.png"
|
|
|
|
|
+ @click="onClickLeft"
|
|
|
|
|
+ class="mapimg"
|
|
|
|
|
+ style="bottom: 286px" />
|
|
|
|
|
+ <!-- 获取当前中心位置数据 -->
|
|
|
|
|
+ <img src="./../../assets/sbpm.png" @click="getLocationData" class="mapimg" />
|
|
|
<div v-if="show" class="mapStoreList">
|
|
<div v-if="show" class="mapStoreList">
|
|
|
<van-icon
|
|
<van-icon
|
|
|
name="close"
|
|
name="close"
|
|
@@ -840,6 +853,10 @@ export default {
|
|
|
heifhgts: '200px',
|
|
heifhgts: '200px',
|
|
|
mapRange: [], //地图范围
|
|
mapRange: [], //地图范围
|
|
|
baiduMapKey: new Date().getTime(),
|
|
baiduMapKey: new Date().getTime(),
|
|
|
|
|
+ currentCenter: {
|
|
|
|
|
+ lng: '',
|
|
|
|
|
+ lat: '',
|
|
|
|
|
+ }, //地图中心位置
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -959,6 +976,11 @@ export default {
|
|
|
// this.mapk.clearOverlays()
|
|
// this.mapk.clearOverlays()
|
|
|
this.getposition();
|
|
this.getposition();
|
|
|
},
|
|
},
|
|
|
|
|
+ getLocationData() {
|
|
|
|
|
+ this.lon = this.currentCenter.lng;
|
|
|
|
|
+ this.lat = this.currentCenter.lat;
|
|
|
|
|
+ this.getUserOutPlaList();
|
|
|
|
|
+ },
|
|
|
getStoreTypeList() {
|
|
getStoreTypeList() {
|
|
|
getStoreTypeListlp({}).then((res) => {
|
|
getStoreTypeListlp({}).then((res) => {
|
|
|
this.storeTypeLists = res.data;
|
|
this.storeTypeLists = res.data;
|
|
@@ -1074,9 +1096,7 @@ export default {
|
|
|
this.listData = this.list;
|
|
this.listData = this.list;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- reload() {
|
|
|
|
|
- debugger;
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ reload() {},
|
|
|
handler({ BMap, map }) {
|
|
handler({ BMap, map }) {
|
|
|
this.mapk = map;
|
|
this.mapk = map;
|
|
|
this.mapks = BMap;
|
|
this.mapks = BMap;
|
|
@@ -1101,18 +1121,19 @@ export default {
|
|
|
this.geocoder = new TMap.service.Geocoder();
|
|
this.geocoder = new TMap.service.Geocoder();
|
|
|
},
|
|
},
|
|
|
dragend(e) {
|
|
dragend(e) {
|
|
|
- this.getMapposition(e, '2', this.$route.query.tabVal);
|
|
|
|
|
|
|
+ // const currentCenter = this.mapk.getCenter();
|
|
|
|
|
+ // console.log(`当前中心点纬度: ${currentCenter.lat}, 经度: ${currentCenter.lng}`);
|
|
|
|
|
+ // this.getMapposition(e, '2', this.$route.query.tabVal);
|
|
|
|
|
+ var input = [e.target.re.lat, e.target.re.lng];
|
|
|
|
|
+ this.currentCenter = new TMap.LatLng(Number(input[0]), Number(input[1]));
|
|
|
|
|
+ console.log(`当前中心点纬度: ${this.currentCenter.lat}, 经度: ${this.currentCenter.lng}`);
|
|
|
},
|
|
},
|
|
|
zoomend(e) {
|
|
zoomend(e) {
|
|
|
this.getMapposition(e, '1', this.$route.query.tabVal);
|
|
this.getMapposition(e, '1', this.$route.query.tabVal);
|
|
|
},
|
|
},
|
|
|
getMapposition(e, type, listType) {
|
|
getMapposition(e, type, listType) {
|
|
|
- debugger;
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
|
var typeList = -1;
|
|
var typeList = -1;
|
|
|
- var input = [e.target.re.lat, e.target.re.lng];
|
|
|
|
|
- var location = new TMap.LatLng(Number(input[0]), Number(input[1]));
|
|
|
|
|
-
|
|
|
|
|
var Zoom = e.target.getZoom();
|
|
var Zoom = e.target.getZoom();
|
|
|
if (listType == 1) {
|
|
if (listType == 1) {
|
|
|
typeList = 1;
|
|
typeList = 1;
|
|
@@ -1137,11 +1158,11 @@ export default {
|
|
|
var PointSum = that.twoPointSum(lat, lon, that.latsave, that.lonsave).toFixed(2);
|
|
var PointSum = that.twoPointSum(lat, lon, that.latsave, that.lonsave).toFixed(2);
|
|
|
this.lon = this.mapk.getCenter().lng;
|
|
this.lon = this.mapk.getCenter().lng;
|
|
|
this.lat = this.mapk.getCenter().lat;
|
|
this.lat = this.mapk.getCenter().lat;
|
|
|
- if (PointSum > 3000) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.getUserOutPlaList();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (PointSum > 3000) {
|
|
|
|
|
+ // setTimeout(() => {
|
|
|
|
|
+ // this.getUserOutPlaList();
|
|
|
|
|
+ // }, 1000);
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getStoreMapInfo(val) {
|
|
getStoreMapInfo(val) {
|
|
@@ -1314,6 +1335,8 @@ export default {
|
|
|
that.lon1 = location.lon;
|
|
that.lon1 = location.lon;
|
|
|
that.latmy = location.lat;
|
|
that.latmy = location.lat;
|
|
|
that.lonmy = location.lon;
|
|
that.lonmy = location.lon;
|
|
|
|
|
+ that.currentCenter.lat = that.latmy;
|
|
|
|
|
+ that.currentCenter.lng = that.lonmy;
|
|
|
that.mapk.centerAndZoom(new BMap.Point(location.lon, location.lat), 18);
|
|
that.mapk.centerAndZoom(new BMap.Point(location.lon, location.lat), 18);
|
|
|
that.onSearch();
|
|
that.onSearch();
|
|
|
// that.getUserOutPlaList('2');
|
|
// that.getUserOutPlaList('2');
|
|
@@ -1363,7 +1386,6 @@ export default {
|
|
|
this.getpointList(row);
|
|
this.getpointList(row);
|
|
|
},
|
|
},
|
|
|
getpointList(val) {
|
|
getpointList(val) {
|
|
|
- debugger;
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
|
let loading3 = this.$toast.loading({
|
|
let loading3 = this.$toast.loading({
|
|
|
duration: 0,
|
|
duration: 0,
|
|
@@ -1668,7 +1690,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} else {
|
|
|
- debugger;
|
|
|
|
|
getUserOrgStoreList({
|
|
getUserOrgStoreList({
|
|
|
type: 2,
|
|
type: 2,
|
|
|
lon: this.lon,
|
|
lon: this.lon,
|