| | |
| | | |
| | | const store = useMyStore() |
| | | |
| | | const prefix = import.meta.env.VITE_MEDIAPANEL_API_URL |
| | | |
| | | const getResource = (name: string) => { |
| | | return new URL(`/src/assets/icons/${name}`, import.meta.url).href |
| | | } |
| | |
| | | * @return {*} void |
| | | */ |
| | | const readKmzFile = (kmzPath: string) => { |
| | | const [, address] = kmzPath.split('cloud-bucket') |
| | | return axios.get(import.meta.env.VITE_MEDIAPANEL_API_URL + address, { responseType: 'arraybuffer' }) |
| | | return axios.get(kmzPath, { responseType: 'arraybuffer' }) |
| | | .then(fileRes => fileRes.data) |
| | | .then(kmzData => JsZip.loadAsync(kmzData)) // 解压kmz文件 |
| | | .then(kmzZip => kmzZip) |
| | |
| | | const regx = /<Placemark>([\s\S]*?)<\/Placemark>/g |
| | | const points = content.match(regx) || [] |
| | | // 当前选中的点 |
| | | const currentPoint = points[currentPosition.value] |
| | | const currentPoint = points[currentPosition.value] || '' |
| | | const actionRegx = /<wpml:action>([\s\S]*?)<\/wpml:action>/g |
| | | const actionsKML = currentPoint.match(actionRegx) |
| | | btnList.value.forEach((sBtn: sBtn) => { |