|
|
@@ -1,82 +1,66 @@
|
|
|
-"use strict";
|
|
|
-var __assign = (this && this.__assign) || function () {
|
|
|
- __assign = Object.assign || function(t) {
|
|
|
- for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
|
- s = arguments[i];
|
|
|
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
|
- t[p] = s[p];
|
|
|
- }
|
|
|
- return t;
|
|
|
- };
|
|
|
- return __assign.apply(this, arguments);
|
|
|
-};
|
|
|
-exports.__esModule = true;
|
|
|
-var reselect_1 = require("reselect");
|
|
|
-var Common_1 = require("./Common");
|
|
|
-var Utils_1 = require("./Utils");
|
|
|
-exports.latLngDegreesToDecimal = Utils_1.latLngDegreesToDecimal;
|
|
|
-exports.latLngDecimalToDegrees = Utils_1.latLngDecimalToDegrees;
|
|
|
-var LatLon = require('geodesy').LatLonSpherical;
|
|
|
-function convertAirspaceInfoServerToLocal(airspaceInfo) {
|
|
|
- var airspaceType = airspaceInfo.airspace_type;
|
|
|
- if (airspaceType == Common_1["default"].airspaceType.circle) {
|
|
|
- var ai = airspaceInfo;
|
|
|
+import { createSelector } from 'reselect';
|
|
|
+import Global from './Common';
|
|
|
+import { latLngDegreesToDecimal, latLngDecimalToDegrees, isObject, isSafeString, hasPoint, isNumber } from './Utils';
|
|
|
+let LatLon = require('geodesy').LatLonSpherical;
|
|
|
+export function convertAirspaceInfoServerToLocal(airspaceInfo) {
|
|
|
+ const airspaceType = airspaceInfo.airspace_type;
|
|
|
+ if (airspaceType == Global.airspaceType.circle) {
|
|
|
+ const ai = airspaceInfo;
|
|
|
return {
|
|
|
- airspaceType: airspaceType,
|
|
|
+ airspaceType,
|
|
|
airspaceId: ai.airspace_id,
|
|
|
name: ai.airspace_name,
|
|
|
note: ai.note,
|
|
|
addr: ai.center_loc,
|
|
|
- lat: Utils_1.latLngDecimalToDegrees(ai.center_point_of_flying.lat),
|
|
|
- lng: Utils_1.latLngDecimalToDegrees(ai.center_point_of_flying.lng),
|
|
|
+ lat: latLngDecimalToDegrees(ai.center_point_of_flying.lat),
|
|
|
+ lng: latLngDecimalToDegrees(ai.center_point_of_flying.lng),
|
|
|
radius: ai.radius_of_flying,
|
|
|
height: ai.altitude + "",
|
|
|
- heightStandard: Common_1["default"].heightStandardsById.get(ai.unit)
|
|
|
+ heightStandard: Global.heightStandardsById.get(ai.unit)
|
|
|
};
|
|
|
}
|
|
|
- if (airspaceType == Common_1["default"].airspaceType.line) {
|
|
|
- var ai = airspaceInfo;
|
|
|
- var dep = {
|
|
|
+ if (airspaceType == Global.airspaceType.line) {
|
|
|
+ const ai = airspaceInfo;
|
|
|
+ let dep = {
|
|
|
addr: ai.start_loc,
|
|
|
- lat: Utils_1.latLngDecimalToDegrees(ai.start_point.lat),
|
|
|
- lng: Utils_1.latLngDecimalToDegrees(ai.start_point.lng),
|
|
|
+ lat: latLngDecimalToDegrees(ai.start_point.lat),
|
|
|
+ lng: latLngDecimalToDegrees(ai.start_point.lng),
|
|
|
height: ai.start_point.altitude + "",
|
|
|
- heightStandard: Common_1["default"].heightStandardsById.get(ai.start_point.unit)
|
|
|
+ heightStandard: Global.heightStandardsById.get(ai.start_point.unit)
|
|
|
};
|
|
|
- var arrive = {
|
|
|
+ let arrive = {
|
|
|
addr: ai.end_loc,
|
|
|
- lat: Utils_1.latLngDecimalToDegrees(ai.end_point.lat),
|
|
|
- lng: Utils_1.latLngDecimalToDegrees(ai.end_point.lng)
|
|
|
+ lat: latLngDecimalToDegrees(ai.end_point.lat),
|
|
|
+ lng: latLngDecimalToDegrees(ai.end_point.lng)
|
|
|
};
|
|
|
- var passPoints = [];
|
|
|
+ let passPoints = [];
|
|
|
if (Array.isArray(ai.passing_points)) {
|
|
|
- for (var _i = 0, _a = ai.passing_points; _i < _a.length; _i++) {
|
|
|
- var obj = _a[_i];
|
|
|
- var point = void 0;
|
|
|
- if (obj.point_type == Common_1["default"].pointTypes.point) {
|
|
|
- var pp = obj;
|
|
|
- var lat = Utils_1.latLngDecimalToDegrees(pp.lat);
|
|
|
- var lng = Utils_1.latLngDecimalToDegrees(pp.lng);
|
|
|
+ for (let obj of ai.passing_points) {
|
|
|
+ let point;
|
|
|
+ if (obj.point_type == Global.pointTypes.point) {
|
|
|
+ const pp = obj;
|
|
|
+ const lat = latLngDecimalToDegrees(pp.lat);
|
|
|
+ const lng = latLngDecimalToDegrees(pp.lng);
|
|
|
point = {
|
|
|
pointType: pp.point_type,
|
|
|
addr: pp.point_name,
|
|
|
- lat: lat, lng: lng
|
|
|
+ lat, lng
|
|
|
};
|
|
|
}
|
|
|
- else if (obj.point_type == Common_1["default"].pointTypes.nav) {
|
|
|
- var pp = obj;
|
|
|
- var lat = Utils_1.latLngDecimalToDegrees(pp.lat);
|
|
|
- var lng = Utils_1.latLngDecimalToDegrees(pp.lng);
|
|
|
+ else if (obj.point_type == Global.pointTypes.nav) {
|
|
|
+ const pp = obj;
|
|
|
+ const lat = latLngDecimalToDegrees(pp.lat);
|
|
|
+ const lng = latLngDecimalToDegrees(pp.lng);
|
|
|
point = {
|
|
|
pointType: pp.point_type,
|
|
|
pointId: pp.point_id,
|
|
|
pointCode: pp.point_code,
|
|
|
pointName: pp.point_name,
|
|
|
- lat: lat, lng: lng
|
|
|
+ lat, lng
|
|
|
};
|
|
|
}
|
|
|
else {
|
|
|
- var pp = obj;
|
|
|
+ const pp = obj;
|
|
|
point = {
|
|
|
pointType: pp.point_type,
|
|
|
airRouteId: pp.airway,
|
|
|
@@ -84,135 +68,132 @@ function convertAirspaceInfoServerToLocal(airspaceInfo) {
|
|
|
airlines: pp.points
|
|
|
};
|
|
|
}
|
|
|
- if (Utils_1.isNumber(obj.altitude) && Utils_1.isNumber(obj.unit)) {
|
|
|
+ if (isNumber(obj.altitude) && isNumber(obj.unit)) {
|
|
|
point.height = obj.altitude + "";
|
|
|
- point.heightStandard = Common_1["default"].heightStandardsById.get(obj.unit);
|
|
|
+ point.heightStandard = Global.heightStandardsById.get(obj.unit);
|
|
|
}
|
|
|
else {
|
|
|
point.height = "";
|
|
|
- point.heightStandard = Common_1["default"].heightStandards.keys().slice()[0];
|
|
|
+ point.heightStandard = [...Global.heightStandards.keys()][0];
|
|
|
}
|
|
|
passPoints.push(point);
|
|
|
}
|
|
|
}
|
|
|
- return __assign({
|
|
|
- airspaceType: airspaceType,
|
|
|
+ return Object.assign({
|
|
|
+ airspaceType,
|
|
|
airspaceId: ai.airspace_id,
|
|
|
name: ai.airspace_name,
|
|
|
note: ai.note,
|
|
|
- dep: dep,
|
|
|
- arrive: arrive,
|
|
|
- passPoints: passPoints
|
|
|
+ dep,
|
|
|
+ arrive,
|
|
|
+ passPoints
|
|
|
}, (ai.airline_width ? { airlineWidth: ai.airline_width } : {}));
|
|
|
}
|
|
|
- if (airspaceType == Common_1["default"].airspaceType.polygon) {
|
|
|
- var ai = airspaceInfo;
|
|
|
+ if (airspaceType == Global.airspaceType.polygon) {
|
|
|
+ const ai = airspaceInfo;
|
|
|
if (Array.isArray(ai.points)) {
|
|
|
- var polygonPoints = new Array();
|
|
|
- var defaultPointName = 'A';
|
|
|
- for (var _b = 0, _c = ai.points; _b < _c.length; _b++) {
|
|
|
- var obj = _c[_b];
|
|
|
- var addr = obj.addr;
|
|
|
+ let polygonPoints = new Array();
|
|
|
+ let defaultPointName = 'A';
|
|
|
+ for (let obj of ai.points) {
|
|
|
+ let addr = obj.addr;
|
|
|
if (!addr) {
|
|
|
addr = defaultPointName;
|
|
|
defaultPointName = String.fromCharCode(defaultPointName.charCodeAt(0) + 1);
|
|
|
}
|
|
|
- polygonPoints.push({ addr: addr, lat: Utils_1.latLngDecimalToDegrees(obj.lat), lng: Utils_1.latLngDecimalToDegrees(obj.lng) });
|
|
|
+ polygonPoints.push({ addr, lat: latLngDecimalToDegrees(obj.lat), lng: latLngDecimalToDegrees(obj.lng) });
|
|
|
}
|
|
|
return {
|
|
|
- airspaceType: airspaceType,
|
|
|
+ airspaceType,
|
|
|
airspaceId: ai.airspace_id,
|
|
|
name: ai.airspace_name,
|
|
|
note: ai.note,
|
|
|
height: ai.altitude + '',
|
|
|
- heightStandard: Common_1["default"].heightStandardsById.get(ai.unit),
|
|
|
- polygonPoints: polygonPoints
|
|
|
+ heightStandard: Global.heightStandardsById.get(ai.unit),
|
|
|
+ polygonPoints
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
-exports.convertAirspaceInfoServerToLocal = convertAirspaceInfoServerToLocal;
|
|
|
-function convertAirspaceInfoLocalToServer(airspace) {
|
|
|
- if (airspace.airspaceType == Common_1["default"].airspaceType.circle) {
|
|
|
- var ai = airspace;
|
|
|
- var circle = {
|
|
|
+export function convertAirspaceInfoLocalToServer(airspace) {
|
|
|
+ if (airspace.airspaceType == Global.airspaceType.circle) {
|
|
|
+ const ai = airspace;
|
|
|
+ const circle = {
|
|
|
airspace_name: ai.name,
|
|
|
airspace_id: ai.airspaceId,
|
|
|
- airspace_type: Common_1["default"].airspaceType.circle,
|
|
|
- note: Utils_1.isSafeString(ai.note) ? ai.note : null,
|
|
|
+ airspace_type: Global.airspaceType.circle,
|
|
|
+ note: isSafeString(ai.note) ? ai.note : null,
|
|
|
radius_of_flying: parseInt(ai.radius + ''),
|
|
|
center_point_of_flying: {
|
|
|
- lng: Utils_1.latLngDegreesToDecimal(ai.lng),
|
|
|
- lat: Utils_1.latLngDegreesToDecimal(ai.lat)
|
|
|
+ lng: latLngDegreesToDecimal(ai.lng),
|
|
|
+ lat: latLngDegreesToDecimal(ai.lat)
|
|
|
},
|
|
|
center_loc: ai.addr,
|
|
|
altitude: parseInt(ai.height),
|
|
|
- unit: Common_1["default"].heightStandards.get(ai.heightStandard)
|
|
|
+ unit: Global.heightStandards.get(ai.heightStandard)
|
|
|
};
|
|
|
return circle;
|
|
|
}
|
|
|
- else if (airspace.airspaceType == Common_1["default"].airspaceType.line) {
|
|
|
- var ai = airspace;
|
|
|
- var line = {
|
|
|
+ else if (airspace.airspaceType == Global.airspaceType.line) {
|
|
|
+ const ai = airspace;
|
|
|
+ let line = {
|
|
|
airspace_name: ai.name,
|
|
|
airspace_id: ai.airspaceId,
|
|
|
- airspace_type: Common_1["default"].airspaceType.line,
|
|
|
+ airspace_type: Global.airspaceType.line,
|
|
|
note: ai.note,
|
|
|
start_loc: ai.dep.addr,
|
|
|
start_point: {
|
|
|
- lng: Utils_1.latLngDegreesToDecimal(ai.dep.lng),
|
|
|
- lat: Utils_1.latLngDegreesToDecimal(ai.dep.lat),
|
|
|
+ lng: latLngDegreesToDecimal(ai.dep.lng),
|
|
|
+ lat: latLngDegreesToDecimal(ai.dep.lat),
|
|
|
altitude: parseInt(ai.dep.height),
|
|
|
- unit: Common_1["default"].heightStandards.get(ai.dep.heightStandard)
|
|
|
+ unit: Global.heightStandards.get(ai.dep.heightStandard)
|
|
|
},
|
|
|
end_loc: ai.arrive.addr,
|
|
|
end_point: {
|
|
|
- lng: Utils_1.latLngDegreesToDecimal(ai.arrive.lng),
|
|
|
- lat: Utils_1.latLngDegreesToDecimal(ai.arrive.lat)
|
|
|
+ lng: latLngDegreesToDecimal(ai.arrive.lng),
|
|
|
+ lat: latLngDegreesToDecimal(ai.arrive.lat)
|
|
|
}
|
|
|
};
|
|
|
if (ai.airlineWidth) {
|
|
|
line['airline_width'] = ai.airlineWidth;
|
|
|
}
|
|
|
if (Array.isArray(ai.passPoints) && ai.passPoints.length > 0) {
|
|
|
- var passing_points = [];
|
|
|
- for (var _i = 0, _a = ai.passPoints; _i < _a.length; _i++) {
|
|
|
- var obj = _a[_i];
|
|
|
- var retObj = void 0;
|
|
|
- if (obj.pointType == Common_1["default"].pointTypes.point && Utils_1.hasPoint(obj)) {
|
|
|
- var pp = obj;
|
|
|
+ let passing_points = [];
|
|
|
+ for (let obj of ai.passPoints) {
|
|
|
+ let retObj;
|
|
|
+ if (obj.pointType == Global.pointTypes.point && hasPoint(obj)) {
|
|
|
+ const pp = obj;
|
|
|
retObj = {
|
|
|
- point_type: Common_1["default"].pointTypes.point,
|
|
|
+ point_type: Global.pointTypes.point,
|
|
|
point_name: pp.addr,
|
|
|
- lat: Utils_1.latLngDegreesToDecimal(pp.lat),
|
|
|
- lng: Utils_1.latLngDegreesToDecimal(pp.lng)
|
|
|
+ lat: latLngDegreesToDecimal(pp.lat),
|
|
|
+ lng: latLngDegreesToDecimal(pp.lng)
|
|
|
};
|
|
|
}
|
|
|
- else if (obj.pointType == Common_1["default"].pointTypes.nav) {
|
|
|
- var pp = obj;
|
|
|
+ else if (obj.pointType == Global.pointTypes.nav) {
|
|
|
+ const pp = obj;
|
|
|
retObj = {
|
|
|
- point_type: Common_1["default"].pointTypes.nav,
|
|
|
+ point_type: Global.pointTypes.nav,
|
|
|
point_name: pp.pointName,
|
|
|
point_id: pp.pointId,
|
|
|
point_code: pp.pointCode,
|
|
|
- lat: Utils_1.latLngDegreesToDecimal(pp.lat),
|
|
|
- lng: Utils_1.latLngDegreesToDecimal(pp.lng)
|
|
|
+ lat: latLngDegreesToDecimal(pp.lat),
|
|
|
+ lng: latLngDegreesToDecimal(pp.lng)
|
|
|
};
|
|
|
}
|
|
|
else {
|
|
|
- var pp = obj;
|
|
|
+ const pp = obj;
|
|
|
retObj = {
|
|
|
- point_type: Common_1["default"].pointTypes.line,
|
|
|
+ point_type: Global.pointTypes.line,
|
|
|
airway: pp.airRouteId,
|
|
|
air_route_code: pp.airlineCode,
|
|
|
points: pp.airlines
|
|
|
};
|
|
|
}
|
|
|
- if (Utils_1.isSafeString(obj.height) && Utils_1.isSafeString(obj.heightStandard)) {
|
|
|
+ if (isSafeString(obj.height) && isSafeString(obj.heightStandard)) {
|
|
|
retObj.altitude = parseInt(obj.height);
|
|
|
// @ts-ignore
|
|
|
- retObj.unit = Common_1["default"].heightStandards.get(obj.heightStandard);
|
|
|
+ retObj.unit = Global.heightStandards.get(obj.heightStandard);
|
|
|
}
|
|
|
passing_points.push(retObj);
|
|
|
}
|
|
|
@@ -224,69 +205,67 @@ function convertAirspaceInfoLocalToServer(airspace) {
|
|
|
return line;
|
|
|
}
|
|
|
else {
|
|
|
- var ai = airspace;
|
|
|
- var points = [];
|
|
|
- for (var _b = 0, _c = ai.polygonPoints; _b < _c.length; _b++) {
|
|
|
- var obj = _c[_b];
|
|
|
- points.push({ addr: obj.addr, lat: Utils_1.latLngDegreesToDecimal(obj.lat), lng: Utils_1.latLngDegreesToDecimal(obj.lng) });
|
|
|
+ const ai = airspace;
|
|
|
+ let points = [];
|
|
|
+ for (let obj of ai.polygonPoints) {
|
|
|
+ points.push({ addr: obj.addr, lat: latLngDegreesToDecimal(obj.lat), lng: latLngDegreesToDecimal(obj.lng) });
|
|
|
}
|
|
|
- var polygon = {
|
|
|
+ const polygon = {
|
|
|
airspace_name: ai.name,
|
|
|
airspace_id: ai.airspaceId,
|
|
|
- airspace_type: Common_1["default"].airspaceType.polygon,
|
|
|
+ airspace_type: Global.airspaceType.polygon,
|
|
|
note: ai.note,
|
|
|
altitude: parseInt(ai.height),
|
|
|
- unit: Common_1["default"].heightStandards.get(ai.heightStandard),
|
|
|
- points: points
|
|
|
+ unit: Global.heightStandards.get(ai.heightStandard),
|
|
|
+ points
|
|
|
};
|
|
|
return polygon;
|
|
|
}
|
|
|
}
|
|
|
-exports.convertAirspaceInfoLocalToServer = convertAirspaceInfoLocalToServer;
|
|
|
function getCircleRegions(circle) {
|
|
|
- var lat, lng;
|
|
|
+ let lat, lng;
|
|
|
if (circle.coordinate.latitude) {
|
|
|
- var coord = circle.coordinate;
|
|
|
+ let coord = circle.coordinate;
|
|
|
lat = coord.latitude;
|
|
|
lng = coord.longitude;
|
|
|
}
|
|
|
else {
|
|
|
- var coord = circle.coordinate;
|
|
|
+ let coord = circle.coordinate;
|
|
|
lat = coord.lat;
|
|
|
lng = coord.lng;
|
|
|
}
|
|
|
- var latlon = new LatLon(lat, lng);
|
|
|
- var d1 = latlon.destinationPoint(circle.radius, 0);
|
|
|
- var d2 = latlon.destinationPoint(circle.radius, 90);
|
|
|
- var d3 = latlon.destinationPoint(circle.radius, 180);
|
|
|
- var d4 = latlon.destinationPoint(circle.radius, 270);
|
|
|
+ let latlon = new LatLon(lat, lng);
|
|
|
+ let d1 = latlon.destinationPoint(circle.radius, 0);
|
|
|
+ let d2 = latlon.destinationPoint(circle.radius, 90);
|
|
|
+ let d3 = latlon.destinationPoint(circle.radius, 180);
|
|
|
+ let d4 = latlon.destinationPoint(circle.radius, 270);
|
|
|
return [{ lat: d1.lat, lng: d1.lon }, { lat: d2.lat, lng: d2.lon }, { lat: d3.lat, lng: d3.lon }, { lat: d4.lat, lng: d4.lon }];
|
|
|
}
|
|
|
function getDefaultStyle() {
|
|
|
- var imageName = 'BA_oval';
|
|
|
- var lineWidth = Common_1["default"].amapLineWidth;
|
|
|
- var strokeColor = Common_1["default"].amapStrokeColor;
|
|
|
- var fillColor = Common_1["default"].amapFillColor;
|
|
|
- return { imageName: imageName, lineWidth: lineWidth, strokeColor: strokeColor, fillColor: fillColor };
|
|
|
+ let imageName = 'BA_oval';
|
|
|
+ let lineWidth = Global.amapLineWidth;
|
|
|
+ let strokeColor = Global.amapStrokeColor;
|
|
|
+ let fillColor = Global.amapFillColor;
|
|
|
+ return { imageName, lineWidth, strokeColor, fillColor };
|
|
|
}
|
|
|
function getCirclesAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- var circles = [];
|
|
|
- var markers = [];
|
|
|
+ let circles = [];
|
|
|
+ let markers = [];
|
|
|
if (!Array.isArray(airspaceInfos)) {
|
|
|
- return { circles: circles, markers: markers };
|
|
|
+ return { circles, markers };
|
|
|
}
|
|
|
- var _a = getDefaultStyle(), imageName = _a.imageName, lineWidth = _a.lineWidth, strokeColor = _a.strokeColor, fillColor = _a.fillColor;
|
|
|
+ let { imageName, lineWidth, strokeColor, fillColor } = getDefaultStyle();
|
|
|
//通过该方法获取样式
|
|
|
- var circleStyle = setStyle('circle');
|
|
|
+ let circleStyle = setStyle('circle');
|
|
|
if (circleStyle) {
|
|
|
lineWidth = circleStyle.lineWidth;
|
|
|
strokeColor = circleStyle.strokeColor;
|
|
|
fillColor = circleStyle.fillColor;
|
|
|
imageName = circleStyle.imageName;
|
|
|
}
|
|
|
- for (var i = 0; i < airspaceInfos.length; i++) {
|
|
|
- var tmpCircle = airspaceInfos[i];
|
|
|
- var airspaceTypeFix = void 0, radiusFix = void 0;
|
|
|
+ for (let i = 0; i < airspaceInfos.length; i++) {
|
|
|
+ let tmpCircle = airspaceInfos[i];
|
|
|
+ let airspaceTypeFix, radiusFix;
|
|
|
if (tmpCircle.airspaceType) {
|
|
|
airspaceTypeFix = 'airspaceType';
|
|
|
radiusFix = 'radius';
|
|
|
@@ -295,21 +274,21 @@ function getCirclesAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
airspaceTypeFix = 'airspace_type';
|
|
|
radiusFix = 'radius_of_flying';
|
|
|
}
|
|
|
- if (tmpCircle[airspaceTypeFix] == Common_1["default"].airspaceType.circle && currentAirspaceIndex != i) {
|
|
|
- var coordinate = { latitude: 0, longitude: 0 };
|
|
|
+ if (tmpCircle[airspaceTypeFix] == Global.airspaceType.circle && currentAirspaceIndex != i) {
|
|
|
+ let coordinate = { latitude: 0, longitude: 0 };
|
|
|
if (tmpCircle.center_point_of_flying) {
|
|
|
- var ai = tmpCircle;
|
|
|
+ let ai = tmpCircle;
|
|
|
coordinate.latitude = ai.center_point_of_flying.lat;
|
|
|
coordinate.longitude = ai.center_point_of_flying.lng;
|
|
|
}
|
|
|
else {
|
|
|
- var ai = tmpCircle;
|
|
|
- coordinate.latitude = Utils_1.latLngDegreesToDecimal(ai.lat);
|
|
|
- coordinate.longitude = Utils_1.latLngDegreesToDecimal(ai.lng);
|
|
|
+ let ai = tmpCircle;
|
|
|
+ coordinate.latitude = latLngDegreesToDecimal(ai.lat);
|
|
|
+ coordinate.longitude = latLngDegreesToDecimal(ai.lng);
|
|
|
}
|
|
|
- var radius = tmpCircle[radiusFix];
|
|
|
+ let radius = tmpCircle[radiusFix];
|
|
|
if (radius) {
|
|
|
- var circle = { lineWidth: lineWidth, strokeColor: strokeColor, fillColor: fillColor, radius: radius, coordinate: coordinate };
|
|
|
+ let circle = { lineWidth, strokeColor, fillColor, radius, coordinate };
|
|
|
circles.push(circle);
|
|
|
}
|
|
|
else {
|
|
|
@@ -318,14 +297,14 @@ function getCirclesAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return { circles: circles, markers: markers };
|
|
|
+ return { circles, markers };
|
|
|
}
|
|
|
function getCircleAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- return reselect_1.createSelector(airspaceInfos, function () { return setStyle; }, currentAirspaceIndex, getCirclesAndMarkers);
|
|
|
+ return createSelector(airspaceInfos, () => setStyle, currentAirspaceIndex, getCirclesAndMarkers);
|
|
|
}
|
|
|
function getLatLng(latlng, dataType) {
|
|
|
if (dataType == 1) { // 驼峰模式,新建计划的时候的格式
|
|
|
- return Utils_1.latLngDegreesToDecimal(latlng);
|
|
|
+ return latLngDegreesToDecimal(latlng);
|
|
|
}
|
|
|
else {
|
|
|
return latlng;
|
|
|
@@ -350,13 +329,13 @@ function pointCompare(point1, point2) {
|
|
|
if (!point1 || !point2) {
|
|
|
return false;
|
|
|
}
|
|
|
- var pointId1 = point1.point_id;
|
|
|
- var pointId2 = point2.point_id;
|
|
|
+ const pointId1 = point1.point_id;
|
|
|
+ const pointId2 = point2.point_id;
|
|
|
if (pointId1 == pointId2) {
|
|
|
return true;
|
|
|
}
|
|
|
- var _a = getFixedLatLng(point1), point1Lat = _a[0], point1lng = _a[1];
|
|
|
- var _b = getFixedLatLng(point2), point2lat = _b[0], point2lng = _b[1];
|
|
|
+ let [point1Lat, point1lng] = getFixedLatLng(point1);
|
|
|
+ let [point2lat, point2lng] = getFixedLatLng(point2);
|
|
|
if (myRound(point1Lat) == myRound(point2lat)
|
|
|
&& myRound(point1lng) == myRound(point2lng)) {
|
|
|
return true;
|
|
|
@@ -366,10 +345,8 @@ function pointCompare(point1, point2) {
|
|
|
}
|
|
|
}
|
|
|
function getCrossPoint(points1, points2) {
|
|
|
- for (var _i = 0, points1_1 = points1; _i < points1_1.length; _i++) {
|
|
|
- var point1 = points1_1[_i];
|
|
|
- for (var _a = 0, points2_1 = points2; _a < points2_1.length; _a++) {
|
|
|
- var point2 = points2_1[_a];
|
|
|
+ for (let point1 of points1) {
|
|
|
+ for (let point2 of points2) {
|
|
|
if (pointCompare(point1, point2))
|
|
|
return point1;
|
|
|
}
|
|
|
@@ -377,9 +354,9 @@ function getCrossPoint(points1, points2) {
|
|
|
return undefined;
|
|
|
}
|
|
|
function getAirwayPoints(airway, pointBefore, pointAfter) {
|
|
|
- var found = 0;
|
|
|
- var points = [];
|
|
|
- var pointTypeFix, pointsFix, airRoutePoint;
|
|
|
+ let found = 0;
|
|
|
+ let points = [];
|
|
|
+ let pointTypeFix, pointsFix, airRoutePoint;
|
|
|
if ('points' in airway) {
|
|
|
pointTypeFix = 'point_type';
|
|
|
pointsFix = 'points';
|
|
|
@@ -390,16 +367,15 @@ function getAirwayPoints(airway, pointBefore, pointAfter) {
|
|
|
pointsFix = 'airlines';
|
|
|
airRoutePoint = airway['airlines'];
|
|
|
}
|
|
|
- var crossPointBefore, crossPointAfter;
|
|
|
+ let crossPointBefore, crossPointAfter;
|
|
|
// 如果前后是其他航线,那么找到交叉点作为前后的点
|
|
|
- if (pointBefore[pointTypeFix] == Common_1["default"].pointTypes.line) {
|
|
|
+ if (pointBefore[pointTypeFix] == Global.pointTypes.line) {
|
|
|
crossPointBefore = getCrossPoint(airRoutePoint, pointBefore[pointsFix]);
|
|
|
}
|
|
|
- if (pointAfter[pointTypeFix] == Common_1["default"].pointTypes.line) {
|
|
|
+ if (pointAfter[pointTypeFix] == Global.pointTypes.line) {
|
|
|
crossPointAfter = getCrossPoint(airRoutePoint, pointAfter[pointsFix]);
|
|
|
}
|
|
|
- for (var _i = 0, airRoutePoint_1 = airRoutePoint; _i < airRoutePoint_1.length; _i++) {
|
|
|
- var point = airRoutePoint_1[_i];
|
|
|
+ for (let point of airRoutePoint) {
|
|
|
if (pointCompare(crossPointBefore, point) || pointCompare(crossPointAfter, point)) {
|
|
|
found++;
|
|
|
points.push(Object.assign({}, point));
|
|
|
@@ -416,18 +392,18 @@ function getAirwayPoints(airway, pointBefore, pointAfter) {
|
|
|
return points;
|
|
|
}
|
|
|
function getLinesRouter(lineProps, lineAndMarkerStyle) {
|
|
|
- var coordinates = new Array();
|
|
|
- var markers = new Array();
|
|
|
- var lines = [];
|
|
|
- var _a = getDefaultStyle(), imageName = _a.imageName, lineWidth = _a.lineWidth, strokeColor = _a.strokeColor;
|
|
|
+ let coordinates = new Array();
|
|
|
+ let markers = new Array();
|
|
|
+ let lines = [];
|
|
|
+ let { imageName, lineWidth, strokeColor } = getDefaultStyle();
|
|
|
if (lineAndMarkerStyle) {
|
|
|
imageName = lineAndMarkerStyle.imageName;
|
|
|
lineWidth = lineAndMarkerStyle.lineWidth;
|
|
|
strokeColor = lineAndMarkerStyle.strokeColor;
|
|
|
}
|
|
|
- var startPoint, passPoints, endPoint, pointTypeFix, dataType, airlineWidth;
|
|
|
+ let startPoint, passPoints, endPoint, pointTypeFix, dataType, airlineWidth;
|
|
|
if (lineProps.start_point) {
|
|
|
- var ll = lineProps;
|
|
|
+ let ll = lineProps;
|
|
|
dataType = 2; // 下划线模式
|
|
|
startPoint = ll['start_point'];
|
|
|
passPoints = ll['passing_points'];
|
|
|
@@ -436,7 +412,7 @@ function getLinesRouter(lineProps, lineAndMarkerStyle) {
|
|
|
airlineWidth = parseInt(ll['airline_width'] + '', 10);
|
|
|
}
|
|
|
else {
|
|
|
- var ll = lineProps;
|
|
|
+ let ll = lineProps;
|
|
|
dataType = 1; // 驼峰模式
|
|
|
startPoint = ll['dep'];
|
|
|
passPoints = ll['passPoints'];
|
|
|
@@ -449,28 +425,28 @@ function getLinesRouter(lineProps, lineAndMarkerStyle) {
|
|
|
markers.push(addOvalPointConfig(startPoint.lat, startPoint.lng, imageName, dataType));
|
|
|
}
|
|
|
if (Array.isArray(passPoints)) {
|
|
|
- for (var i = 0; i < passPoints.length; i++) {
|
|
|
- var obj = passPoints[i];
|
|
|
- if (!Utils_1.isObject(obj)) { // 所有的 points/airway 都必须是 obj
|
|
|
+ for (let i = 0; i < passPoints.length; i++) {
|
|
|
+ let obj = passPoints[i];
|
|
|
+ if (!isObject(obj)) { // 所有的 points/airway 都必须是 obj
|
|
|
continue;
|
|
|
}
|
|
|
- var pointType = obj[pointTypeFix];
|
|
|
- if (pointType == Common_1["default"].pointTypes.point
|
|
|
- || pointType == Common_1["default"].pointTypes.nav) {
|
|
|
- var pp = obj;
|
|
|
+ let pointType = obj[pointTypeFix];
|
|
|
+ if (pointType == Global.pointTypes.point
|
|
|
+ || pointType == Global.pointTypes.nav) {
|
|
|
+ let pp = obj;
|
|
|
coordinates.push(drawLineConfig(pp.lat, pp.lng, dataType));
|
|
|
markers.push(addOvalPointConfig(pp.lat, pp.lng, imageName, dataType));
|
|
|
}
|
|
|
else {
|
|
|
// 遇到一个航线,不需要和前前面的点连起来
|
|
|
- var pp = obj;
|
|
|
+ let pp = obj;
|
|
|
if (coordinates.length > 1) {
|
|
|
- lines.push({ lineWidth: lineWidth, strokeColor: strokeColor, coordinates: coordinates });
|
|
|
+ lines.push({ lineWidth, strokeColor, coordinates });
|
|
|
}
|
|
|
coordinates = [];
|
|
|
- var pointBefore = i == 0 ? startPoint : passPoints[i - 1];
|
|
|
- var pointAfter = i == passPoints.length - 1 ? (endPoint ? endPoint : passPoints[passPoints.length - 1]) : passPoints[i + 1];
|
|
|
- lines.push({ lineWidth: lineWidth, strokeColor: strokeColor, coordinates: getAirwayPoints(pp, pointBefore, pointAfter) });
|
|
|
+ const pointBefore = i == 0 ? startPoint : passPoints[i - 1];
|
|
|
+ const pointAfter = i == passPoints.length - 1 ? (endPoint ? endPoint : passPoints[passPoints.length - 1]) : passPoints[i + 1];
|
|
|
+ lines.push({ lineWidth, strokeColor, coordinates: getAirwayPoints(pp, pointBefore, pointAfter) });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -479,56 +455,55 @@ function getLinesRouter(lineProps, lineAndMarkerStyle) {
|
|
|
markers.push(addOvalPointConfig(endPoint.lat, endPoint.lng, imageName, dataType));
|
|
|
}
|
|
|
if (coordinates.length > 1) {
|
|
|
- lines.push({ lineWidth: lineWidth, strokeColor: strokeColor, coordinates: coordinates });
|
|
|
+ lines.push({ lineWidth, strokeColor, coordinates });
|
|
|
}
|
|
|
if (airlineWidth > 0) {
|
|
|
// 有宽度的空域,需要线周围多画宽度的多边形
|
|
|
- var polygons = processAirlineWidth(lines, airlineWidth);
|
|
|
- return { lines: lines, markers: markers, polygons: polygons };
|
|
|
+ let polygons = processAirlineWidth(lines, airlineWidth);
|
|
|
+ return { lines, markers, polygons };
|
|
|
}
|
|
|
else {
|
|
|
- return { lines: lines, markers: markers, polygons: [] };
|
|
|
+ return { lines, markers, polygons: [] };
|
|
|
}
|
|
|
}
|
|
|
function getFixedLatLng(point) {
|
|
|
- var pp = point;
|
|
|
- var lat = pp.latitude ? pp.latitude : pp.lat;
|
|
|
- var lng = pp.longitude ? pp.longitude : pp.lng;
|
|
|
+ let pp = point;
|
|
|
+ let lat = pp.latitude ? pp.latitude : pp.lat;
|
|
|
+ let lng = pp.longitude ? pp.longitude : pp.lng;
|
|
|
// 复制计划的数据,有的点是度数模式如 38°35′17″
|
|
|
- if (Utils_1.isSafeString(lat)) {
|
|
|
- lat = Utils_1.latLngDegreesToDecimal(lat);
|
|
|
- lng = Utils_1.latLngDegreesToDecimal(lng);
|
|
|
+ if (isSafeString(lat)) {
|
|
|
+ lat = latLngDegreesToDecimal(lat);
|
|
|
+ lng = latLngDegreesToDecimal(lng);
|
|
|
}
|
|
|
return [lat, lng];
|
|
|
}
|
|
|
function processAirlineWidth(lines, airlineWidth) {
|
|
|
- var polygons = [];
|
|
|
- var _a = getDefaultStyle(), strokeColor = _a.strokeColor, fillColor = _a.fillColor;
|
|
|
- for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) {
|
|
|
- var line = lines_1[_i];
|
|
|
- var points = line.coordinates;
|
|
|
- for (var i = 0; i < points.length - 1; i++) {
|
|
|
- var _b = getFixedLatLng(points[i]), lat1 = _b[0], lng1 = _b[1];
|
|
|
- var _c = getFixedLatLng(points[i + 1]), lat2 = _c[0], lng2 = _c[1];
|
|
|
- var point1 = new LatLon(lat1, lng1);
|
|
|
- var point2 = new LatLon(lat2, lng2);
|
|
|
- var coordinates = getCirclePoints(point1, point2, airlineWidth);
|
|
|
- polygons.push({ lineWidth: 1, strokeColor: strokeColor, fillColor: fillColor, coordinates: coordinates });
|
|
|
+ let polygons = [];
|
|
|
+ let { strokeColor, fillColor } = getDefaultStyle();
|
|
|
+ for (let line of lines) {
|
|
|
+ let points = line.coordinates;
|
|
|
+ for (let i = 0; i < points.length - 1; i++) {
|
|
|
+ let [lat1, lng1] = getFixedLatLng(points[i]);
|
|
|
+ let [lat2, lng2] = getFixedLatLng(points[i + 1]);
|
|
|
+ let point1 = new LatLon(lat1, lng1);
|
|
|
+ let point2 = new LatLon(lat2, lng2);
|
|
|
+ let coordinates = getCirclePoints(point1, point2, airlineWidth);
|
|
|
+ polygons.push({ lineWidth: 1, strokeColor, fillColor, coordinates });
|
|
|
}
|
|
|
}
|
|
|
return polygons;
|
|
|
}
|
|
|
function getCirclePoints(point1, point2, width) {
|
|
|
- var percision = 10; // 半圆处理为多边形的时候,半圆上取几个点
|
|
|
- var step = 180 / percision;
|
|
|
- var bearing = (360 + point1.bearingTo(point2) - 90) % 360; // 取正值
|
|
|
- var points = [];
|
|
|
- for (var diff = 0; diff <= 180; diff += step) {
|
|
|
- var point = point2.destinationPoint(width, bearing + diff);
|
|
|
+ let percision = 10; // 半圆处理为多边形的时候,半圆上取几个点
|
|
|
+ let step = 180 / percision;
|
|
|
+ let bearing = (360 + point1.bearingTo(point2) - 90) % 360; // 取正值
|
|
|
+ let points = [];
|
|
|
+ for (let diff = 0; diff <= 180; diff += step) {
|
|
|
+ let point = point2.destinationPoint(width, bearing + diff);
|
|
|
points.push({ lat: point.lat, lng: point.lon });
|
|
|
}
|
|
|
- for (var diff = 180; diff <= 360; diff += step) {
|
|
|
- var point = point1.destinationPoint(width, bearing + diff);
|
|
|
+ for (let diff = 180; diff <= 360; diff += step) {
|
|
|
+ let point = point1.destinationPoint(width, bearing + diff);
|
|
|
points.push({ lat: point.lat, lng: point.lon });
|
|
|
}
|
|
|
return points;
|
|
|
@@ -539,44 +514,44 @@ function myRound(num, digits) {
|
|
|
return Math.round(num * Math.pow(10, digits)) / Math.pow(10, digits);
|
|
|
}
|
|
|
function getLinesPolygonsAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- var retLines = [];
|
|
|
- var retMarkers = [];
|
|
|
- var retPolygons = [];
|
|
|
+ let retLines = [];
|
|
|
+ let retMarkers = [];
|
|
|
+ let retPolygons = [];
|
|
|
if (!Array.isArray(airspaceInfos)) {
|
|
|
return { lines: retLines, markers: retMarkers, polygons: retPolygons };
|
|
|
}
|
|
|
- var lineStyle = setStyle('line');
|
|
|
- for (var i = 0; i < airspaceInfos.length; i++) {
|
|
|
- var tmpLine = airspaceInfos[i];
|
|
|
- var airspaceTypeFix = void 0;
|
|
|
+ let lineStyle = setStyle('line');
|
|
|
+ for (let i = 0; i < airspaceInfos.length; i++) {
|
|
|
+ let tmpLine = airspaceInfos[i];
|
|
|
+ let airspaceTypeFix;
|
|
|
if (tmpLine.airspaceType)
|
|
|
airspaceTypeFix = 'airspaceType';
|
|
|
else
|
|
|
airspaceTypeFix = 'airspace_type';
|
|
|
- if (tmpLine[airspaceTypeFix] == Common_1["default"].airspaceType.line && currentAirspaceIndex != i) {
|
|
|
- var lineProps = tmpLine;
|
|
|
- var _a = getLinesRouter(lineProps, lineStyle), lines = _a.lines, markers = _a.markers, polygons = _a.polygons;
|
|
|
- retMarkers.push.apply(retMarkers, markers);
|
|
|
- retLines.push.apply(retLines, lines);
|
|
|
- retPolygons.push.apply(retPolygons, polygons);
|
|
|
+ if (tmpLine[airspaceTypeFix] == Global.airspaceType.line && currentAirspaceIndex != i) {
|
|
|
+ let lineProps = tmpLine;
|
|
|
+ let { lines, markers, polygons } = getLinesRouter(lineProps, lineStyle);
|
|
|
+ retMarkers.push(...markers);
|
|
|
+ retLines.push(...lines);
|
|
|
+ retPolygons.push(...polygons);
|
|
|
}
|
|
|
}
|
|
|
return { lines: retLines, markers: retMarkers, polygons: retPolygons };
|
|
|
}
|
|
|
function getLinePolygonsAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- return reselect_1.createSelector(airspaceInfos, function () { return setStyle; }, currentAirspaceIndex, getLinesPolygonsAndMarkers);
|
|
|
+ return createSelector(airspaceInfos, () => setStyle, currentAirspaceIndex, getLinesPolygonsAndMarkers);
|
|
|
}
|
|
|
function getPolygon(polygonProps, polygonAndMarkerStyle) {
|
|
|
- var coordinates = new Array();
|
|
|
- var markers = new Array();
|
|
|
- var _a = getDefaultStyle(), imageName = _a.imageName, lineWidth = _a.lineWidth, strokeColor = _a.strokeColor, fillColor = _a.fillColor;
|
|
|
+ let coordinates = new Array();
|
|
|
+ let markers = new Array();
|
|
|
+ let { imageName, lineWidth, strokeColor, fillColor } = getDefaultStyle();
|
|
|
if (polygonAndMarkerStyle) {
|
|
|
imageName = polygonAndMarkerStyle.imageName;
|
|
|
lineWidth = polygonAndMarkerStyle.lineWidth;
|
|
|
strokeColor = polygonAndMarkerStyle.strokeColor;
|
|
|
fillColor = polygonAndMarkerStyle.fillColor;
|
|
|
}
|
|
|
- var pointsFix, dataType;
|
|
|
+ let pointsFix, dataType;
|
|
|
if (polygonProps.points) {
|
|
|
pointsFix = 'points';
|
|
|
dataType = 2;
|
|
|
@@ -586,8 +561,7 @@ function getPolygon(polygonProps, polygonAndMarkerStyle) {
|
|
|
dataType = 1; // 驼峰模式
|
|
|
}
|
|
|
if (Array.isArray(polygonProps[pointsFix])) {
|
|
|
- for (var _i = 0, _b = polygonProps[pointsFix]; _i < _b.length; _i++) {
|
|
|
- var obj = _b[_i];
|
|
|
+ for (let obj of polygonProps[pointsFix]) {
|
|
|
if (!obj) {
|
|
|
continue;
|
|
|
}
|
|
|
@@ -595,115 +569,114 @@ function getPolygon(polygonProps, polygonAndMarkerStyle) {
|
|
|
markers.push(addOvalPointConfig(obj.lat, obj.lng, imageName, dataType));
|
|
|
}
|
|
|
}
|
|
|
- var polygon = { lineWidth: lineWidth, strokeColor: strokeColor, fillColor: fillColor, coordinates: coordinates };
|
|
|
- return { markers: markers, polygon: polygon };
|
|
|
+ let polygon = { lineWidth, strokeColor, fillColor, coordinates };
|
|
|
+ return { markers, polygon };
|
|
|
}
|
|
|
function getPolygonsAndMarkers(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- var markers = [];
|
|
|
- var polygons = [];
|
|
|
+ let markers = [];
|
|
|
+ let polygons = [];
|
|
|
if (!Array.isArray(airspaceInfos)) {
|
|
|
- return { markers: markers, polygons: polygons };
|
|
|
+ return { markers, polygons };
|
|
|
}
|
|
|
- var polygonAndMarkerStyle = setStyle('polygon');
|
|
|
- for (var i = 0; i < airspaceInfos.length; i++) {
|
|
|
- var polygon = airspaceInfos[i];
|
|
|
- var airspaceTypeFix = void 0;
|
|
|
+ let polygonAndMarkerStyle = setStyle('polygon');
|
|
|
+ for (let i = 0; i < airspaceInfos.length; i++) {
|
|
|
+ let polygon = airspaceInfos[i];
|
|
|
+ let airspaceTypeFix;
|
|
|
if (polygon.airspaceType)
|
|
|
airspaceTypeFix = 'airspaceType';
|
|
|
else
|
|
|
airspaceTypeFix = 'airspace_type';
|
|
|
- if (polygon[airspaceTypeFix] == Common_1["default"].airspaceType.polygon && currentAirspaceIndex != i) {
|
|
|
- var retObj = getPolygon(polygon, polygonAndMarkerStyle);
|
|
|
- markers.push.apply(markers, retObj.markers);
|
|
|
+ if (polygon[airspaceTypeFix] == Global.airspaceType.polygon && currentAirspaceIndex != i) {
|
|
|
+ let retObj = getPolygon(polygon, polygonAndMarkerStyle);
|
|
|
+ markers.push(...retObj.markers);
|
|
|
polygons.push(retObj.polygon);
|
|
|
}
|
|
|
}
|
|
|
- return { markers: markers, polygons: polygons };
|
|
|
+ return { markers, polygons };
|
|
|
}
|
|
|
function getPolygonAndMarkerSelector(airspaceInfos, setStyle, currentAirspaceIndex) {
|
|
|
- return reselect_1.createSelector(airspaceInfos, function () { return setStyle; }, currentAirspaceIndex, getPolygonsAndMarkers);
|
|
|
+ return createSelector(airspaceInfos, () => setStyle, currentAirspaceIndex, getPolygonsAndMarkers);
|
|
|
}
|
|
|
function getMarkers(circlesAndMarkers, polygonAndMarkers, lineAndMarkers) {
|
|
|
- var markers = [];
|
|
|
+ let markers = [];
|
|
|
if (circlesAndMarkers) {
|
|
|
- markers = circlesAndMarkers.markers.slice();
|
|
|
+ markers = [...circlesAndMarkers.markers];
|
|
|
}
|
|
|
if (polygonAndMarkers) {
|
|
|
- markers = markers.concat(polygonAndMarkers.markers);
|
|
|
+ markers = [...markers, ...polygonAndMarkers.markers];
|
|
|
}
|
|
|
if (lineAndMarkers) {
|
|
|
- markers = markers.concat(lineAndMarkers.markers);
|
|
|
+ markers = [...markers, ...lineAndMarkers.markers];
|
|
|
}
|
|
|
return markers;
|
|
|
}
|
|
|
function getMarkerSelector(circlesAndMarkers, polygonAndMarkers, lineAndMarkers) {
|
|
|
- return reselect_1.createSelector(circlesAndMarkers, polygonAndMarkers, lineAndMarkers, getMarkers);
|
|
|
+ return createSelector(circlesAndMarkers, polygonAndMarkers, lineAndMarkers, getMarkers);
|
|
|
}
|
|
|
function getRegionPoints(circles, lineAndMarkers, polygonAndMarkers) {
|
|
|
- var regionPoints = new Array();
|
|
|
- for (var i = 0; i < circles.length; i++) {
|
|
|
- regionPoints.push.apply(regionPoints, getCircleRegions(circles[i]));
|
|
|
+ let regionPoints = new Array();
|
|
|
+ for (let i = 0; i < circles.length; i++) {
|
|
|
+ regionPoints.push(...getCircleRegions(circles[i]));
|
|
|
}
|
|
|
- var lines = lineAndMarkers.lines;
|
|
|
- for (var i = 0; i < lines.length; i++) {
|
|
|
- regionPoints.push.apply(regionPoints, lines[i].coordinates);
|
|
|
+ let lines = lineAndMarkers.lines;
|
|
|
+ for (let i = 0; i < lines.length; i++) {
|
|
|
+ regionPoints.push(...lines[i].coordinates);
|
|
|
}
|
|
|
- var polygons = polygonAndMarkers.polygons;
|
|
|
- for (var i = 0; i < polygons.length; i++) {
|
|
|
- regionPoints.push.apply(regionPoints, polygons[i].coordinates);
|
|
|
+ let polygons = polygonAndMarkers.polygons;
|
|
|
+ for (let i = 0; i < polygons.length; i++) {
|
|
|
+ regionPoints.push(...polygons[i].coordinates);
|
|
|
}
|
|
|
return regionPoints;
|
|
|
}
|
|
|
function getRegionPointsSelector(circles, lineAndMarkers, polygonAndMarkers) {
|
|
|
- return reselect_1.createSelector(circles, lineAndMarkers, polygonAndMarkers, getRegionPoints);
|
|
|
+ return createSelector(circles, lineAndMarkers, polygonAndMarkers, getRegionPoints);
|
|
|
}
|
|
|
function getCircles(circlesAndMarkers) {
|
|
|
return circlesAndMarkers.circles;
|
|
|
}
|
|
|
function getCircleSelector(circlesAndMarkers) {
|
|
|
- return reselect_1.createSelector(circlesAndMarkers, getCircles);
|
|
|
+ return createSelector(circlesAndMarkers, getCircles);
|
|
|
}
|
|
|
function getLines(lineAndMarker) {
|
|
|
return lineAndMarker.lines;
|
|
|
}
|
|
|
function getLineSelector(lineAndMarker) {
|
|
|
- return reselect_1.createSelector(lineAndMarker, getLines);
|
|
|
+ return createSelector(lineAndMarker, getLines);
|
|
|
}
|
|
|
function getPolygons(polygonAndMarkers, linePolygonsAndMarkers) {
|
|
|
- return polygonAndMarkers.polygons.concat(linePolygonsAndMarkers.polygons);
|
|
|
+ return [...polygonAndMarkers.polygons, ...linePolygonsAndMarkers.polygons];
|
|
|
}
|
|
|
function getPolygonSelector(polygonAndMarkers, linePolygonsAndMarkers) {
|
|
|
- return reselect_1.createSelector(polygonAndMarkers, linePolygonsAndMarkers, getPolygons);
|
|
|
+ return createSelector(polygonAndMarkers, linePolygonsAndMarkers, getPolygons);
|
|
|
}
|
|
|
-var setStyle = function (styles) {
|
|
|
+let setStyle = (styles) => {
|
|
|
if (!styles)
|
|
|
- return function () { return null; };
|
|
|
+ return () => null;
|
|
|
else
|
|
|
- return function (shapeName) { return styles[shapeName]; };
|
|
|
+ return (shapeName) => styles[shapeName];
|
|
|
};
|
|
|
//获取selector
|
|
|
-function getShapesSelector(airspaceInfos, style, currentAirspaceIndex) {
|
|
|
- currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : function () { return -1; };
|
|
|
- var circlesAndMarkers = getCircleAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
- var circles = getCircleSelector(circlesAndMarkers);
|
|
|
- var linePolygonsAndMarkers = getLinePolygonsAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
- var lines = getLineSelector(linePolygonsAndMarkers);
|
|
|
- var polygonAndMarkers = getPolygonAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
- var polygons = getPolygonSelector(polygonAndMarkers, linePolygonsAndMarkers);
|
|
|
- var markers = getMarkerSelector(circlesAndMarkers, polygonAndMarkers, linePolygonsAndMarkers);
|
|
|
- var regionPoints = getRegionPointsSelector(circles, linePolygonsAndMarkers, polygonAndMarkers);
|
|
|
+export function getShapesSelector(airspaceInfos, style, currentAirspaceIndex) {
|
|
|
+ currentAirspaceIndex = currentAirspaceIndex ? currentAirspaceIndex : () => -1;
|
|
|
+ let circlesAndMarkers = getCircleAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
+ let circles = getCircleSelector(circlesAndMarkers);
|
|
|
+ let linePolygonsAndMarkers = getLinePolygonsAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
+ let lines = getLineSelector(linePolygonsAndMarkers);
|
|
|
+ let polygonAndMarkers = getPolygonAndMarkerSelector(airspaceInfos, setStyle(style), currentAirspaceIndex);
|
|
|
+ let polygons = getPolygonSelector(polygonAndMarkers, linePolygonsAndMarkers);
|
|
|
+ let markers = getMarkerSelector(circlesAndMarkers, polygonAndMarkers, linePolygonsAndMarkers);
|
|
|
+ let regionPoints = getRegionPointsSelector(circles, linePolygonsAndMarkers, polygonAndMarkers);
|
|
|
return {
|
|
|
- markers: markers,
|
|
|
- circles: circles,
|
|
|
- lines: lines,
|
|
|
- polygons: polygons,
|
|
|
- regionPoints: regionPoints
|
|
|
+ markers,
|
|
|
+ circles,
|
|
|
+ lines,
|
|
|
+ polygons,
|
|
|
+ regionPoints
|
|
|
};
|
|
|
}
|
|
|
-exports.getShapesSelector = getShapesSelector;
|
|
|
//获取数组
|
|
|
-function getShapes(airspaceInfos, style, currentAirspaceIndex) {
|
|
|
- var _a = getShapesSelector(function () { return airspaceInfos; }, style, function () { return currentAirspaceIndex; }), markers = _a.markers, polygons = _a.polygons, circles = _a.circles, lines = _a.lines, regionPoints = _a.regionPoints;
|
|
|
+export function getShapes(airspaceInfos, style, currentAirspaceIndex) {
|
|
|
+ let { markers, polygons, circles, lines, regionPoints } = getShapesSelector(() => airspaceInfos, style, () => currentAirspaceIndex);
|
|
|
return {
|
|
|
markers: markers(airspaceInfos),
|
|
|
circles: circles(airspaceInfos),
|
|
|
@@ -712,7 +685,6 @@ function getShapes(airspaceInfos, style, currentAirspaceIndex) {
|
|
|
regionPoints: regionPoints(airspaceInfos)
|
|
|
};
|
|
|
}
|
|
|
-exports.getShapes = getShapes;
|
|
|
// 总共 5 种格式, http://git.corp.brilliantaero.com/BA/Coco/issues/99#note_6358
|
|
|
// 1. 全输出格式
|
|
|
// 2. 简化格式
|
|
|
@@ -720,21 +692,21 @@ exports.getShapes = getShapes;
|
|
|
// 4. 用户端用的简化格式
|
|
|
// 5. 极简格式
|
|
|
function getHeight(height, unit, type) {
|
|
|
- var shortNum;
|
|
|
- var num = +height; // to number
|
|
|
+ let shortNum;
|
|
|
+ const num = +height; // to number
|
|
|
if (num >= 100) {
|
|
|
shortNum = parseInt(num / 100 + '').toString();
|
|
|
if (shortNum.length < 2) {
|
|
|
shortNum = '0' + shortNum;
|
|
|
}
|
|
|
}
|
|
|
- var heightStandard = Common_1["default"].heightStandardsById.get(unit);
|
|
|
+ let heightStandard = Global.heightStandardsById.get(unit);
|
|
|
if (!heightStandard) {
|
|
|
heightStandard = unit;
|
|
|
}
|
|
|
// 这里统一使用数字判断
|
|
|
- var standardUnit = Common_1["default"].heightStandards.get(heightStandard);
|
|
|
- var heightDesc;
|
|
|
+ let standardUnit = Global.heightStandards.get(heightStandard);
|
|
|
+ let heightDesc;
|
|
|
switch (standardUnit) {
|
|
|
case 1:
|
|
|
heightDesc = ['H*真', '真高*米'];
|
|
|
@@ -759,187 +731,181 @@ function getHeight(height, unit, type) {
|
|
|
}
|
|
|
function getAirspaceName(airspaceInfo) {
|
|
|
if (airspaceInfo.airspace_name) {
|
|
|
- var ai = airspaceInfo;
|
|
|
+ const ai = airspaceInfo;
|
|
|
return ai.airspace_name;
|
|
|
}
|
|
|
else {
|
|
|
- var ai = airspaceInfo;
|
|
|
+ const ai = airspaceInfo;
|
|
|
return ai.name;
|
|
|
}
|
|
|
}
|
|
|
-function circleContent(airspaceInfo, type) {
|
|
|
- if (type === void 0) { type = 3; }
|
|
|
+export function circleContent(airspaceInfo, type = 3) {
|
|
|
if (type == 5)
|
|
|
return getAirspaceName(airspaceInfo);
|
|
|
if ('airspace_name' in airspaceInfo) {
|
|
|
- var lat = Utils_1.latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lat);
|
|
|
- var lng = Utils_1.latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lng);
|
|
|
- var content = [];
|
|
|
- var loc = "\u4EE5" + airspaceInfo.center_loc;
|
|
|
+ const lat = latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lat);
|
|
|
+ const lng = latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lng);
|
|
|
+ let content = [];
|
|
|
+ let loc = `以${airspaceInfo.center_loc}`;
|
|
|
if (type == 1 || type == 3)
|
|
|
- loc += "(E" + lng + ", N" + lat + ")";
|
|
|
- content.push(loc + "\u4E3A\u4E2D\u5FC3");
|
|
|
- content.push("\u534A\u5F84" + airspaceInfo.radius_of_flying + "\u7C73");
|
|
|
+ loc += `(E${lng}, N${lat})`;
|
|
|
+ content.push(`${loc}为中心`);
|
|
|
+ content.push(`半径${airspaceInfo.radius_of_flying}米`);
|
|
|
content.push(getHeight(airspaceInfo.altitude, airspaceInfo.unit, type));
|
|
|
if (airspaceInfo.note)
|
|
|
- content.push("\u5907\u6CE8\uFF1A" + airspaceInfo.note);
|
|
|
+ content.push(`备注:${airspaceInfo.note}`);
|
|
|
return content.join(',');
|
|
|
}
|
|
|
else {
|
|
|
- var content = [];
|
|
|
- var loc = "\u4EE5" + airspaceInfo.addr;
|
|
|
+ let content = [];
|
|
|
+ let loc = `以${airspaceInfo.addr}`;
|
|
|
if (type == 1 || type == 3)
|
|
|
- loc += "(E" + airspaceInfo.lng + ", N" + airspaceInfo.lat + ")";
|
|
|
- content.push(loc + "\u4E3A\u4E2D\u5FC3");
|
|
|
- content.push("\u534A\u5F84" + airspaceInfo.radius + "\u7C73");
|
|
|
+ loc += `(E${airspaceInfo.lng}, N${airspaceInfo.lat})`;
|
|
|
+ content.push(`${loc}为中心`);
|
|
|
+ content.push(`半径${airspaceInfo.radius}米`);
|
|
|
content.push(getHeight(airspaceInfo.height, airspaceInfo.heightStandard, type));
|
|
|
if (airspaceInfo.note)
|
|
|
- content.push("\u5907\u6CE8\uFF1A" + airspaceInfo.note);
|
|
|
+ content.push(`备注:${airspaceInfo.note}`);
|
|
|
return content.join(',');
|
|
|
}
|
|
|
}
|
|
|
-exports.circleContent = circleContent;
|
|
|
-function flyingCenter(item) {
|
|
|
- if (item === void 0) { item = {}; }
|
|
|
+function flyingCenter(item = {}) {
|
|
|
if (item == {}) {
|
|
|
return "";
|
|
|
}
|
|
|
- var pp = item;
|
|
|
- return ("(E" + Utils_1.latLngDecimalToDegrees(pp.lng) +
|
|
|
+ const pp = item;
|
|
|
+ return ("(E" + latLngDecimalToDegrees(pp.lng) +
|
|
|
', ' +
|
|
|
- "N" + Utils_1.latLngDecimalToDegrees(pp.lat) + ")");
|
|
|
+ "N" + latLngDecimalToDegrees(pp.lat) + ")");
|
|
|
}
|
|
|
-function lineContent(airspaceInfo, type) {
|
|
|
- if (type === void 0) { type = 3; }
|
|
|
+export function lineContent(airspaceInfo, type = 3) {
|
|
|
if (type == 5)
|
|
|
return getAirspaceName(airspaceInfo);
|
|
|
if ('airspace_name' in airspaceInfo) {
|
|
|
- var content = [];
|
|
|
- content.push("" + airspaceInfo.start_loc);
|
|
|
+ let content = [];
|
|
|
+ content.push(`${airspaceInfo.start_loc}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("" + flyingCenter(airspaceInfo.start_point));
|
|
|
- content.push(" - ");
|
|
|
+ content.push(`${flyingCenter(airspaceInfo.start_point)}`);
|
|
|
+ content.push(` - `);
|
|
|
content.push(getHeight(airspaceInfo.start_point.altitude, airspaceInfo.start_point.unit, type));
|
|
|
- var passing_points = airspaceInfo.passing_points;
|
|
|
+ const passing_points = airspaceInfo.passing_points;
|
|
|
if (Array.isArray(passing_points)) {
|
|
|
- for (var i = 0; i < passing_points.length; i++) {
|
|
|
- var obj = passing_points[i];
|
|
|
- if (obj.point_type == Common_1["default"].pointTypes.point) {
|
|
|
- var pp = obj;
|
|
|
- var lat = Utils_1.latLngDecimalToDegrees(pp.lat);
|
|
|
- var lng = Utils_1.latLngDecimalToDegrees(pp.lng);
|
|
|
- content.push(" - " + pp.point_name);
|
|
|
+ for (let i = 0; i < passing_points.length; i++) {
|
|
|
+ const obj = passing_points[i];
|
|
|
+ if (obj.point_type == Global.pointTypes.point) {
|
|
|
+ let pp = obj;
|
|
|
+ const lat = latLngDecimalToDegrees(pp.lat);
|
|
|
+ const lng = latLngDecimalToDegrees(pp.lng);
|
|
|
+ content.push(` - ${pp.point_name}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + lng + ", N" + lat + ")");
|
|
|
+ content.push(`(E${lng}, N${lat})`);
|
|
|
}
|
|
|
- else if (obj.point_type == Common_1["default"].pointTypes.nav) {
|
|
|
- var pp = obj;
|
|
|
- var lat = Utils_1.latLngDecimalToDegrees(pp.lat);
|
|
|
- var lng = Utils_1.latLngDecimalToDegrees(pp.lng);
|
|
|
- content.push(" - " + pp.point_code);
|
|
|
+ else if (obj.point_type == Global.pointTypes.nav) {
|
|
|
+ let pp = obj;
|
|
|
+ const lat = latLngDecimalToDegrees(pp.lat);
|
|
|
+ const lng = latLngDecimalToDegrees(pp.lng);
|
|
|
+ content.push(` - ${pp.point_code}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + lng + ", N" + lat + ")");
|
|
|
+ content.push(`(E${lng}, N${lat})`);
|
|
|
}
|
|
|
else {
|
|
|
- var pp = obj;
|
|
|
- content.push(" - " + pp.air_route_code);
|
|
|
+ let pp = obj;
|
|
|
+ content.push(` - ${pp.air_route_code}`);
|
|
|
}
|
|
|
if (obj.altitude) {
|
|
|
- content.push(" - " + getHeight(obj.altitude, obj.unit, type));
|
|
|
+ content.push(` - ${getHeight(obj.altitude, obj.unit, type)}`);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- content.push(" - " + airspaceInfo.end_loc);
|
|
|
+ content.push(` - ${airspaceInfo.end_loc}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("" + flyingCenter(airspaceInfo.end_point));
|
|
|
- if (Utils_1.isSafeString(airspaceInfo.airline_width)) {
|
|
|
- content.push("\uFF0C\u5BBD\u5EA6\uFF1A" + airspaceInfo.airline_width + "\u7C73");
|
|
|
+ content.push(`${flyingCenter(airspaceInfo.end_point)}`);
|
|
|
+ if (isSafeString(airspaceInfo.airline_width)) {
|
|
|
+ content.push(`,宽度:${airspaceInfo.airline_width}米`);
|
|
|
}
|
|
|
- if (Utils_1.isSafeString(airspaceInfo.note)) {
|
|
|
- content.push("\uFF0C\u5907\u6CE8\uFF1A " + airspaceInfo.note);
|
|
|
+ if (isSafeString(airspaceInfo.note)) {
|
|
|
+ content.push(`,备注: ${airspaceInfo.note}`);
|
|
|
}
|
|
|
- var result = content.join("");
|
|
|
+ let result = content.join("");
|
|
|
return result;
|
|
|
}
|
|
|
else {
|
|
|
- var content = [];
|
|
|
- content.push("" + airspaceInfo.dep.addr);
|
|
|
+ let content = [];
|
|
|
+ content.push(`${airspaceInfo.dep.addr}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + airspaceInfo.dep.lng + ", N" + airspaceInfo.dep.lat + ")");
|
|
|
- content.push(" - " + getHeight(airspaceInfo.dep.height, airspaceInfo.dep.heightStandard, type));
|
|
|
+ content.push(`(E${airspaceInfo.dep.lng}, N${airspaceInfo.dep.lat})`);
|
|
|
+ content.push(` - ${getHeight(airspaceInfo.dep.height, airspaceInfo.dep.heightStandard, type)}`);
|
|
|
if (Array.isArray(airspaceInfo.passPoints)) {
|
|
|
- var length_1 = airspaceInfo.passPoints.length;
|
|
|
- for (var i = 0; i < length_1; i++) {
|
|
|
- var obj = airspaceInfo.passPoints[i];
|
|
|
- if (obj.pointType == Common_1["default"].pointTypes.point) {
|
|
|
- var pp = obj;
|
|
|
- content.push(" - " + pp.addr);
|
|
|
+ let length = airspaceInfo.passPoints.length;
|
|
|
+ for (let i = 0; i < length; i++) {
|
|
|
+ let obj = airspaceInfo.passPoints[i];
|
|
|
+ if (obj.pointType == Global.pointTypes.point) {
|
|
|
+ let pp = obj;
|
|
|
+ content.push(` - ${pp.addr}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + pp.lng + ", N" + pp.lat + ")");
|
|
|
+ content.push(`(E${pp.lng}, N${pp.lat})`);
|
|
|
}
|
|
|
- else if (obj.pointType == Common_1["default"].pointTypes.nav) {
|
|
|
- var pp = obj;
|
|
|
- content.push(" - " + pp.pointCode);
|
|
|
+ else if (obj.pointType == Global.pointTypes.nav) {
|
|
|
+ let pp = obj;
|
|
|
+ content.push(` - ${pp.pointCode}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + pp.lng + ", N" + pp.lat + ")");
|
|
|
+ content.push(`(E${pp.lng}, N${pp.lat})`);
|
|
|
}
|
|
|
else {
|
|
|
- var pp = obj;
|
|
|
- content.push(" - " + pp.airlineCode);
|
|
|
+ let pp = obj;
|
|
|
+ content.push(` - ${pp.airlineCode}`);
|
|
|
}
|
|
|
if (obj.height) {
|
|
|
- content.push(" - " + getHeight(obj.height, obj.heightStandard, type));
|
|
|
+ content.push(` - ${getHeight(obj.height, obj.heightStandard, type)}`);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- content.push(" - " + airspaceInfo.arrive.addr);
|
|
|
+ content.push(` - ${airspaceInfo.arrive.addr}`);
|
|
|
if (type == 1 || type == 3)
|
|
|
- content.push("(E" + airspaceInfo.arrive.lng + ", N" + airspaceInfo.arrive.lat + ")");
|
|
|
+ content.push(`(E${airspaceInfo.arrive.lng}, N${airspaceInfo.arrive.lat})`);
|
|
|
if (airspaceInfo.airlineWidth) {
|
|
|
- content.push("\uFF0C\u5BBD\u5EA6\uFF1A" + airspaceInfo.airlineWidth + "\u7C73");
|
|
|
+ content.push(`,宽度:${airspaceInfo.airlineWidth}米`);
|
|
|
}
|
|
|
if (airspaceInfo.note)
|
|
|
- content.push("\uFF0C\u5907\u6CE8\uFF1A" + airspaceInfo.note);
|
|
|
+ content.push(`,备注:${airspaceInfo.note}`);
|
|
|
return content.join('');
|
|
|
}
|
|
|
}
|
|
|
-exports.lineContent = lineContent;
|
|
|
-function polygonContent(airspaceInfo, type) {
|
|
|
- if (type === void 0) { type = 3; }
|
|
|
+export function polygonContent(airspaceInfo, type = 3) {
|
|
|
if (type == 5)
|
|
|
return getAirspaceName(airspaceInfo);
|
|
|
if ('airspace_name' in airspaceInfo) {
|
|
|
- var res = [];
|
|
|
- var points = airspaceInfo.points;
|
|
|
- for (var i = 0; i < points.length; i++) {
|
|
|
- var c = "" + (points[i].addr ? points[i].addr : '');
|
|
|
+ let res = [];
|
|
|
+ let points = airspaceInfo.points;
|
|
|
+ for (let i = 0; i < points.length; i++) {
|
|
|
+ let c = `${points[i].addr ? points[i].addr : ''}`;
|
|
|
if (type == 1 || type == 3)
|
|
|
- c += "(E" + Utils_1.latLngDecimalToDegrees(points[i].lng) + ", N" + Utils_1.latLngDecimalToDegrees(points[i].lat) + ")";
|
|
|
+ c += `(E${latLngDecimalToDegrees(points[i].lng)}, N${latLngDecimalToDegrees(points[i].lat)})`;
|
|
|
res.push(c);
|
|
|
}
|
|
|
- var content = [res.join('、')];
|
|
|
- content.push(airspaceInfo.points.length + "\u70B9\u8FDE\u7EBF\u8303\u56F4\u5185");
|
|
|
- content.push("\uFF0C" + getHeight(airspaceInfo.altitude, airspaceInfo.unit, type));
|
|
|
- if (Utils_1.isSafeString(airspaceInfo.note)) {
|
|
|
- content.push("\uFF0C\u5907\u6CE8\uFF1A" + airspaceInfo.note);
|
|
|
+ let content = [res.join('、')];
|
|
|
+ content.push(`${airspaceInfo.points.length}点连线范围内`);
|
|
|
+ content.push(`,${getHeight(airspaceInfo.altitude, airspaceInfo.unit, type)}`);
|
|
|
+ if (isSafeString(airspaceInfo.note)) {
|
|
|
+ content.push(`,备注:${airspaceInfo.note}`);
|
|
|
}
|
|
|
return content.join('');
|
|
|
}
|
|
|
else {
|
|
|
- var content = [];
|
|
|
- var length_2 = airspaceInfo.polygonPoints.length;
|
|
|
- for (var i = 0; i < length_2; i++) {
|
|
|
- var obj = airspaceInfo.polygonPoints[i];
|
|
|
- var c = "" + (obj.addr ? obj.addr : '');
|
|
|
+ let content = [];
|
|
|
+ let length = airspaceInfo.polygonPoints.length;
|
|
|
+ for (let i = 0; i < length; i++) {
|
|
|
+ let obj = airspaceInfo.polygonPoints[i];
|
|
|
+ let c = `${obj.addr ? obj.addr : ''}`;
|
|
|
if (type == 1 || type == 3)
|
|
|
- c += "(E" + obj.lng + ", N" + obj.lat + ")";
|
|
|
+ c += `(E${obj.lng}, N${obj.lat})`;
|
|
|
content.push(c);
|
|
|
}
|
|
|
- var cc = content.join('、') + (length_2 + "\u70B9\u8FDE\u7EBF\u8303\u56F4\u5185");
|
|
|
- cc += "\uFF0C" + getHeight(airspaceInfo.height, airspaceInfo.heightStandard, type);
|
|
|
+ let cc = content.join('、') + `${length}点连线范围内`;
|
|
|
+ cc += `,${getHeight(airspaceInfo.height, airspaceInfo.heightStandard, type)}`;
|
|
|
if (airspaceInfo.note)
|
|
|
- cc = content + "\uFF0C\u5907\u6CE8\uFF1A" + airspaceInfo.note;
|
|
|
+ cc += `,备注:${airspaceInfo.note}`;
|
|
|
return cc;
|
|
|
}
|
|
|
}
|
|
|
-exports.polygonContent = polygonContent;
|
|
|
+export { latLngDegreesToDecimal, latLngDecimalToDegrees };
|