|
@@ -1327,6 +1327,12 @@ public class APIModuleGis extends UZModule {
|
|
|
//TODO 启动服务相关判断
|
|
|
res.put("code",code);
|
|
|
res.put("msg",msg);
|
|
|
+ if(mLocationClient != null) {
|
|
|
+ mLocationClient.stopLocation();
|
|
|
+ mLocationClient.onDestroy();
|
|
|
+ mInitedAMapSdk.set(false);
|
|
|
+ mStartedAMapLocation.set(false);
|
|
|
+ }
|
|
|
//初始化定位
|
|
|
mLocationClient = new AMapLocationClient(moduleContext.getContext());
|
|
|
//设置定位回调监听
|
|
@@ -1372,7 +1378,10 @@ public class APIModuleGis extends UZModule {
|
|
|
JSONObject res = new JSONObject();
|
|
|
String code = "1";
|
|
|
String msg = "error";
|
|
|
- boolean onceFlag = moduleContext.optBoolean("onceFlag");
|
|
|
+ Boolean onceFlag = moduleContext.optBoolean("onceFlag");
|
|
|
+ if(onceFlag==null){
|
|
|
+ onceFlag = false;
|
|
|
+ }
|
|
|
try{
|
|
|
//TODO 启动服务相关判断
|
|
|
long callTm = System.currentTimeMillis();
|