Commit 4a1aa956 authored by 高晓帆's avatar 高晓帆

fix

parent 1c847bbd
{
"SERVICE_IP": "172.16.0.114:1234",
"MAP_CENTER": [39.74441007068,111.24544532751],
"version": "1.1.3"
}
\ No newline at end of file
{
"SERVICE_IP": "172.16.0.114:1234",
"MAP_CENTER": [39.74441007068,111.24544532751],
"version": "1.1.3"
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"SERVICE_IP": "172.16.0.130:1234",
"SERVICE_IP": "172.16.0.114:1234",
"MAP_CENTER": [39.74441007068,111.24544532751],
"version": "1.1.3"
}
\ No newline at end of file
......@@ -164,8 +164,8 @@ export default class DeckNew {
}
let layer = new PolygonLayer(Object.assign(defalutOprion, option));
this.setLayerSortName('polygonLayer', layerName)
this.removeLayer('polygon', layerName)
this.polygonLayers.push(layer)
this.removeLayer('map', layerName)
this.mapLayers.push(layer)
this.initLayer()
}
createPathLayer(data, option, layerName) {
......
......@@ -124,7 +124,7 @@ onMounted(() => {
canvas: 'map',
//如果deck滚动条滚动或者拖动地图时,不进行地图角度和等级矫正
onInteractionStateChange: f => {
if (!currentPosition) return
if (f.isZooming || f.isDragging) {
navigate.value = false
......@@ -135,7 +135,7 @@ onMounted(() => {
dealVehicleRotate()
currentRotation.value = BASE_RAD
clearTimeout(resetTime)
resetTime=null;
resetTime = null;
}
}, reNavigateTime)
}
......@@ -305,19 +305,24 @@ function dealSafe(vehicleID, safe) {
let zIndex = 16
for (let i = 0; i < dealedData.length; i++) {
let item = JSON.parse(JSON.stringify(dealedData[i]))
let layer = safeType === 'rectangle' ? map.creatPolygon({
coordinates: map.coorReverse(item),
}, {
getFillColor: d => map.convertColor(safe_color),
getLineColor: d => map.convertColor(safe_color),
getLineWidth: 1
}, 'rectangle'+i) : map.creatCircle([vehicleLongtitude, vehicleLatitude], {
getFillColor: f => map.convertColor(safe_color),
getLineColor: f => map.convertColor(safe_color),
getLineWidth: 1,
radius: data[i]
}, vehicleID+i)
safeObjects[vehicleID][i] = vehicleID
map.setLayerSortName('polygonLayer', vehicleID + i)
if (safeType === 'rectangle') {
map.creatPolygon({
coordinates: map.coorReverse(item),
}, {
getFillColor: d => map.convertColor(safe_color, 0.4),
getLineColor: d => map.convertColor(safe_color),
getLineWidth: 0.4
}, vehicleID + i)
} else {
map.creatCircle([vehicleLongtitude, vehicleLatitude], {
getFillColor: f => map.convertColor(safe_color, 0.4),
getLineColor: f => map.convertColor(safe_color),
getLineWidth: 0.4,
radius: data[i]
}, vehicleID + i)
}
safeObjects[vehicleID][i] = vehicleID + i
}
}
......@@ -392,23 +397,23 @@ function dealVehiclePosition(value) {
if (vehicles[vehicleID]) {
vehicles[vehicleID] = baseObj
} else {
vehicles[vehicleID] = baseObj
vehicles[vehicleID] = baseObj
}
if (vehicleID === deviceId.value) {
currentPosition = vehiclePosition
if (navigate.value) {
currentRotation.value = vehicleHeading
dealMapRotate(vehicleHeading, vehiclePosition, zoom <= MAP_ZOOM ? MAP_ZOOM : zoom)
}
}
}
}
}
initCar()
}
function initCar(){
function initCar() {
map.clearLayer('car')
const nameText = JSON.parse(JSON.stringify(Object.values(vehicles))).map(item => {
item.coordinates = [item.coordinates[0], item.coordinates[1], 10]
......@@ -620,7 +625,7 @@ watch(deleteVehicles, (data) => {
watch(() => props.clearSinglePointEnable, (enable) => {
if (!enable) return
isSinglePreview.value = true
singlePaths.forEach(item => map.removeLayer('map',item))
singlePaths.forEach(item => map.removeLayer('map', item))
}, { deep: true })
watch([morepoint, morepath], (pointData, pathData) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment