内存泄漏问题优化
This commit is contained in:
@@ -41,6 +41,7 @@ import com.zhidaoauto.map.sdk.open.camera.CameraUpdateFactory;
|
||||
import com.zhidaoauto.map.sdk.open.camera.LatLngBounds;
|
||||
import com.zhidaoauto.map.sdk.open.location.LocationListener;
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
|
||||
import com.zhidaoauto.map.sdk.open.location.RTKAutopilotLocationBean;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener;
|
||||
@@ -51,6 +52,7 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -912,4 +914,35 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
Logger.e( TAG, e, "rtkEnable" );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map( JSONObject data ) {
|
||||
if ( !checkAMapView() ) {
|
||||
return;
|
||||
}
|
||||
if ( data == null ) {
|
||||
Logger.d( TAG, "停止使用rtk定位数据" );
|
||||
mMapView.getLocationClient().stopAutoPilotRTK();
|
||||
return;
|
||||
}
|
||||
double lon = data.optDouble( "lon", -1 );
|
||||
double lat = data.optDouble( "lat", -1 );
|
||||
double alt = data.optDouble( "alt", -1 );
|
||||
double heading = data.optDouble( "heading", -1 );
|
||||
double acceleration = data.optDouble( "acceleration", -1 );
|
||||
double yawRate = data.optDouble( "yawRate", -1 );
|
||||
if ( lon == -1 ) {
|
||||
return;
|
||||
}
|
||||
RTKAutopilotLocationBean bean = new RTKAutopilotLocationBean();
|
||||
bean.setYaw_rate( yawRate );
|
||||
bean.setHeading( heading );
|
||||
bean.setHeading( heading );
|
||||
bean.setAcceleration( acceleration );
|
||||
bean.setAlt( alt );
|
||||
bean.setLon( lon );
|
||||
bean.setLat( lat );
|
||||
mMapView.getLocationClient().updateRTKAutoPilotLocation( bean );
|
||||
Logger.d( TAG, "使用rtk定位数据" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -296,4 +298,11 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.rtkEnable( enable );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncLocation2Map( JSONObject data ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.syncLocation2Map( data );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user