fix bug of clear OnlineCarData
This commit is contained in:
@@ -13,6 +13,8 @@ import com.mogo.module.common.entity.MarkerCarPois;
|
||||
import com.mogo.module.common.entity.MarkerLocation;
|
||||
import com.mogo.module.common.entity.MarkerOnlineCar;
|
||||
import com.mogo.module.common.entity.MarkerShowEntity;
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
|
||||
import com.mogo.service.statusmanager.StatusDescriptor;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,7 +28,7 @@ public
|
||||
*
|
||||
* 描述
|
||||
*/
|
||||
class OnlineCarDrawer {
|
||||
class OnlineCarDrawer implements IMogoStatusChangedListener {
|
||||
|
||||
private static final String TAG = "OnlineCarDrawer";
|
||||
|
||||
@@ -36,6 +38,9 @@ class OnlineCarDrawer {
|
||||
private static volatile OnlineCarDrawer sInstance;
|
||||
|
||||
private OnlineCarDrawer() {
|
||||
MogoApisHandler.getInstance().getApis()
|
||||
.getStatusManagerApi()
|
||||
.registerStatusChangedListener( TAG, StatusDescriptor.VR_MODE, this );
|
||||
}
|
||||
|
||||
public static OnlineCarDrawer getInstance() {
|
||||
@@ -53,11 +58,6 @@ class OnlineCarDrawer {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void clearMarkers(){
|
||||
MogoApisHandler.getInstance().getApis().getMapServiceApi().getMarkerManager( AbsMogoApplication.getApp() ).removeMarkers( ModuleNames.CARD_TYPE_USER_DATA );
|
||||
}
|
||||
@@ -196,5 +196,8 @@ class OnlineCarDrawer {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStatusChanged(StatusDescriptor descriptor, boolean isTrue) {
|
||||
clearMarkers();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user