|
@@ -27,6 +27,7 @@ import android.widget.RelativeLayout;
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
import android.widget.Toast;
|
|
import android.widget.Toast;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
import com.amap.api.location.AMapLocation;
|
|
import com.amap.api.location.AMapLocation;
|
|
import com.amap.api.location.AMapLocationClient;
|
|
import com.amap.api.location.AMapLocationClient;
|
|
import com.amap.api.location.AMapLocationClientOption;
|
|
import com.amap.api.location.AMapLocationClientOption;
|
|
@@ -1366,7 +1367,7 @@ public class APIModuleGis extends UZModule {
|
|
class AMapZidingyiLocation{
|
|
class AMapZidingyiLocation{
|
|
int code = 1; //0--成功;非0--失败
|
|
int code = 1; //0--成功;非0--失败
|
|
long acceptTime = 0L; //接收高德定位回调的时间
|
|
long acceptTime = 0L; //接收高德定位回调的时间
|
|
- AMapLocation data = null; //高德定位结果
|
|
|
|
|
|
+ Map<String,Object> data = null; //高德定位结果
|
|
|
|
|
|
public AMapZidingyiLocation(){
|
|
public AMapZidingyiLocation(){
|
|
|
|
|
|
@@ -1374,10 +1375,35 @@ public class APIModuleGis extends UZModule {
|
|
public AMapZidingyiLocation(int code,long acceptTime,AMapLocation data){
|
|
public AMapZidingyiLocation(int code,long acceptTime,AMapLocation data){
|
|
this.code = code;
|
|
this.code = code;
|
|
this.acceptTime = acceptTime;
|
|
this.acceptTime = acceptTime;
|
|
- this.data = data;
|
|
|
|
|
|
+ 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());//定位错误码
|
|
|
|
+ this.data = newData;
|
|
}
|
|
}
|
|
public String toString(){
|
|
public String toString(){
|
|
- return "{\"code\":"+code+",\"acceptTime\":"+acceptTime+",\"data\":"+ (data==null?"":com.qx.wz.external.fastjson.JSONObject.toJSONString(data)) +"}";
|
|
|
|
|
|
+ return "{\"code\":"+code+",\"acceptTime\":"+acceptTime+",\"data\":"+ (data==null?"{}": com.alibaba.fastjson.JSONObject.toJSONString(data)) +"}";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
CircularFifoQueue<AMapZidingyiLocation> lastAMapLocations = new CircularFifoQueue<>(10);
|
|
CircularFifoQueue<AMapZidingyiLocation> lastAMapLocations = new CircularFifoQueue<>(10);
|