[6.0.0] log
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,26 +1,36 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.util.Pair;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.center.CenterLine;
|
||||
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
|
||||
import com.mogo.map.overlay.proxy.point.IMapPointOverlay;
|
||||
import com.mogo.map.overlay.wrapper.point.AMapPointWrapper;
|
||||
import com.mogo.map.road.RoadNameInfo;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.utils.ObjectUtils;
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
|
||||
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
|
||||
import com.zhidaoauto.map.sdk.open.marker.BatchMarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.Marker;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerHelper;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
|
||||
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions;
|
||||
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo.yycp.api.proto.SocketDownData;
|
||||
@@ -35,16 +45,25 @@ public class AMapWrapper implements IMogoMap {
|
||||
|
||||
private static final String TAG = "AMapWrapper";
|
||||
|
||||
private static MapAutoViewHelper sAMap;
|
||||
private final IMogoMapUIController mMapUIController;
|
||||
private MapAutoViewHelper mAMap;
|
||||
private final MapAutoView mMapView;
|
||||
private IMogoUiSettings mUiSettings;
|
||||
|
||||
public AMapWrapper(MapAutoViewHelper map, MapAutoView mapView, IMogoMapUIController controller) {
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
CallerLogger.i(TAG, "autoop--AMapWrapper: init" + this);
|
||||
this.mAMap = map;
|
||||
sAMap = map;
|
||||
this.mMapView = mapView;
|
||||
mMapUIController = controller;
|
||||
// 设置实现自定义 info window
|
||||
// MapAutoApi.INSTANCE.setInfoWindowAdapter(new AMapInfoWindowAdapter());
|
||||
AMapUIController.getInstance().initClient(mMapUIController);
|
||||
}
|
||||
|
||||
public static MapAutoViewHelper getAMap() {
|
||||
return sAMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -59,42 +78,42 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMogoMapUIController getUiController() {
|
||||
public IMogoMapUIController getUIController() {
|
||||
return mMapUIController;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMapPointOverlay addPoint(@NonNull com.mogo.map.overlay.point.Point.Options options) {
|
||||
public IMapPointOverlay addPoint(com.mogo.map.overlay.point.Point.Options options) {
|
||||
if (!checkAMap()) {
|
||||
return null;
|
||||
}
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo(options,mMapView);
|
||||
MarkerOptions markerOptions = ObjectUtils.fromMogo(options);
|
||||
if (markerOptions == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "marker参数为空");
|
||||
CallerLogger.e(TAG, "marker参数为空");
|
||||
return null;
|
||||
}
|
||||
Marker delegate = mAMap.addMarker(markerOptions);
|
||||
if (delegate == null) {
|
||||
return null;
|
||||
}
|
||||
return new AMapPointWrapper(options.getId(), delegate,mMapView);
|
||||
return new AMapPointWrapper(options.getId(), delegate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMapPolylineOverlay addLine(@NonNull com.mogo.map.overlay.line.Polyline.Options options) {
|
||||
public IMapPolylineOverlay addLine(com.mogo.map.overlay.line.Polyline.Options options) {
|
||||
if (!checkAMap()) {
|
||||
return null;
|
||||
}
|
||||
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options,mMapView);
|
||||
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options);
|
||||
if (polylineOptions == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "polyline参数为空");
|
||||
CallerLogger.e(TAG, "polyline参数为空");
|
||||
return null;
|
||||
}
|
||||
Polyline delegate = polylineOptions.getLineWidth() > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
|
||||
Polyline delegate = polylineOptions.lineWidth > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
|
||||
if (delegate == null) {
|
||||
return null;
|
||||
}
|
||||
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate,mMapView);
|
||||
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate);
|
||||
}
|
||||
|
||||
BatchMarkerOptions batchMarkerOptions = new BatchMarkerOptions();
|
||||
@@ -119,15 +138,13 @@ public class AMapWrapper implements IMogoMap {
|
||||
return;
|
||||
}
|
||||
long time = markerOptionsArrayList.get(0).getTime();
|
||||
batchMarkerOptions.setList(markerOptionsArrayList);
|
||||
batchMarkerOptions.setDelayStrategy(false);
|
||||
batchMarkerOptions.setRuleAngle(8.0f);
|
||||
batchMarkerOptions.setControlIcon(1);
|
||||
batchMarkerOptions.setSatelliteTime(time);
|
||||
batchMarkerOptions.setDeleteRule(0);
|
||||
if(mMapView.getMarkerController() != null){
|
||||
mMapView.getMarkerController().updateBatchMarkerPositon(batchMarkerOptions);
|
||||
}
|
||||
batchMarkerOptions.list = markerOptionsArrayList;
|
||||
batchMarkerOptions.delayStrategy = false;
|
||||
batchMarkerOptions.ruleAngle = 8.0f;
|
||||
batchMarkerOptions.controlIcon = 1;
|
||||
batchMarkerOptions.satelliteTime = time;
|
||||
batchMarkerOptions.deleteRule = 0;
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(batchMarkerOptions);
|
||||
}
|
||||
|
||||
BatchMarkerOptions aiBatchMarkerOptions = new BatchMarkerOptions();
|
||||
@@ -153,23 +170,19 @@ public class AMapWrapper implements IMogoMap {
|
||||
}
|
||||
long time = markerOptionsArrayList.get(0).getTime();
|
||||
// 最后一个参数,是否管理锚点的删除
|
||||
aiBatchMarkerOptions.setList(markerOptionsArrayList);
|
||||
aiBatchMarkerOptions.setDelayStrategy(false);
|
||||
aiBatchMarkerOptions.setRuleAngle(8.0f);
|
||||
aiBatchMarkerOptions.setControlIcon(1);
|
||||
aiBatchMarkerOptions.setSatelliteTime(time);
|
||||
aiBatchMarkerOptions.setDeleteRule(0);
|
||||
if(mMapView.getMarkerController() != null) {
|
||||
mMapView.getMarkerController().updateBatchMarkerPositon(aiBatchMarkerOptions);
|
||||
}
|
||||
aiBatchMarkerOptions.list = markerOptionsArrayList;
|
||||
aiBatchMarkerOptions.delayStrategy = false;
|
||||
aiBatchMarkerOptions.ruleAngle = 8.0f;
|
||||
aiBatchMarkerOptions.controlIcon = 1;
|
||||
aiBatchMarkerOptions.satelliteTime = time;
|
||||
aiBatchMarkerOptions.deleteRule = 0;
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(aiBatchMarkerOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addPreVehicleModel(int type, int modelRes) {
|
||||
try {
|
||||
if(mMapView.getMarkerController() != null){
|
||||
return mMapView.getMarkerController().addPreVehicleModel(type, modelRes);
|
||||
}
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -179,21 +192,120 @@ public class AMapWrapper implements IMogoMap {
|
||||
@Override
|
||||
public void removeMarker(String uuidString) {
|
||||
try {
|
||||
if(mMapView.getMarkerController() != null){
|
||||
mMapView.getMarkerController().removeMarker(uuidString);
|
||||
}
|
||||
MarkerHelper.INSTANCE.removeMarker(uuidString);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
if (checkAMap()) {
|
||||
mAMap.clearPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear(boolean isKeepMyLocationOverlay) {
|
||||
if (checkAMap()) {
|
||||
mAMap.clearPanel();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter(int x, int y) {
|
||||
if (checkAMap()) {
|
||||
LonLatPoint lonLatPoint = MapTools.INSTANCE.fromScreenLocation(new Point(x, y));
|
||||
mAMap.setCenter(lonLatPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if (checkAMap()) {
|
||||
return mAMap.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom(float zoom) {
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoom((int) zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom2(float zoom) {
|
||||
CallerLogger.d(TAG, "changeZoom %s", zoom);
|
||||
if (checkAMap()) {
|
||||
mAMap.setZoomVal(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if (checkAMap()) {
|
||||
try {
|
||||
return mAMap.getZoom();
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean checkAMap() {
|
||||
mAMap = mMapView.getMapAutoViewHelper();
|
||||
sAMap = mAMap;
|
||||
if (mAMap == null) {
|
||||
CallerLogger.INSTANCE.e(TAG, "自研map实例为空,请检查");
|
||||
CallerLogger.e(TAG, "自研map实例为空,请检查");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) {
|
||||
SinglePointRoadInfo singlePointRoadInfo = MapDataApi.INSTANCE.getSinglePointMatchRoad(lon, lat, angle, isGpsLocation, isRTK);
|
||||
|
||||
return singlePointRoadInfo != null ? singlePointRoadInfo.getLaneWidth() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance) {
|
||||
try {
|
||||
com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance);
|
||||
CenterLine ret = null;
|
||||
if (info != null) {
|
||||
ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle);
|
||||
}
|
||||
return ret;
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoadNameInfo getRoadName(double lon, double lat, float angle) {
|
||||
// com.zhidaoauto.map.sdk.open.road.RoadNameInfo info = MapDataApi.INSTANCE.getRoadName(lon, lat, angle);
|
||||
// RoadNameInfo ret = null;
|
||||
// if (info != null) {
|
||||
// ret = new RoadNameInfo(info.tile_id, info.road_id, info.road_name);
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
private List<Pair<Double, Double>> convert(List<LonLatPoint> points) {
|
||||
if (points == null || points.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<Pair<Double, Double>> ret = new ArrayList<>(points.size());
|
||||
for (LonLatPoint p : points) {
|
||||
ret.add(Pair.create(p.longitude, p.latitude));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,522 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.location.Location;
|
||||
import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.hdcache.IHdCacheListener;
|
||||
import com.mogo.map.uicontroller.AMapUIController;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
import com.mogo.map.uicontroller.MapControlResult;
|
||||
import com.mogo.map.uicontroller.VisualAngleMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2019-12-26
|
||||
* <p>
|
||||
* 地图控制
|
||||
*/
|
||||
public class MogoMapUIController implements IMogoMapUIController {
|
||||
|
||||
private static final String TAG = "MogoMapUIController";
|
||||
|
||||
private IMogoMapUIController mDelegate;
|
||||
|
||||
private static volatile MogoMapUIController sInstance;
|
||||
|
||||
private MogoMapUIController() {
|
||||
initDelegate();
|
||||
}
|
||||
|
||||
private void initDelegate() {
|
||||
if (mDelegate == null) {
|
||||
mDelegate = AMapUIController.getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
public static MogoMapUIController getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (MogoMapUIController.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new MogoMapUIController();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public static synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapControlResult changeZoom(float zoom) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.changeZoom(zoom);
|
||||
}
|
||||
return MapControlResult.ERROR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom2(float zoom) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeZoom2(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDebugMode(Boolean debugMode) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setDebugMode(debugMode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapVisualAngle(VisualAngleMode angelMode, MogoLatLng mogoLatLng) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
CallerLogger.d(TAG, "set VisualAngle: " + angelMode.name());
|
||||
mDelegate.changeMapVisualAngle(angelMode, mogoLatLng);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRoamTrajectory(String trajectory) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setRoamTrajectory(trajectory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRomaMode(int mode) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
CallerLogger.d(TAG, "set setRomaMode: " + mode);
|
||||
mDelegate.setRomaMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public VisualAngleMode getCurrentMapVisualAngle() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCurrentMapVisualAngle();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng, boolean animate) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.moveToCenter(latLng, animate);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDayMode() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.isDayMode();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation(boolean visible) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.showMyLocation(visible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showMyLocation(View view) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.showMyLocation(view);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getZoomLevel();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRoadWidth(double lon, double lat, float angle, boolean isGpsLocation, boolean isRTK) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getRoadWidth(lon, lat, angle, isGpsLocation, isRTK);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCameraNorthEastPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCameraSouthWestPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getWindowCenterLocation() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getWindowCenterLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setPointToCenter(mapCenterX, mapCenterY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen(MogoLatLng latLng) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationPointInScreen(latLng);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLocationMogoLatLngInScreen(point);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderFps(int fps) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setRenderFps(fps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showBounds(String tag, MogoLatLng carPosition, List<MogoLatLng> lonLats, Rect bound, boolean lockCarPosition) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.showBounds(tag, carPosition, lonLats, bound, lockCarPosition);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceRender() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.forceRender();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.calculateLineDistance(p1, p2);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarLocked() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.isCarLocked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarCursorOption(CarCursorOption option) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setCarCursorOption(option);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCarLightsType(int type, int time) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setCarLightsType(type, time);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapCameraPosition getMapCameraPosition() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getMapCameraPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeBearing(float bearing) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeBearing(bearing);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapViewAngle(int type) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeMapViewAngle(type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeCurrentIcon(int iconId) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.changeCurrentIcon(iconId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTileId(double lon, double lat) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getTileId(lon, lat);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLimitSpeed(double lon, double lat, float angle) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getLimitSpeed(lon, lat, angle);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CenterLine getCenterLineInfo(double lon, double lat, float angle) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCenterLineInfo(lon, lat, angle);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rtkEnable(boolean enable) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.rtkEnable(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
mDelegate = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stepInVrMode(boolean isDayMode) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.stepInVrMode(isDayMode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMarkerInfoResName(String speedVal) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getMarkerInfoResName(speedVal);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMarkerInfoResName(String speedVal, String val) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setMarkerInfoResName(speedVal, val);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(float angle) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setMapDAngle(angle);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAngle(double startLon, double startLat, double endLon, double endLat) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getAngle(startLon, startLat, endLon, endLat);
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getRoadAngle(Double lon, Double lat, float angle) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getRoadAngle(lon, lat, angle);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockMode(boolean isLock) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setLockMode(isLock);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setScrollGesturesEnable(boolean isEnable) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setScrollGesturesEnable(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAllGesturesEnabled(boolean isEnable) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setAllGesturesEnabled(isEnable);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtraGPSData(MogoLocation gnssInfo) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setExtraGPSData(gnssInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsDrawPointCloud(Boolean isDrawPointCloud) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setIsDrawPointCloud(isDrawPointCloud);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointCloudSize(Float pointCloudSize) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setPointCloudSize(pointCloudSize);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointCloudColor(String color) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setPointCloudColor(color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheHDDataByCity(IHdCacheListener listener) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.cacheHDDataByCity(listener);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cacheHDDataByCity(IHdCacheListener listener, MogoLocation location) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.cacheHDDataByCity(listener, location);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCityDataCached() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.isCityDataCached();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelDownloadCacheData() {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.cancelDownloadCacheData();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCityCode() {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCityCode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
if (mapView != null) {
|
||||
addView(mapView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
||||
} else {
|
||||
CallerLogger.INSTANCE.e(TAG, "create MapView instance failed.");
|
||||
CallerLogger.e(TAG, "create MapView instance failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,25 +82,25 @@ public class MogoMapView extends MogoBaseMapView implements ILifeCycle {
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
CallerLogger.INSTANCE.d(TAG, "onCreate");
|
||||
CallerLogger.d(TAG, "onCreate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
CallerLogger.INSTANCE.d(TAG, "onResume");
|
||||
CallerLogger.d(TAG, "onResume");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
CallerLogger.INSTANCE.d(TAG, "onPause");
|
||||
CallerLogger.d(TAG, "onPause");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
CallerLogger.INSTANCE.d(TAG, "onDestroy");
|
||||
CallerLogger.d(TAG, "onDestroy");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,13 +39,13 @@ public class PointInterpolatorUtil {
|
||||
MogoLatLng current = points.get(i);
|
||||
MogoLatLng next = points.get(i + 1);
|
||||
float distance = CoordinateUtils.calculateLineDistance(current.lon, current.lat, next.lon, next.lat);
|
||||
CallerLogger.INSTANCE.d(TAG, i + ": " + distance);
|
||||
CallerLogger.d(TAG, i + ": " + distance);
|
||||
if (distance > DISTANCE_THRESHOLD) {
|
||||
int inter = (int) (distance / DISTANCE_THRESHOLD) + 1;
|
||||
for (int j = 1; j < inter; j++) {
|
||||
double newLat = current.lat + (next.lat - current.lat) * j / inter;
|
||||
double newLon = current.lon + (next.lon - current.lon) * j / inter;
|
||||
CallerLogger.INSTANCE.d(TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon);
|
||||
CallerLogger.d(TAG, "distance: " + distance + ", j: " + j + ", nextLat: " + next.lat + ", nextLon: " + next.lon + ", newLat: " + newLat + ", newLon: " + newLon);
|
||||
points.add(i + 1, new MogoLatLng(newLat, newLon));
|
||||
current = points.get(++i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user