|
|
|
@ -872,6 +872,14 @@ export default { |
|
|
|
// 关闭弹窗 |
|
|
|
this.showPlatformDialog = false; |
|
|
|
}, |
|
|
|
/** 新建航线时写入数据库的默认样式(与地图默认显示一致:紫色实线线宽3) */ |
|
|
|
getDefaultRouteAttributes() { |
|
|
|
const defaultAttrs = { |
|
|
|
waypointStyle: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 }, |
|
|
|
lineStyle: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 } |
|
|
|
}; |
|
|
|
return JSON.stringify(defaultAttrs); |
|
|
|
}, |
|
|
|
/** 从航线 attributes JSON 解析出地图渲染用的样式对象 */ |
|
|
|
parseRouteStyle(attributes) { |
|
|
|
if (attributes == null || attributes === '') return null; |
|
|
|
@ -1088,25 +1096,31 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 构造数据(含盘旋航点的 pointType、holdParams;地图标签默认字号 14、颜色 #333333) |
|
|
|
const finalWaypoints = this.tempMapPoints.map((p, index) => ({ |
|
|
|
// 新建航线时:首尾航点转弯坡度固定为 0,中间可编辑航点默认 45° |
|
|
|
const wpCount = this.tempMapPoints.length; |
|
|
|
const finalWaypoints = this.tempMapPoints.map((p, index) => { |
|
|
|
const isFirstOrLast = index === 0 || index === wpCount - 1; |
|
|
|
const defaultTurnAngle = isFirstOrLast ? 0.0 : 45.0; |
|
|
|
return { |
|
|
|
name: p.name || `WP${index + 1}`, |
|
|
|
lat: p.lat, |
|
|
|
lng: p.lng, |
|
|
|
alt: p.alt != null ? p.alt : 5000.0, |
|
|
|
speed: p.speed != null ? p.speed : 800.0, |
|
|
|
startTime: p.startTime || 'K+00:00:00', |
|
|
|
turnAngle: p.turnAngle != null ? p.turnAngle : 0.0, |
|
|
|
turnAngle: p.turnAngle != null ? p.turnAngle : defaultTurnAngle, |
|
|
|
labelFontSize: p.labelFontSize != null ? p.labelFontSize : 14, |
|
|
|
labelColor: p.labelColor || '#333333', |
|
|
|
...(p.pointType && { pointType: p.pointType }), |
|
|
|
...(p.holdParams != null && { holdParams: typeof p.holdParams === 'string' ? p.holdParams : JSON.stringify(p.holdParams) }) |
|
|
|
})); |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
const routeData = { |
|
|
|
callSign: this.newRouteName, |
|
|
|
scenarioId: currentScenarioId, |
|
|
|
platformId: 1, |
|
|
|
attributes: "{}", |
|
|
|
attributes: this.getDefaultRouteAttributes(), |
|
|
|
waypoints: finalWaypoints |
|
|
|
}; |
|
|
|
|
|
|
|
|