| | |
| | | |
| | | const route = useRoute(); |
| | | const simStore = useSimStore(); |
| | | const backHome = ref(false); |
| | | |
| | | // 接收来自 ComponentA 的事件,并更新 isFlying |
| | | function handleBackToHome() { |
| | | backHome.value = false; |
| | | } |
| | | // 从 store 中解构需要的状态 |
| | | const { |
| | | flowShow, |
| | |
| | | } = storeToRefs(simStore); |
| | | const { init, startYHGL, startZHJC, startMNFZ, startMNPG } = simStore; |
| | | // 模拟的经纬度数组 |
| | | const coordinates = [ |
| | | [120.123456, 30.654321], |
| | | [120.234567, 30.765432], |
| | | [120.345678, 30.876543], |
| | | [120.123456, 30.654321] |
| | | const multiPolygonCoordinates = [ |
| | | [ |
| | | [120.123456, 30.654321], |
| | | [120.234567, 30.765432], |
| | | [120.345678, 30.876543], |
| | | [120.123456, 30.654321] // 闭合点 |
| | | ], |
| | | [ |
| | | [121.111111, 31.222222], |
| | | [121.333333, 31.444444], |
| | | [121.555555, 31.666666], |
| | | [121.111111, 31.222222] // 闭合点 |
| | | ] |
| | | ]; |
| | | |
| | | |
| | |
| | | setupTokenRefresh()// 获取宏图token |
| | | getData() //测试tr后端 |
| | | try { |
| | | const wktResult = convertToWKT(coordinates); |
| | | const wktResult = convertToWKT(multiPolygonCoordinates); |
| | | console.log(wktResult); |
| | | // 输出: MULTIPOLYGON(((120.123456 30.654321,120.234567 30.765432,120.345678 30.876543,120.123456 30.654321))) |
| | | } catch (error) { |