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