|
@@ -1312,6 +1312,12 @@ public class APIModuleGis extends UZModule {
|
|
synchronized (LATCH_COMM){
|
|
synchronized (LATCH_COMM){
|
|
lastAMapLocations.add(result);
|
|
lastAMapLocations.add(result);
|
|
}
|
|
}
|
|
|
|
+ if (mWaitAMapSingleBack.compareAndSet(true, false)){
|
|
|
|
+ if (mLocationClient != null){
|
|
|
|
+ mLocationClient.stopLocation();
|
|
|
|
+ mStartedAMapLocation.set(false);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -1332,6 +1338,7 @@ public class APIModuleGis extends UZModule {
|
|
mLocationClient.onDestroy();
|
|
mLocationClient.onDestroy();
|
|
mInitedAMapSdk.set(false);
|
|
mInitedAMapSdk.set(false);
|
|
mStartedAMapLocation.set(false);
|
|
mStartedAMapLocation.set(false);
|
|
|
|
+ mWaitAMapSingleBack.set(false);
|
|
}
|
|
}
|
|
//初始化定位
|
|
//初始化定位
|
|
mLocationClient = new AMapLocationClient(moduleContext.getContext());
|
|
mLocationClient = new AMapLocationClient(moduleContext.getContext());
|
|
@@ -1355,6 +1362,7 @@ public class APIModuleGis extends UZModule {
|
|
private final byte[] LATCH_COMM = new byte[0];
|
|
private final byte[] LATCH_COMM = new byte[0];
|
|
AtomicBoolean mInitedAMapSdk = new AtomicBoolean(false);
|
|
AtomicBoolean mInitedAMapSdk = new AtomicBoolean(false);
|
|
AtomicBoolean mStartedAMapLocation = new AtomicBoolean(false);
|
|
AtomicBoolean mStartedAMapLocation = new AtomicBoolean(false);
|
|
|
|
+ AtomicBoolean mWaitAMapSingleBack = new AtomicBoolean(false);
|
|
class AMapZidingyiLocation{
|
|
class AMapZidingyiLocation{
|
|
int code = 1; //0--成功;非0--失败
|
|
int code = 1; //0--成功;非0--失败
|
|
long acceptTime = 0L; //接收高德定位回调的时间
|
|
long acceptTime = 0L; //接收高德定位回调的时间
|
|
@@ -1394,6 +1402,7 @@ public class APIModuleGis extends UZModule {
|
|
//调用高德SDK开始定位函数
|
|
//调用高德SDK开始定位函数
|
|
if(mLocationClient != null)
|
|
if(mLocationClient != null)
|
|
startAMapGis(onceFlag);
|
|
startAMapGis(onceFlag);
|
|
|
|
+ mWaitAMapSingleBack.set(onceFlag==null?true:onceFlag);
|
|
}
|
|
}
|
|
long ff = System.currentTimeMillis();
|
|
long ff = System.currentTimeMillis();
|
|
//Log.i("结束参数设置时间:",""+System.currentTimeMillis());
|
|
//Log.i("结束参数设置时间:",""+System.currentTimeMillis());
|