站点信息
This commit is contained in:
parent
4d6f8bbb30
commit
7a8c8edc0b
@ -210,6 +210,7 @@
|
||||
} = arrPoint[0];
|
||||
if (type == "add") {
|
||||
map.reverseGeocoder(qqmapsdk, longitude, latitude, (res) => {
|
||||
console.log("3333333333333","reverseGeocoder",longitude, latitude,res)
|
||||
const {
|
||||
formatted_addresses: {
|
||||
recommend
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
.divSearchCel {
|
||||
line-height: 3px;
|
||||
line-height: 5px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div :style="{width:'100vw',height}">
|
||||
<map id="mapRef" ref="mapRef" :style="{width:'100vw',height}" show-location :markers="markers"
|
||||
:polygons="polygons" :circles="circles" :polyline="polyline" :scale="scale" @tap="mapTap" />
|
||||
<map id="mapRef" ref="mapRef" :style="{width:'100vw',height}" show-location :longitude="mapcenter.longitude"
|
||||
:latitude="mapcenter.latitude" :markers="markers" :polygons="polygons" :circles="circles"
|
||||
:polyline="polyline" :scale="scale" @tap="mapTap" />
|
||||
<div class="divNav">
|
||||
|
||||
</div>
|
||||
@ -84,6 +85,10 @@
|
||||
const title = ref("新建站点");
|
||||
let isload = false;
|
||||
let oMap = null;
|
||||
const mapcenter = ref({
|
||||
longitude: "",
|
||||
latitude: ""
|
||||
})
|
||||
const scale = ref(18);
|
||||
const polygons = ref([]);
|
||||
const circles = ref([]);
|
||||
@ -301,10 +306,10 @@
|
||||
|
||||
function loadOperation(callback) {
|
||||
console.log("666666666666666666666", "行政区划", zoneId);
|
||||
|
||||
|
||||
map.getOperation(zoneId, (res) => {
|
||||
if (!res) {
|
||||
if(callback) callback();
|
||||
if (callback) callback();
|
||||
return;
|
||||
}
|
||||
const {
|
||||
@ -314,7 +319,7 @@
|
||||
arrData
|
||||
} = res;
|
||||
if (arrRegionID.length == 0) {
|
||||
if(callback) callback();
|
||||
if (callback) callback();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -325,7 +330,7 @@
|
||||
};
|
||||
|
||||
map.getRegionData(arrRegionID, (res) => {
|
||||
console.log("11111111111getRegionData",res);
|
||||
console.log("11111111111getRegionData", res);
|
||||
const {
|
||||
arrData,
|
||||
arrCircles: arrCircles_region,
|
||||
@ -363,7 +368,7 @@
|
||||
|
||||
markers.value = arrMarker;
|
||||
showMapSite(showRegion.value);
|
||||
if(callback) callback();
|
||||
if (callback) callback();
|
||||
})
|
||||
})
|
||||
}
|
||||
@ -375,7 +380,10 @@
|
||||
latitude,
|
||||
longitude
|
||||
} = res;
|
||||
|
||||
mapcenter.value={
|
||||
latitude,
|
||||
longitude
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
@ -394,8 +402,8 @@
|
||||
arrCirclesData,
|
||||
arrPolygonsData
|
||||
} = regionData;
|
||||
const arrEditC=[];
|
||||
const arrEditP=[];
|
||||
const arrEditC = [];
|
||||
const arrEditP = [];
|
||||
if (showSite) {
|
||||
if (editId) { //编辑
|
||||
const obj = {
|
||||
@ -403,34 +411,42 @@
|
||||
};
|
||||
console.log("9999999999999999999999arrCirclesData, arrPolygonsData", arrCirclesData, arrPolygonsData);
|
||||
let index = findIndex(arrCirclesData, obj);
|
||||
|
||||
|
||||
if (index > -1) {
|
||||
const {latitude,longitude}=arrCircles_region[index];
|
||||
const {
|
||||
latitude,
|
||||
longitude
|
||||
} = arrCircles_region[index];
|
||||
arrCirclesData.splice(index, 1);
|
||||
arrCircles_region.splice(index, 1);
|
||||
arrEditC.push(map.addCirle(drawColor,drawFillColor,longitude,latitude,radius.value));
|
||||
arrEditC.push(map.addCirle(drawColor, drawFillColor, longitude, latitude, radius.value));
|
||||
} else {
|
||||
index = findIndex(arrPolygonsData, obj);
|
||||
if(index>-1){
|
||||
const {points:arrPoint}=arrPolygons_region[index];
|
||||
if (index > -1) {
|
||||
const {
|
||||
points: arrPoint
|
||||
} = arrPolygons_region[index];
|
||||
arrPolygonsData.splice(index, 1);
|
||||
arrPolygons_region.splice(index, 1);
|
||||
arrEditP.push(map.addPolygon(drawColor,drawFillColor,arrPoint))
|
||||
arrEditP.push(map.addPolygon(drawColor, drawFillColor, arrPoint))
|
||||
}
|
||||
}
|
||||
}
|
||||
polygons.value = [...arrPolygons, ...arrPolygons_region,...arrEditP];
|
||||
circles.value = [...arrCircles, ...arrCircles_region,...arrEditC];
|
||||
polygons.value = [...arrPolygons, ...arrPolygons_region, ...arrEditP];
|
||||
circles.value = [...arrCircles, ...arrCircles_region, ...arrEditC];
|
||||
} else {
|
||||
polygons.value = arrPolygons;
|
||||
circles.value = arrCircles;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function defualtZoom() {
|
||||
if (polygons.value.length == 0) return;
|
||||
console.log("888888888888888888defualtZoom", polygons.value)
|
||||
if (polygons.value.length == 0) {
|
||||
return;
|
||||
}
|
||||
const arrPoint = polygons.value[0].points;
|
||||
oMap.includePoints({
|
||||
points: arrPoint,
|
||||
@ -455,11 +471,12 @@
|
||||
oMap = map.getMap("mapRef", getCurrentInstance());
|
||||
//oMap.moveToLocation();
|
||||
isload = true;
|
||||
getLocation();
|
||||
defualtZoom();
|
||||
});
|
||||
|
||||
onLoad(options => {
|
||||
console.log("33333333333333333","options",options)
|
||||
console.log("33333333333333333", "options,isload", options,isload)
|
||||
let title = "站点地图";
|
||||
const {
|
||||
type,
|
||||
@ -493,6 +510,8 @@
|
||||
uni.setNavigationBarTitle({
|
||||
title
|
||||
});
|
||||
|
||||
|
||||
loadData();
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -56,7 +56,7 @@ export const reverseGeocoder = (qqmapsdk, longitude, latitude, success, fail) =>
|
||||
if (success) success(res.result);
|
||||
},
|
||||
fail: (res) => {
|
||||
if (fail) success(fail);
|
||||
if (fail) fail(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -233,7 +233,7 @@ export function getOperation(zoneId, callback) {
|
||||
} = item;
|
||||
arrRegionID.push(regionId);
|
||||
const scolor = "#578FD4";
|
||||
const fcolor = "rgba(192,218,245,0.3)";
|
||||
const fcolor = "#c0daf54d";
|
||||
if (shapeType == 1) {
|
||||
const {
|
||||
longitude: lng,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user