|
@@ -43,6 +43,7 @@ export default {
|
|
|
searchQuery: '', // 搜索内容绑定
|
|
searchQuery: '', // 搜索内容绑定
|
|
|
activeLegends: [],
|
|
activeLegends: [],
|
|
|
legendConfig: [
|
|
legendConfig: [
|
|
|
|
|
+ { type: 'all_selected', label: '全选', color: '#e5e5e5' },
|
|
|
{ type: 'center_plan', label: '中心计划', color: '#32c5ff' },
|
|
{ type: 'center_plan', label: '中心计划', color: '#32c5ff' },
|
|
|
{ type: 'trunk_coord', label: '干线协调', color: '#3ee68d' },
|
|
{ type: 'trunk_coord', label: '干线协调', color: '#3ee68d' },
|
|
|
{ type: 'service_route', label: '勤务路线', color: '#ffcc33' },
|
|
{ type: 'service_route', label: '勤务路线', color: '#ffcc33' },
|
|
@@ -104,9 +105,10 @@ export default {
|
|
|
// 4. 等待地图加载完成后执行路径规划
|
|
// 4. 等待地图加载完成后执行路径规划
|
|
|
this.map.on('complete', () => {
|
|
this.map.on('complete', () => {
|
|
|
console.log("地图加载完成,开始绘制真实路网...");
|
|
console.log("地图加载完成,开始绘制真实路网...");
|
|
|
|
|
+ this.initialized = true;
|
|
|
|
|
+ this.activeLegends = this.legendConfig.map(l => l.type);
|
|
|
this.drawStaticRoutes();
|
|
this.drawStaticRoutes();
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
} catch (err) {
|
|
} catch (err) {
|
|
|
console.error('地图加载失败:', err);
|
|
console.error('地图加载失败:', err);
|
|
|
}
|
|
}
|
|
@@ -231,6 +233,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handleLegendClick(type) {
|
|
handleLegendClick(type) {
|
|
|
|
|
+ if (type === 'all_selected') return this.toggleAll();
|
|
|
const isVisible = this.activeLegends.includes(type);
|
|
const isVisible = this.activeLegends.includes(type);
|
|
|
this.activeLegends = isVisible ? this.activeLegends.filter(t => t !== type) : [...this.activeLegends, type];
|
|
this.activeLegends = isVisible ? this.activeLegends.filter(t => t !== type) : [...this.activeLegends, type];
|
|
|
const group = this.overlayGroups[type];
|
|
const group = this.overlayGroups[type];
|