| | |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-03-13 15:00:55 |
| | | * @FilePath: \forest-fire\src\views\statistics\components\box\dataContent.vue |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. |
| | | --> |
| | | <script setup> |
| | | import publicContent from "./publicContent.vue"; |
| | |
| | | // 行点击 |
| | | function rowClick(row) { |
| | | // 读取定位飞 |
| | | window.$viewer.zoomToPosition(new DC.Position( |
| | | Number(row.lng), |
| | | Number(row.lat), |
| | | 800, |
| | | 0, |
| | | -80, |
| | | 0 |
| | | ), () => { |
| | | }) |
| | | |
| | | let layer = new DC.VectorLayer('layer') |
| | | window.$viewer.addLayer(layer) |
| | | let positions = generatePosition(row.lng, row.lat) |
| | | let material = new DC.PolylineDashMaterialProperty({ |
| | | color: DC.Color.ORANGE |
| | | }) |
| | | positions.forEach(item => { |
| | | let label = new DC.CustomLabel( |
| | | item, |
| | | row.name |
| | | ) |
| | | label.setStyle({ |
| | | fillColor: DC.Color.YELLOW, |
| | | font: '12px', |
| | | pixelOffset: { x: 0, y: -10 } |
| | | }) |
| | | label.setVLine({ |
| | | width: 2, |
| | | material |
| | | }) |
| | | layer.addOverlay(label) |
| | | }) |
| | | } |
| | | function generatePosition(lng, lat) { |
| | | let list = [] |
| | | list.push(new DC.Position(lng, lat, 3000)) |
| | | return list |
| | | } |
| | | |
| | | // 查看详情 |