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