|
@@ -118,22 +118,22 @@ export default class AmapShapesManager {
|
|
|
let markers = new Array();
|
|
let markers = new Array();
|
|
|
let lines = []
|
|
let lines = []
|
|
|
|
|
|
|
|
- if (_hasLine(lineProps.dep)) {
|
|
|
|
|
- coordinates.push(_drawLineConfig(lineProps.dep.lat, lineProps.dep.lng));
|
|
|
|
|
- markers.push(_addOvalPointConfig(lineProps.dep.lat, lineProps.dep.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
|
|
|
|
+ if (this._hasLine(lineProps.dep)) {
|
|
|
|
|
+ coordinates.push(this._drawLineConfig(lineProps.dep.lat, lineProps.dep.lng));
|
|
|
|
|
+ markers.push(this._addOvalPointConfig(lineProps.dep.lat, lineProps.dep.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (Array.isArray(lineProps.passPoints)) {
|
|
if (Array.isArray(lineProps.passPoints)) {
|
|
|
for (let i = 0; i < lineProps.passPoints.length; i++) {
|
|
for (let i = 0; i < lineProps.passPoints.length; i++) {
|
|
|
let obj = lineProps.passPoints[i]
|
|
let obj = lineProps.passPoints[i]
|
|
|
- if (_isObject(obj)) {
|
|
|
|
|
|
|
+ if (this._isObject(obj)) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (obj.pointType == Global.pointTypes.point
|
|
if (obj.pointType == Global.pointTypes.point
|
|
|
|| obj.pointType == Global.pointTypes.nav) {
|
|
|| obj.pointType == Global.pointTypes.nav) {
|
|
|
- coordinates.push(_drawLineConfig(obj.lat, obj.lng));
|
|
|
|
|
- markers.push(_addOvalPointConfig(obj.lat, obj.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
|
|
|
|
+ coordinates.push(this._drawLineConfig(obj.lat, obj.lng));
|
|
|
|
|
+ markers.push(this._addOvalPointConfig(obj.lat, obj.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
} else {
|
|
} else {
|
|
|
// 遇到一个航线,不需要和前前面的点连起来
|
|
// 遇到一个航线,不需要和前前面的点连起来
|
|
|
if (coordinates.length > 1) {
|
|
if (coordinates.length > 1) {
|
|
@@ -149,14 +149,14 @@ export default class AmapShapesManager {
|
|
|
const pointBefore = i == 0 ? lineProps.dep : lineProps.passPoints[i - 1]
|
|
const pointBefore = i == 0 ? lineProps.dep : lineProps.passPoints[i - 1]
|
|
|
const pointAfter = i == lineProps.passPoints.length - 1 ? lineProps.arrive : lineProps.passPoints[i + 1]
|
|
const pointAfter = i == lineProps.passPoints.length - 1 ? lineProps.arrive : lineProps.passPoints[i + 1]
|
|
|
|
|
|
|
|
- lines.push(_getAirwayLine(obj, pointBefore, pointAfter, lineAndMarkerStyle))
|
|
|
|
|
|
|
+ lines.push(this._getAirwayLine(obj, pointBefore, pointAfter, lineAndMarkerStyle))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (_hasLine(lineProps.arrive)) {
|
|
|
|
|
- coordinates.push(_drawLineConfig(lineProps.arrive.lat, lineProps.arrive.lng));
|
|
|
|
|
- markers.push(_addOvalPointConfig(lineProps.arrive.lat, lineProps.arrive.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
|
|
|
|
+ if (this._hasLine(lineProps.arrive)) {
|
|
|
|
|
+ coordinates.push(this._drawLineConfig(lineProps.arrive.lat, lineProps.arrive.lng));
|
|
|
|
|
+ markers.push(this._addOvalPointConfig(lineProps.arrive.lat, lineProps.arrive.lng, lineAndMarkerStyle.imageName ? lineAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (coordinates.length > 1) {
|
|
if (coordinates.length > 1) {
|
|
@@ -181,7 +181,7 @@ export default class AmapShapesManager {
|
|
|
for (let i = 0; i < airspaceInfos.length; i++) {
|
|
for (let i = 0; i < airspaceInfos.length; i++) {
|
|
|
let tmpLine = airspaceInfos[i]
|
|
let tmpLine = airspaceInfos[i]
|
|
|
if (tmpLine.airspaceType == Global.airspaceType.line && currentAirspaceIndex != i) {
|
|
if (tmpLine.airspaceType == Global.airspaceType.line && currentAirspaceIndex != i) {
|
|
|
- let { lines, markers } = _getLinesRouter(tmpLine, lineStyle);
|
|
|
|
|
|
|
+ let { lines, markers } = this._getLinesRouter(tmpLine, lineStyle);
|
|
|
retMarkers.push(...markers);
|
|
retMarkers.push(...markers);
|
|
|
retLines.push(...lines);
|
|
retLines.push(...lines);
|
|
|
}
|
|
}
|
|
@@ -206,11 +206,11 @@ export default class AmapShapesManager {
|
|
|
|
|
|
|
|
if (Array.isArray(polygonProps.polygonPoints)) {
|
|
if (Array.isArray(polygonProps.polygonPoints)) {
|
|
|
for (let obj of polygonProps.polygonPoints) {
|
|
for (let obj of polygonProps.polygonPoints) {
|
|
|
- if (!_hasPoint(obj)) {
|
|
|
|
|
|
|
+ if (!this._hasPoint(obj)) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- coordinates.push(_drawLineConfig(obj.lat, obj.lng));
|
|
|
|
|
- markers.push(_addOvalPointConfig(obj.lat, obj.lng, polygonAndMarkerStyle.imageName ? polygonAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
|
|
|
|
+ coordinates.push(this._drawLineConfig(obj.lat, obj.lng));
|
|
|
|
|
+ markers.push(this._addOvalPointConfig(obj.lat, obj.lng, polygonAndMarkerStyle.imageName ? polygonAndMarkerStyle.imageName : 'BA_oval'));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -237,7 +237,7 @@ export default class AmapShapesManager {
|
|
|
for (let i = 0; i < airspaceInfos.length; i++) {
|
|
for (let i = 0; i < airspaceInfos.length; i++) {
|
|
|
let polygon = airspaceInfos[i]
|
|
let polygon = airspaceInfos[i]
|
|
|
if (polygon.airspaceType == Global.flyingTypes.polygon && currentAirspaceIndex != i) {
|
|
if (polygon.airspaceType == Global.flyingTypes.polygon && currentAirspaceIndex != i) {
|
|
|
- let retObj = _getPolygon(polygon)
|
|
|
|
|
|
|
+ let retObj = this._getPolygon(polygon)
|
|
|
markers.push(...retObj.markers);
|
|
markers.push(...retObj.markers);
|
|
|
polygons.push(retObj.polygon);
|
|
polygons.push(retObj.polygon);
|
|
|
}
|
|
}
|
|
@@ -277,10 +277,10 @@ export default class AmapShapesManager {
|
|
|
|
|
|
|
|
static getShapesSelect(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
static getShapesSelect(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : () => -1;
|
|
currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : () => -1;
|
|
|
- let circles = _getCircleSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let lineAndMarkers = _getLineAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let polygonAndMarkers = _getPolygonAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let markers = _getMarkerSelector(polygonAndMarkers,lineAndMarkers);
|
|
|
|
|
|
|
+ let circles = this._getCircleSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let lineAndMarkers = this._getLineAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let polygonAndMarkers = this._getPolygonAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let markers = this._getMarkerSelector(polygonAndMarkers,lineAndMarkers);
|
|
|
return {
|
|
return {
|
|
|
markers,
|
|
markers,
|
|
|
circles,
|
|
circles,
|
|
@@ -291,10 +291,10 @@ export default class AmapShapesManager {
|
|
|
|
|
|
|
|
static getShapes(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
static getShapes(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : () => -1;
|
|
currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : () => -1;
|
|
|
- let circles = _getCircles(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let lineAndMarkers = _getLinesAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let polygonAndMarkers = _getPolygonsAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
- let markers = _getMarkers(polygonAndMarkers,lineAndMarkers);
|
|
|
|
|
|
|
+ let circles = this._getCircles(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let lineAndMarkers = this._getLinesAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let polygonAndMarkers = this._getPolygonsAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex);
|
|
|
|
|
+ let markers = this._getMarkers(polygonAndMarkers,lineAndMarkers);
|
|
|
return {
|
|
return {
|
|
|
markers,
|
|
markers,
|
|
|
circles,
|
|
circles,
|