Sfoglia il codice sorgente

添加free_draw字段

guohui.deng 6 anni fa
parent
commit
0e5e4c1129
1 ha cambiato i file con 18 aggiunte e 6 eliminazioni
  1. 18 6
      index.ts

+ 18 - 6
index.ts

@@ -96,6 +96,7 @@ export interface AirspaceInfoCircleServer {
     radius_of_flying: number;
     altitude: number;
     unit: number;
+    free_draw?: boolean;
 }
 
 export interface AirspaceInfoLineServer {
@@ -110,6 +111,7 @@ export interface AirspaceInfoLineServer {
     end_point: CoordinateShort;
     passing_points: Array<PassingPointServer>;
     airline_width?: number;
+    free_draw?: boolean;
 }
 
 export interface AirspaceInfoPolygonServer {
@@ -121,6 +123,7 @@ export interface AirspaceInfoPolygonServer {
     points: Array<LatLngAddrServer>;
     altitude: number;
     unit: number;
+    free_draw?: boolean;
 }
 
 // Local
@@ -180,6 +183,7 @@ export interface AirspaceInfoCircleLocal {
     radius: number;
     height: string;
     heightStandard: string;
+    isDraw?: boolean;
 }
 
 export interface AirspaceInfoLineLocal {
@@ -192,6 +196,7 @@ export interface AirspaceInfoLineLocal {
     arrive: LatLngAddrLocal;
     passPoints: Array<PassingPointLocal>;
     airlineWidth?: number;
+    isDraw?: boolean;
 }
 
 export interface AirspaceInfoPolygonLocal {
@@ -203,6 +208,7 @@ export interface AirspaceInfoPolygonLocal {
     polygonPoints: Array<LatLngAddrLocal>;
     height: string;
     heightStandard: string;
+    isDraw?: boolean;
 }
 
 declare type AirspaceInfoCircle = AirspaceInfoCircleLocal | AirspaceInfoCircleServer;
@@ -273,7 +279,8 @@ export function convertAirspaceInfoServerToLocal(airspaceInfo
             lng: ai.center_point_of_flying.lng,
             radius: ai.radius_of_flying,
             height: ai.altitude + "",
-            heightStandard: Global.heightStandardsById.get(ai.unit)
+            heightStandard: Global.heightStandardsById.get(ai.unit),
+            isDraw: ai.free_draw
         };
     }
 
@@ -349,7 +356,8 @@ export function convertAirspaceInfoServerToLocal(airspaceInfo
             note: ai.note,
             dep,
             arrive,
-            passPoints
+            passPoints,
+            isDraw: ai.free_draw
         }, ...(ai.airline_width ? {airlineWidth: ai.airline_width} : {})}
     }
 
@@ -376,7 +384,8 @@ export function convertAirspaceInfoServerToLocal(airspaceInfo
                 note: ai.note,
                 height: ai.altitude + '',
                 heightStandard: Global.heightStandardsById.get(ai.unit),
-                polygonPoints
+                polygonPoints,
+                isDraw: ai.free_draw
             };
         }
     }
@@ -401,7 +410,8 @@ export function convertAirspaceInfoLocalToServer(airspace
             },
             center_loc: ai.addr,
             altitude: parseInt(ai.height),
-            unit: Global.heightStandards.get(ai.heightStandard)
+            unit: Global.heightStandards.get(ai.heightStandard),
+            free_draw: ai.isDraw
         };
         return circle
     } else if (airspace.airspaceType == Global.airspaceType.line) {
@@ -422,7 +432,8 @@ export function convertAirspaceInfoLocalToServer(airspace
             end_point: {
                 lng: ai.arrive.lng,
                 lat: ai.arrive.lat
-            }
+            },
+            free_draw: ai.isDraw
         }
         if(ai.airlineWidth) {
             line['airline_width'] = ai.airlineWidth
@@ -484,7 +495,8 @@ export function convertAirspaceInfoLocalToServer(airspace
             note: ai.note,
             altitude: parseInt(ai.height),
             unit: Global.heightStandards.get(ai.heightStandard),
-            points: ai.polygonPoints
+            points: ai.polygonPoints,
+            free_draw: ai.isDraw
         };
         return polygon;
     }