Parcourir la source

APIModuleGis 2.1.2 高德地图SDK 修改相关代码

1037015548@qq.com il y a 6 mois
Parent
commit
9eee32950d
1 fichiers modifiés avec 26 ajouts et 24 suppressions
  1. 26 24
      moduleGis/src/main/java/com/example/moduleGis/APIModuleGis.java

+ 26 - 24
moduleGis/src/main/java/com/example/moduleGis/APIModuleGis.java

@@ -1376,30 +1376,32 @@ public class APIModuleGis extends UZModule {
 			this.code = code;
 			this.acceptTime = acceptTime;
 			Map<String,Object> newData = new HashMap<>();
-			newData.put("latitude",data.getLatitude());//纬度
-			newData.put("longitude",data.getLongitude());//经度
-			newData.put("accurac",data.getAccuracy());//精度
-			newData.put("altitude",data.getAltitude());//海拔
-			newData.put("speed",data.getSpeed());//速度
-			newData.put("bearing",data.getBearing());//方向角
-			newData.put("buildingId",data.getBuildingId());//室内定位建筑物Id
-			newData.put("floor",data.getFloor());//室内定位楼层
-			newData.put("address",data.getAddress());//地址描述
-			newData.put("country",data.getCountry());//国家
-			newData.put("province",data.getProvince());//省份
-			newData.put("city",data.getCity());//城市
-			newData.put("district",data.getDistrict());//城区
-			newData.put("street",data.getStreet());//街道
-			newData.put("streetNum",data.getStreetNum());//街道门牌号
-			newData.put("cityCod",data.getCityCode());//城市编码
-			newData.put("adCode",data.getAdCode());//区域编码
-			newData.put("poiName",data.getPoiName());//当前位置POI名称
-			newData.put("aoiName",data.getAoiName());//当前位置所处AOI名称
-			newData.put("gpsAccuracyStatus",data.getGpsAccuracyStatus());//设备当前 GPS 状态
-			newData.put("locationType",data.getLocationType());//定位来源
-			newData.put("locationDetail",data.getLocationDetail());//定位信息描述
-			newData.put("errorInfo",data.getErrorInfo());//定位错误信息描述
-			newData.put("errorCode",data.getErrorCode());//定位错误码
+			if(data!=null) {
+				newData.put("latitude", data.getLatitude());//纬度
+				newData.put("longitude", data.getLongitude());//经度
+				newData.put("accurac", data.getAccuracy());//精度
+				newData.put("altitude", data.getAltitude());//海拔
+				newData.put("speed", data.getSpeed());//速度
+				newData.put("bearing", data.getBearing());//方向角
+				newData.put("buildingId", data.getBuildingId());//室内定位建筑物Id
+				newData.put("floor", data.getFloor());//室内定位楼层
+				newData.put("address", data.getAddress());//地址描述
+				newData.put("country", data.getCountry());//国家
+				newData.put("province", data.getProvince());//省份
+				newData.put("city", data.getCity());//城市
+				newData.put("district", data.getDistrict());//城区
+				newData.put("street", data.getStreet());//街道
+				newData.put("streetNum", data.getStreetNum());//街道门牌号
+				newData.put("cityCod", data.getCityCode());//城市编码
+				newData.put("adCode", data.getAdCode());//区域编码
+				newData.put("poiName", data.getPoiName());//当前位置POI名称
+				newData.put("aoiName", data.getAoiName());//当前位置所处AOI名称
+				newData.put("gpsAccuracyStatus", data.getGpsAccuracyStatus());//设备当前 GPS 状态
+				newData.put("locationType", data.getLocationType());//定位来源
+				newData.put("locationDetail", data.getLocationDetail());//定位信息描述
+				newData.put("errorInfo", data.getErrorInfo());//定位错误信息描述
+				newData.put("errorCode", data.getErrorCode());//定位错误码
+			}
 			this.data = newData;
 		}
 		public String toString(){