|
@@ -261,6 +261,8 @@ export default {
|
|
|
this.map.on('complete', () => {
|
|
this.map.on('complete', () => {
|
|
|
if (!this._isDestroyed) {
|
|
if (!this._isDestroyed) {
|
|
|
this.drawStaticRoutes();
|
|
this.drawStaticRoutes();
|
|
|
|
|
+ // 临时方案,实际项目中删除 按4:3:3比例提取故障、离线、降级坐标点并存储到localStorage
|
|
|
|
|
+ this.storeStatusCoordsToLocalStorage();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
@@ -514,6 +516,39 @@ export default {
|
|
|
|
|
|
|
|
toggleLegend() {
|
|
toggleLegend() {
|
|
|
this.legendVisible = !this.legendVisible;
|
|
this.legendVisible = !this.legendVisible;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 按4:3:3比例提取故障、离线、降级坐标点并存储到localStorage
|
|
|
|
|
+ storeStatusCoordsToLocalStorage() {
|
|
|
|
|
+ // 故障、离线、降级坐标点(按4:3:3比例)
|
|
|
|
|
+ const faultCoords = [
|
|
|
|
|
+ [116.723317, 39.907606],
|
|
|
|
|
+ [116.703624, 39.89801],
|
|
|
|
|
+ [116.661252, 39.924948],
|
|
|
|
|
+ [116.708958, 39.899609]
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ const offlineCoords = [
|
|
|
|
|
+ [116.677855, 39.895636],
|
|
|
|
|
+ [116.656673, 39.856063],
|
|
|
|
|
+ [116.656485, 39.90118]
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ const degradedCoords = [
|
|
|
|
|
+ [116.713356, 39.952856],
|
|
|
|
|
+ [116.665391, 39.934546],
|
|
|
|
|
+ [116.697784, 39.891312]
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ // 组合成10个元素的数组
|
|
|
|
|
+ const statusCoords = [...faultCoords, ...offlineCoords, ...degradedCoords];
|
|
|
|
|
+
|
|
|
|
|
+ // 存储到localStorage
|
|
|
|
|
+ statusCoords.forEach((coords, index) => {
|
|
|
|
|
+ localStorage.setItem(`pos${index + 1}`, coords.join(','));
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log('状态坐标已存储到localStorage');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|