|
@ -5,12 +5,7 @@ |
|
|
<div class="searchText"> |
|
|
<div class="searchText"> |
|
|
<img src="/src/assets/highScore/searchIcon.png" /> |
|
|
<img src="/src/assets/highScore/searchIcon.png" /> |
|
|
<div style="margin-bottom: 10%"> |
|
|
<div style="margin-bottom: 10%"> |
|
|
<a-input |
|
|
<a-input v-model:value="keyword" :bordered="false" placeholder="搜索" class="custom-textarea" /> |
|
|
v-model:value="keyword" |
|
|
|
|
|
:bordered="false" |
|
|
|
|
|
placeholder="搜索" |
|
|
|
|
|
class="custom-textarea" |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -31,27 +26,23 @@ const searchValue = ref(); |
|
|
const boardRef = ref(); |
|
|
const boardRef = ref(); |
|
|
const devRef = ref(); |
|
|
const devRef = ref(); |
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
|
|
|
import { |
|
|
|
|
|
lineLayerData, |
|
|
|
|
|
lineLayerData1, |
|
|
|
|
|
lineLayerData2, |
|
|
|
|
|
pointData |
|
|
|
|
|
} from '../../views/highScore/dailyMonitoring/test'; |
|
|
const emit = defineEmits(['checkWarring', 'showModal']); |
|
|
const emit = defineEmits(['checkWarring', 'showModal']); |
|
|
// const emit1 = defineEmits(['showModal']); |
|
|
// const emit1 = defineEmits(['showModal']); |
|
|
const layerGroups = reactive<Record<string, { iconLayer: any; textLayer: any }>>({}); |
|
|
const layerGroups = reactive<Record<string, { iconLayer: any; textLayer: any; }>>({}); |
|
|
interface LayerConfig { |
|
|
interface LayerConfig { |
|
|
id: string; |
|
|
id: string; |
|
|
type: |
|
|
type: |
|
|
| 'road' |
|
|
|
|
|
| 'tunnel' |
|
|
|
|
|
| 'board' |
|
|
|
|
|
| 'fire' |
|
|
|
|
|
| 'device' |
|
|
|
|
|
| 'highWay' |
|
|
|
|
|
| 'explosives' |
|
|
|
|
|
| 'tourism' |
|
|
|
|
|
| 'ThreeShuttleBus' |
|
|
|
|
|
| 'fireWorks' |
|
|
|
|
|
| 'chemistryCar' |
|
|
|
|
|
| 'warn' |
|
|
| 'warn' |
|
|
| 'people' |
|
|
| 'people' |
|
|
| 'car' |
|
|
| 'car' |
|
|
| 'materials'; |
|
|
| 'emergency' |
|
|
|
|
|
| 'equipment'; |
|
|
data: any; |
|
|
data: any; |
|
|
style?: { |
|
|
style?: { |
|
|
color?: string; |
|
|
color?: string; |
|
@ -75,22 +66,13 @@ interface Props { |
|
|
tileUrl?: string; |
|
|
tileUrl?: string; |
|
|
amapKey?: string; |
|
|
amapKey?: string; |
|
|
tdtKey?: string; |
|
|
tdtKey?: string; |
|
|
roadLayer?: LayerConfig; |
|
|
|
|
|
tunnelLayer?: LayerConfig; |
|
|
|
|
|
boardLayer?: LayerConfig; |
|
|
|
|
|
fireLayer?: LayerConfig; |
|
|
|
|
|
deviceLayer?: LayerConfig; |
|
|
|
|
|
highWayLayer?: LayerConfig; |
|
|
|
|
|
explosivesLayer?: LayerConfig; |
|
|
|
|
|
tourismLayer?: LayerConfig; |
|
|
|
|
|
ThreeShuttleBusLayer?: LayerConfig; |
|
|
|
|
|
fireWorksLayer?: LayerConfig; |
|
|
|
|
|
chemistryCarLayer?: LayerConfig; |
|
|
|
|
|
lineLayer?: LayerConfig; |
|
|
lineLayer?: LayerConfig; |
|
|
warnLayer?: LayerConfig; |
|
|
warnLayer?: LayerConfig; |
|
|
peopleLayer?: LayerConfig; |
|
|
peopleLayer?: LayerConfig; |
|
|
carLayer?: LayerConfig; |
|
|
carLayer?: LayerConfig; |
|
|
materialsLayer?: LayerConfig; |
|
|
materialsLayer?: LayerConfig; |
|
|
|
|
|
equipmentLayer?: LayerConfig; |
|
|
|
|
|
emergencyLayer?: LayerConfig; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), { |
|
|
const props = withDefaults(defineProps<Props>(), { |
|
@ -125,38 +107,91 @@ const initL7Map = async () => { |
|
|
parser: { type: 'rasterTile', tileSize: 256, dataType: 'image' }, |
|
|
parser: { type: 'rasterTile', tileSize: 256, dataType: 'image' }, |
|
|
}); |
|
|
}); |
|
|
scene.value?.addLayer(baseLayer); |
|
|
scene.value?.addLayer(baseLayer); |
|
|
} |
|
|
|
|
|
//圆圈 |
|
|
//名字 |
|
|
if (props.warnLayer) { |
|
|
const layer = new PointLayer() |
|
|
const pointLayer = new PointLayer() |
|
|
.source(pointData.features, { |
|
|
.source({ |
|
|
parser: { |
|
|
type: 'FeatureCollection', |
|
|
type: 'json', |
|
|
features: [ |
|
|
x: 'j', |
|
|
{ |
|
|
y: 'w', |
|
|
type: 'Feature', |
|
|
|
|
|
properties: {}, |
|
|
|
|
|
geometry: { |
|
|
|
|
|
type: 'Point', |
|
|
|
|
|
coordinates: [106.5488177260367, 29.58682303545917], |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
.shape('square') |
|
|
|
|
|
.color('backgoundColor') |
|
|
|
|
|
.size(50); |
|
|
|
|
|
scene.value.addLayer(layer); |
|
|
|
|
|
|
|
|
|
|
|
const textLayer = new PointLayer({}) |
|
|
|
|
|
.source(pointData.features, { |
|
|
|
|
|
parser: { |
|
|
|
|
|
type: 'json', |
|
|
|
|
|
x: 'j', |
|
|
|
|
|
y: 'w', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
|
|
|
}) |
|
|
}) |
|
|
.shape('circle') |
|
|
.shape('m', 'text') |
|
|
.size(230) // 圆圈直径(像素) |
|
|
.size(30) |
|
|
.color('#045697') // 填充颜色 |
|
|
.color('black') |
|
|
.style({ |
|
|
.style({ |
|
|
stroke: '#04c4cb', // 边框颜色 |
|
|
textAnchor: 'center', |
|
|
strokeWidth: 3, // 边框宽度 |
|
|
textOffset: [2, -5], |
|
|
opacity: 0.5, // 透明度 |
|
|
spacing: 2, |
|
|
|
|
|
padding: [1, 1], |
|
|
|
|
|
stroke: 'black', |
|
|
|
|
|
strokeWidth: 0.3, |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
fontFamily: 'Times New Roman', |
|
|
|
|
|
textAllowOverlap: true, |
|
|
}); |
|
|
}); |
|
|
scene.value?.addLayer(pointLayer); |
|
|
scene.value.addLayer(textLayer); |
|
|
|
|
|
|
|
|
|
|
|
// const lineLayer = new LineLayer({ |
|
|
|
|
|
// name: 'lineLayer', |
|
|
|
|
|
// visible: true, |
|
|
|
|
|
// }) |
|
|
|
|
|
// .source(lineLayerData) |
|
|
|
|
|
// .size(5) |
|
|
|
|
|
// .color('color') |
|
|
|
|
|
// .style({ |
|
|
|
|
|
// opacity: 1, |
|
|
|
|
|
// }); |
|
|
|
|
|
// scene.value.addLayer(lineLayer); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const lineLayer1 = new LineLayer({ |
|
|
|
|
|
// name: 'lineLayer', |
|
|
|
|
|
// visible: true, |
|
|
|
|
|
// }) |
|
|
|
|
|
// .source(lineLayerData1) |
|
|
|
|
|
// .size(5) |
|
|
|
|
|
// .color('color') |
|
|
|
|
|
// .style({ |
|
|
|
|
|
// opacity: 1, |
|
|
|
|
|
// }); |
|
|
|
|
|
// scene.value.addLayer(lineLayer1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const lineLayer2 = new LineLayer({ |
|
|
|
|
|
// name: 'lineLayer', |
|
|
|
|
|
// visible: true, |
|
|
|
|
|
// }) |
|
|
|
|
|
// .source(lineLayerData2) |
|
|
|
|
|
// .size(5) |
|
|
|
|
|
// .style({ |
|
|
|
|
|
// opacity: 1, |
|
|
|
|
|
// sourceColor: '#00887f', |
|
|
|
|
|
// targetColor: '#00887f', |
|
|
|
|
|
// linearDir: 'horizontal', |
|
|
|
|
|
// }); |
|
|
|
|
|
// scene.value.addLayer(lineLayer2); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 2. 事件图层 |
|
|
// 2. 事件图层 |
|
|
if (props.warnLayer) { |
|
|
if (props.warnLayer) { |
|
|
await scene.value.addImage( |
|
|
await scene.value.addImage( |
|
|
'warn-icon', |
|
|
'warn-icon', |
|
|
new URL('@/assets/coordinated/warnicon.png', import.meta.url).href, |
|
|
new URL('@/assets/highScore/eventLanyer.png', import.meta.url).href, |
|
|
); |
|
|
); |
|
|
const warnLayer = new PointLayer({ |
|
|
const warnLayer = new PointLayer({ |
|
|
zIndex: props.warnLayer.style?.zIndex || 1, |
|
|
zIndex: props.warnLayer.style?.zIndex || 1, |
|
@ -175,30 +210,36 @@ const initL7Map = async () => { |
|
|
.size(props.warnLayer.style?.size || 2); |
|
|
.size(props.warnLayer.style?.size || 2); |
|
|
scene.value?.addLayer(warnLayer); |
|
|
scene.value?.addLayer(warnLayer); |
|
|
warnLayer.on('click', e => { |
|
|
warnLayer.on('click', e => { |
|
|
console.log('事件图层', e); |
|
|
// console.log('事件图层', e); |
|
|
emit('showModal'); |
|
|
// emit('showModal'); |
|
|
}); |
|
|
}); |
|
|
layerInstances['warnLayer'] = warnLayer; |
|
|
layerInstances['warnLayer'] = warnLayer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 3. 人员图层 |
|
|
// 3. 设备图层 |
|
|
if (props.peopleLayer) { |
|
|
if (props.equipmentLayer) { |
|
|
await scene.value.addImage( |
|
|
await scene.value.addImage( |
|
|
'people-icon', |
|
|
'equipmentLayer-icon', |
|
|
new URL('@/assets/coordinated/people.png', import.meta.url).href, |
|
|
new URL('@/assets/highScore/equipmentLanyer.png', import.meta.url).href, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const peopleLayer = new PointLayer({ |
|
|
const equipmentLayer = new PointLayer({ |
|
|
zIndex: props.peopleLayer.style?.zIndex || 2, |
|
|
zIndex: props.equipmentLayer.style?.zIndex || 2, |
|
|
name: 'people-layer', |
|
|
name: 'equipmentLayer-layer', |
|
|
visible: true, |
|
|
visible: true, |
|
|
}) |
|
|
}) |
|
|
.source(props.peopleLayer.data) |
|
|
.source(props.equipmentLayer.data, { |
|
|
.shape('people-icon') |
|
|
parser: { |
|
|
.size(props.peopleLayer.style?.size || 50); |
|
|
type: 'json', |
|
|
scene.value?.addLayer(peopleLayer); |
|
|
x: 'lng', |
|
|
layerInstances['peopleLayer'] = peopleLayer; |
|
|
y: 'lat', |
|
|
peopleLayer.on('click', e => { |
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
.shape('equipmentLayer-icon') |
|
|
|
|
|
.size(props.equipmentLayer.style?.size || 50); |
|
|
|
|
|
scene.value?.addLayer(equipmentLayer); |
|
|
|
|
|
layerInstances['equipmentLayer'] = equipmentLayer; |
|
|
|
|
|
equipmentLayer.on('click', e => { |
|
|
emit('showModal'); |
|
|
emit('showModal'); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -207,7 +248,7 @@ const initL7Map = async () => { |
|
|
if (props.carLayer) { |
|
|
if (props.carLayer) { |
|
|
await scene.value.addImage( |
|
|
await scene.value.addImage( |
|
|
'car-icon', |
|
|
'car-icon', |
|
|
new URL('@/assets/coordinated/car.png', import.meta.url).href, |
|
|
new URL('@/assets/highScore/carLanyer.png', import.meta.url).href, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const carLayer = new PointLayer({ |
|
|
const carLayer = new PointLayer({ |
|
@ -215,7 +256,13 @@ const initL7Map = async () => { |
|
|
name: 'car-layer', |
|
|
name: 'car-layer', |
|
|
visible: true, |
|
|
visible: true, |
|
|
}) |
|
|
}) |
|
|
.source(props.carLayer.data) |
|
|
.source(props.carLayer.data,{ |
|
|
|
|
|
parser: { |
|
|
|
|
|
type: 'json', |
|
|
|
|
|
x: 'lng', |
|
|
|
|
|
y: 'lat', |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
.shape('car-icon') |
|
|
.shape('car-icon') |
|
|
.size(props.carLayer.style?.size || 15) |
|
|
.size(props.carLayer.style?.size || 15) |
|
|
.style({ |
|
|
.style({ |
|
@ -228,522 +275,32 @@ const initL7Map = async () => { |
|
|
layerInstances['carLayer'] = carLayer; |
|
|
layerInstances['carLayer'] = carLayer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 5. 物资图层 |
|
|
// 5. 应急措施图层 |
|
|
if (props.materialsLayer) { |
|
|
if (props.emergencyLayer) { |
|
|
await scene.value.addImage( |
|
|
|
|
|
'materials-icon', |
|
|
|
|
|
new URL('@/assets/coordinated/Materials.png', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const materialsLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.materialsLayer.style?.zIndex || 5, |
|
|
|
|
|
name: 'materials-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.materialsLayer.data) |
|
|
|
|
|
.shape('materials-icon') |
|
|
|
|
|
.size(props.materialsLayer.style?.size || 25) |
|
|
|
|
|
.animate({ |
|
|
|
|
|
enable: true, |
|
|
|
|
|
speed: 1, |
|
|
|
|
|
rings: 3, |
|
|
|
|
|
}); |
|
|
|
|
|
scene.value?.addLayer(materialsLayer); |
|
|
|
|
|
materialsLayer.on('click', e => { |
|
|
|
|
|
emit('showModal'); |
|
|
|
|
|
}); |
|
|
|
|
|
layerInstances['materialsLayer'] = materialsLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 2. 公路图层(线图层) |
|
|
|
|
|
if (props.roadLayer) { |
|
|
|
|
|
const roadLayer = new LineLayer({ |
|
|
|
|
|
zIndex: props.roadLayer.style?.zIndex || 1, |
|
|
|
|
|
name: 'road-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.roadLayer.data) |
|
|
|
|
|
.size(props.roadLayer.style?.size || 2) |
|
|
|
|
|
.color(props.roadLayer.style?.color || '#4a7af0'); |
|
|
|
|
|
scene.value?.addLayer(roadLayer); |
|
|
|
|
|
layerInstances['lineLayer'] = roadLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 3. 隧道图层(点图层+文字标注) |
|
|
|
|
|
if (props.tunnelLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'tunnel-icon', |
|
|
|
|
|
new URL('@/assets/images/traffic/point/tunnel.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const tunnelLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.tunnelLayer.style?.zIndex || 2, |
|
|
|
|
|
name: 'tunnel-layer', |
|
|
|
|
|
visible: false, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.tunnelLayer.data) |
|
|
|
|
|
.shape('tunnel-icon') |
|
|
|
|
|
.size(props.tunnelLayer.style?.size || 50); |
|
|
|
|
|
scene.value?.addLayer(tunnelLayer); |
|
|
|
|
|
layerInstances['tunnelLayer'] = tunnelLayer; |
|
|
|
|
|
tunnelLayer.on('click', e => { |
|
|
|
|
|
console.log('隧道图层', e); |
|
|
|
|
|
router.push('/tunnel/' + e.feature.id); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 4. 情报板图层 |
|
|
|
|
|
if (props.boardLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'board-icon', |
|
|
|
|
|
new URL('@/assets/images/traffic/point/board.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const boardLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.boardLayer.style?.zIndex || 4, |
|
|
|
|
|
name: 'board-layer', |
|
|
|
|
|
visible: false, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.boardLayer.data) |
|
|
|
|
|
.shape('board-icon') |
|
|
|
|
|
.size(props.boardLayer.style?.size || 15) |
|
|
|
|
|
.style({ |
|
|
|
|
|
offsets: [0, 20], |
|
|
|
|
|
}); |
|
|
|
|
|
scene.value?.addLayer(boardLayer); |
|
|
|
|
|
boardLayer.on('click', e => { |
|
|
|
|
|
console.log('情报板图层', e); |
|
|
|
|
|
boardRef.value.open = true; |
|
|
|
|
|
}); |
|
|
|
|
|
layerInstances['boardLayer'] = boardLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 5. 火灾图层 |
|
|
|
|
|
if (props.fireLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'fire-icon', |
|
|
|
|
|
new URL('@/assets/images/traffic/point/fire.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const fireLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.fireLayer.style?.zIndex || 5, |
|
|
|
|
|
name: 'fire-layer', |
|
|
|
|
|
visible: false, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.fireLayer.data) |
|
|
|
|
|
.shape('fire-icon') |
|
|
|
|
|
.size(props.fireLayer.style?.size || 25) |
|
|
|
|
|
.animate({ |
|
|
|
|
|
enable: true, |
|
|
|
|
|
speed: 1, |
|
|
|
|
|
rings: 3, |
|
|
|
|
|
}); |
|
|
|
|
|
scene.value?.addLayer(fireLayer); |
|
|
|
|
|
fireLayer.on('click', e => { |
|
|
|
|
|
console.log('监控', e); |
|
|
|
|
|
devRef.value.open = true; |
|
|
|
|
|
}); |
|
|
|
|
|
layerInstances['fireLayer'] = fireLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 6. 隧道分布器图层 |
|
|
|
|
|
if (props.deviceLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
await scene.value.addImage( |
|
|
'device-icon', |
|
|
'emergency-icon', |
|
|
new URL('@/assets/images/traffic/point/device.svg', import.meta.url).href, |
|
|
new URL('@/assets/highScore/emergencyLanyer.png', import.meta.url).href, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const deviceLayer = new PointLayer({ |
|
|
const emergencyLayer = new PointLayer({ |
|
|
zIndex: props.deviceLayer.style?.zIndex || 6, |
|
|
zIndex: props.emergencyLayer.style?.zIndex || 5, |
|
|
name: 'device-layer', |
|
|
name: 'emergency-layer', |
|
|
visible: false, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.deviceLayer.data) |
|
|
|
|
|
.shape('device-icon') |
|
|
|
|
|
.size(props.deviceLayer.style?.size || 15); |
|
|
|
|
|
scene.value?.addLayer(deviceLayer); |
|
|
|
|
|
deviceLayer.on('click', e => { |
|
|
|
|
|
console.log('监控', e); |
|
|
|
|
|
devRef.value.open = true; |
|
|
|
|
|
}); |
|
|
|
|
|
layerInstances['deviceLayer'] = deviceLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//7.高速公路文字标注图层 |
|
|
|
|
|
if (props.highWayLayer) { |
|
|
|
|
|
// await scene.value.addImage( |
|
|
|
|
|
// 'highWay-icon', |
|
|
|
|
|
// new URL('@/assets/images/watch/blueBg.png', import.meta.url).href, |
|
|
|
|
|
// ); |
|
|
|
|
|
const layer = new PointLayer({ |
|
|
|
|
|
zIndex: props.highWayLayer.style?.zIndex || 7, |
|
|
|
|
|
name: 'highWay-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.highWayLayer.data.list, { |
|
|
|
|
|
parser: { |
|
|
|
|
|
type: 'json', |
|
|
|
|
|
x: 'j', |
|
|
|
|
|
y: 'w', |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
.shape('square') |
|
|
|
|
|
.color('c') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.style({ |
|
|
|
|
|
stroke: 'white', |
|
|
|
|
|
strokeWidth: 0.5, |
|
|
|
|
|
}); |
|
|
|
|
|
scene.value?.addLayer(layer); |
|
|
|
|
|
|
|
|
|
|
|
const highWayLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.highWayLayer.style?.zIndex || 7, |
|
|
|
|
|
name: 'highWay-layer', |
|
|
|
|
|
visible: true, |
|
|
visible: true, |
|
|
}) |
|
|
}) |
|
|
|
|
|
.source(props.emergencyLayer.data,{ |
|
|
.source(props.highWayLayer.data.list, { |
|
|
|
|
|
parser: { |
|
|
|
|
|
type: 'json', |
|
|
|
|
|
x: 'j', |
|
|
|
|
|
y: 'w', |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
.shape('m', 'text') |
|
|
|
|
|
// .shape('highWay-icon') |
|
|
|
|
|
.size(props.highWayLayer.style?.size || 15) |
|
|
|
|
|
.color('f') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textAnchor: 'center', |
|
|
|
|
|
textOffset: [0, 0], |
|
|
|
|
|
spacing: 2, |
|
|
|
|
|
padding: [1, 1], |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
scene.value?.addLayer(highWayLayer); |
|
|
|
|
|
|
|
|
|
|
|
// const highWayLayer1 = new PointLayer({ |
|
|
|
|
|
// zIndex: props.highWayLayer.style?.zIndex || 7, |
|
|
|
|
|
// name: 'highWay-layer', |
|
|
|
|
|
// visible: true, |
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
|
|
|
|
// .source(props.highWayLayer.data.list, { |
|
|
|
|
|
// parser: { |
|
|
|
|
|
// type: 'json', |
|
|
|
|
|
// x: 'j', |
|
|
|
|
|
// y: 'w', |
|
|
|
|
|
// }, |
|
|
|
|
|
// }) |
|
|
|
|
|
// .shape('m', 'text') |
|
|
|
|
|
// .size(12) |
|
|
|
|
|
// .color('f') |
|
|
|
|
|
// .style({ |
|
|
|
|
|
// textAnchor: 'center', |
|
|
|
|
|
// textOffset: [0, 0], |
|
|
|
|
|
// spacing: 2, |
|
|
|
|
|
// padding: [1, 1], |
|
|
|
|
|
// strokeOpacity: 1.0, |
|
|
|
|
|
// }); |
|
|
|
|
|
// scene.value?.addLayer(highWayLayer1); |
|
|
|
|
|
layerInstances['highWayLayer'] = highWayLayer; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//8.民用爆炸品专用车图层 |
|
|
|
|
|
if (props.explosivesLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'explosives-icon', |
|
|
|
|
|
new URL('@/assets/images/danger/point/1.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const iconLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.explosivesLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'explosives-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.explosivesLayer.data) |
|
|
|
|
|
.shape('explosives-icon') |
|
|
|
|
|
.size(props.explosivesLayer.style?.size || 15); |
|
|
|
|
|
|
|
|
|
|
|
const textLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.explosivesLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'explosives-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.explosivesLayer.data) |
|
|
|
|
|
.shape('text') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.color('#026b88') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textOffset: [5, 70], // 文本相对锚点的偏移量 [水平, 垂直] |
|
|
|
|
|
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left |
|
|
|
|
|
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 |
|
|
|
|
|
stroke: '#00DCFF', // 描边颜色 |
|
|
|
|
|
strokeWidth: 0.5, // 描边宽度 |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
// 添加到场景 |
|
|
|
|
|
scene.value?.addLayer(iconLayer); |
|
|
|
|
|
scene.value?.addLayer(textLayer); |
|
|
|
|
|
iconLayer.on('click', e => { |
|
|
|
|
|
emit('checkWarring'); |
|
|
|
|
|
}); |
|
|
|
|
|
// 保存图层组 |
|
|
|
|
|
layerGroups['explosivesLayer'] = { |
|
|
|
|
|
iconLayer, |
|
|
|
|
|
textLayer, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//9.旅游包车图层 |
|
|
|
|
|
if (props.tourismLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'tourism-icon', |
|
|
|
|
|
new URL('@/assets/images/danger/point/2.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const iconLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.tourismLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'tourism-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.tourismLayer.data) |
|
|
|
|
|
.shape('tourism-icon') |
|
|
|
|
|
.size(props.tourismLayer.style?.size || 15); |
|
|
|
|
|
const textLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.tourismLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'tourism-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.tourismLayer.data) |
|
|
|
|
|
.shape('text') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.color('#023d7d') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textOffset: [5, 70], // 文本相对锚点的偏移量 [水平, 垂直] |
|
|
|
|
|
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left |
|
|
|
|
|
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 |
|
|
|
|
|
stroke: '#0276b6', // 描边颜色 |
|
|
|
|
|
strokeWidth: 0.5, // 描边宽度 |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
// 添加到场景 |
|
|
|
|
|
scene.value?.addLayer(iconLayer); |
|
|
|
|
|
scene.value?.addLayer(textLayer); |
|
|
|
|
|
iconLayer.on('click', e => { |
|
|
|
|
|
emit('checkWarring'); |
|
|
|
|
|
}); |
|
|
|
|
|
// 保存图层组 |
|
|
|
|
|
layerGroups['tourismLayer'] = { |
|
|
|
|
|
iconLayer, |
|
|
|
|
|
textLayer, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//10.三类以上班线客车 |
|
|
|
|
|
if (props.ThreeShuttleBusLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'ThreeShuttleBus-icon', |
|
|
|
|
|
new URL('@/assets/images/danger/point/3.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const iconLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.ThreeShuttleBusLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'Three-shuttle-bus-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.ThreeShuttleBusLayer.data) |
|
|
|
|
|
.shape('ThreeShuttleBus-icon') |
|
|
|
|
|
.size(props.ThreeShuttleBusLayer.style?.size || 15); |
|
|
|
|
|
const textLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.ThreeShuttleBusLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'Three-shuttle-bus-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.ThreeShuttleBusLayer.data) |
|
|
|
|
|
.shape('text') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.color('#028978') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textOffset: [5, 70], // 文本相对锚点的偏移量 [水平, 垂直] |
|
|
|
|
|
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left |
|
|
|
|
|
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 |
|
|
|
|
|
stroke: '#03a583', // 描边颜色 |
|
|
|
|
|
strokeWidth: 0.5, // 描边宽度 |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
// 添加到场景 |
|
|
|
|
|
scene.value?.addLayer(iconLayer); |
|
|
|
|
|
scene.value?.addLayer(textLayer); |
|
|
|
|
|
iconLayer.on('click', e => { |
|
|
|
|
|
emit('checkWarring'); |
|
|
|
|
|
}); |
|
|
|
|
|
// 保存图层组 |
|
|
|
|
|
layerGroups['ThreeShuttleBusLayer'] = { |
|
|
|
|
|
iconLayer, |
|
|
|
|
|
textLayer, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//11.烟花爆竹专用车 |
|
|
|
|
|
if (props.fireWorksLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'fireWorks-icon', |
|
|
|
|
|
new URL('@/assets/images/danger/point/4.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const iconLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.fireWorksLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'fire-works-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.fireWorksLayer.data) |
|
|
|
|
|
.shape('fireWorks-icon') |
|
|
|
|
|
.size(props.fireWorksLayer.style?.size || 15); |
|
|
|
|
|
|
|
|
|
|
|
const textLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.fireWorksLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'fire-works-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.fireWorksLayer.data) |
|
|
|
|
|
.shape('text') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.color('#864a05') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textOffset: [5, 70], // 文本相对锚点的偏移量 [水平, 垂直] |
|
|
|
|
|
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left |
|
|
|
|
|
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 |
|
|
|
|
|
stroke: '#ba7b3d', // 描边颜色 |
|
|
|
|
|
strokeWidth: 0.5, // 描边宽度 |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
// 添加到场景 |
|
|
|
|
|
scene.value?.addLayer(iconLayer); |
|
|
|
|
|
scene.value?.addLayer(textLayer); |
|
|
|
|
|
iconLayer.on('click', e => { |
|
|
|
|
|
emit('checkWarring'); |
|
|
|
|
|
}); |
|
|
|
|
|
// 保存图层组 |
|
|
|
|
|
layerGroups['fireWorksLayer'] = { |
|
|
|
|
|
iconLayer, |
|
|
|
|
|
textLayer, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//12.危险化学品专用车 |
|
|
|
|
|
if (props.chemistryCarLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'chemistryCar-icon', |
|
|
|
|
|
new URL('@/assets/images/danger/point/5.svg', import.meta.url).href, |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const iconLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.chemistryCarLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'chemistry-car-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.chemistryCarLayer.data) |
|
|
|
|
|
.shape('chemistryCar-icon') |
|
|
|
|
|
.size(props.chemistryCarLayer.style?.size || 15); |
|
|
|
|
|
|
|
|
|
|
|
const textLayer = new PointLayer({ |
|
|
|
|
|
zIndex: props.chemistryCarLayer.style?.zIndex || 6, |
|
|
|
|
|
name: 'chemistry-car-layer', |
|
|
|
|
|
visible: true, |
|
|
|
|
|
}) |
|
|
|
|
|
.source(props.chemistryCarLayer.data) |
|
|
|
|
|
.shape('text') |
|
|
|
|
|
.size(15) |
|
|
|
|
|
.color('#902506') |
|
|
|
|
|
.style({ |
|
|
|
|
|
textOffset: [5, 70], // 文本相对锚点的偏移量 [水平, 垂直] |
|
|
|
|
|
textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left |
|
|
|
|
|
padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 |
|
|
|
|
|
stroke: '#c84724', // 描边颜色 |
|
|
|
|
|
strokeWidth: 0.5, // 描边宽度 |
|
|
|
|
|
strokeOpacity: 1.0, |
|
|
|
|
|
}); |
|
|
|
|
|
// 添加到场景 |
|
|
|
|
|
scene.value?.addLayer(iconLayer); |
|
|
|
|
|
scene.value?.addLayer(textLayer); |
|
|
|
|
|
iconLayer.on('click', e => { |
|
|
|
|
|
emit('checkWarring'); |
|
|
|
|
|
}); |
|
|
|
|
|
// 保存图层组 |
|
|
|
|
|
layerGroups['chemistryCarLayer'] = { |
|
|
|
|
|
iconLayer, |
|
|
|
|
|
textLayer, |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 13.3D弧线 |
|
|
|
|
|
if (props.lineLayer) { |
|
|
|
|
|
await scene.value.addImage( |
|
|
|
|
|
'marker', |
|
|
|
|
|
'https://gw.alipayobjects.com/mdn/antv_site/afts/img/A*BJ6cTpDcuLcAAAAAAAAAAABkARQnAQ', |
|
|
|
|
|
); |
|
|
|
|
|
const data = { |
|
|
|
|
|
type: 'FeatureCollection', |
|
|
|
|
|
features: [ |
|
|
|
|
|
{ |
|
|
|
|
|
type: 'Feature', |
|
|
|
|
|
geometry: { |
|
|
|
|
|
type: 'Point', |
|
|
|
|
|
coordinates: [106.5828177260367, 29.55982303545917], |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}; |
|
|
|
|
|
const imageLayer = new PointLayer().source(data).shape('marker').size(20).style({ |
|
|
|
|
|
zIndex: 10, |
|
|
|
|
|
}); |
|
|
|
|
|
const layer = new LineLayer({}) |
|
|
|
|
|
.source(props.lineLayer.data, { |
|
|
|
|
|
parser: { |
|
|
|
|
|
type: 'json', |
|
|
|
|
|
x: 'lng1', |
|
|
|
|
|
y: 'lat1', |
|
|
|
|
|
x1: 'lng2', |
|
|
|
|
|
y1: 'lat2', |
|
|
|
|
|
z: 'height', // 使用高度字段 |
|
|
|
|
|
}, |
|
|
|
|
|
}) |
|
|
|
|
|
.size(2) |
|
|
|
|
|
.shape('arc3d') |
|
|
|
|
|
.color('#dfe2b4') |
|
|
|
|
|
.style({ |
|
|
|
|
|
zIndex: 1, |
|
|
|
|
|
curvature: 3.0, |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 提取所有终点坐标 |
|
|
|
|
|
const endPoints = props.lineLayer.data.map(item => ({ |
|
|
|
|
|
lng: item.lng2, |
|
|
|
|
|
lat: item.lat2, |
|
|
|
|
|
name: item.name, |
|
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
|
|
// 添加终点圆点图层 |
|
|
|
|
|
const endPointLayer = new PointLayer() |
|
|
|
|
|
.source(endPoints, { |
|
|
|
|
|
parser: { |
|
|
parser: { |
|
|
type: 'json', |
|
|
type: 'json', |
|
|
x: 'lng', |
|
|
x: 'lng', |
|
|
y: 'lat', |
|
|
y: 'lat', |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |
|
|
.shape('circle') |
|
|
.shape('emergency-icon') |
|
|
.size(8) |
|
|
.size(props.emergencyLayer.style?.size || 25) |
|
|
.color('#5289d2') |
|
|
scene.value?.addLayer(emergencyLayer); |
|
|
.style({ |
|
|
emergencyLayer.on('click', e => { |
|
|
stroke: '#FFF', |
|
|
emit('showModal'); |
|
|
strokeWidth: 2, |
|
|
|
|
|
zIndex: 10, |
|
|
|
|
|
}); |
|
|
}); |
|
|
scene.value?.addLayer(imageLayer); |
|
|
layerInstances['emergencyLayer'] = emergencyLayer; |
|
|
scene.value?.addLayer(endPointLayer); |
|
|
|
|
|
scene.value?.addLayer(layer); |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
@ -788,12 +345,14 @@ onBeforeUnmount(() => { |
|
|
left: 7%; |
|
|
left: 7%; |
|
|
width: 6000px; |
|
|
width: 6000px; |
|
|
height: 2500px; |
|
|
height: 2500px; |
|
|
border-radius: 15% / 50%; /* 使边框变成椭圆形,横轴和纵轴不同的比例 */ |
|
|
border-radius: 15% / 50%; |
|
|
overflow: hidden; /* 防止内容溢出 */ |
|
|
/* 使边框变成椭圆形,横轴和纵轴不同的比例 */ |
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
/* 防止内容溢出 */ |
|
|
position: relative; |
|
|
position: relative; |
|
|
filter: brightness(0.88) contrast(1.22) grayscale(0) hue-rotate(360deg) opacity(1) saturate(1.1) |
|
|
filter: brightness(0.88) contrast(1.22) grayscale(0) hue-rotate(360deg) opacity(1) saturate(1.1) sepia(0.54) invert(0.9); |
|
|
sepia(0.54) invert(0.9); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.map-search-input { |
|
|
.map-search-input { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
z-index: 999; |
|
|
z-index: 999; |
|
@ -814,6 +373,7 @@ onBeforeUnmount(() => { |
|
|
background: url('/src/assets/highScore/searchBg.png') no-repeat 0 0/100% 100%; |
|
|
background: url('/src/assets/highScore/searchBg.png') no-repeat 0 0/100% 100%; |
|
|
width: 250px; |
|
|
width: 250px; |
|
|
height: 32px; |
|
|
height: 32px; |
|
|
|
|
|
|
|
|
.searchText { |
|
|
.searchText { |
|
|
width: 246px; |
|
|
width: 246px; |
|
|
height: 32px; |
|
|
height: 32px; |
|
@ -822,6 +382,7 @@ onBeforeUnmount(() => { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
top: 6%; |
|
|
top: 6%; |
|
|
left: 2%; |
|
|
left: 2%; |
|
|
|
|
|
|
|
|
img { |
|
|
img { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
top: 20%; |
|
|
top: 20%; |
|
@ -829,16 +390,19 @@ onBeforeUnmount(() => { |
|
|
width: 15px; |
|
|
width: 15px; |
|
|
height: 16px; |
|
|
height: 16px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
div { |
|
|
div { |
|
|
position: absolute; |
|
|
position: absolute; |
|
|
top: -10%; |
|
|
top: -10%; |
|
|
left: 8%; |
|
|
left: 8%; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.custom-textarea::placeholder { |
|
|
.custom-textarea::placeholder { |
|
|
color: white; |
|
|
color: white; |
|
|
opacity: 1; |
|
|
opacity: 1; |
|
|
font-size: 18px; |
|
|
font-size: 18px; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.ant-input { |
|
|
.ant-input { |
|
|
margin-bottom: 10px; |
|
|
margin-bottom: 10px; |
|
|
font-size: 18px; |
|
|
font-size: 18px; |
|
|