Browse Source

修改判断格式的方法

wd 7 years ago
parent
commit
4bfb9d7745
1 changed files with 3 additions and 3 deletions
  1. 3 3
      index.js

+ 3 - 3
index.js

@@ -605,7 +605,7 @@ export function circleContent(airspaceInfo, type=3) {
     if(type == 5)
         return getAirspaceName(airspaceInfo)
 
-    if(airspaceInfo.airspace_name) {
+    if('airspace_name' in airspaceInfo) {
         const lat = latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lat);
         const lng = latLngDecimalToDegrees(airspaceInfo.center_point_of_flying.lng);
         let content = [];
@@ -651,7 +651,7 @@ export function lineContent(airspaceInfo, type=3) {
     if(type == 5)
         return getAirspaceName(airspaceInfo)
 
-    if(airspaceInfo.airspace_name) {
+    if('airspace_name' in airspaceInfo) {
         let content = [];
         content.push(`${airspaceInfo.start_loc}`)
         if(type == 1 || type == 3)
@@ -744,7 +744,7 @@ export function polygonContent(airspaceInfo, type=3) {
     if(type == 5)
         return getAirspaceName(airspaceInfo)
 
-    if(airspaceInfo.airspace_name) {
+    if('airspace_name' in airspaceInfo) {
         let res = []
         let points = airspaceInfo.points
         for (let i = 0; i < points.length; i++) {