[Change]
增加接口
/**
* 获取车道中心线信息
*/
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine?
Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -65,7 +65,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
override fun run() {
|
||||
if (mLatLng != null) {
|
||||
mSpeedLimmit = MogoMapUIController.getInstance()
|
||||
.getSpeedLimmit(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
|
||||
.getLimitSpeed(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
|
||||
UiThreadHandler.post {
|
||||
val speed = (mLatLng!!.speed * 3.6f).toInt()
|
||||
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimmit) "#DB3137" else "#3E77F6"))
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.function.api.map.IMogoMapFrameController;
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider;
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase;
|
||||
@@ -18,8 +19,6 @@ import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
|
||||
/**
|
||||
* @author donghongyu
|
||||
@@ -29,7 +28,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
* 地图图层,地图操作都在这个图层完成
|
||||
*/
|
||||
@Route(path = MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
||||
public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
public class MapFragment extends MvpFragment<MapView, MapPresenter>
|
||||
implements MapView, IMogoMapFrameController, IMoGoMapFragmentProvider {
|
||||
|
||||
private static final String TAG = "MapFragment";
|
||||
@@ -55,7 +54,7 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initDelegate( IMogoMapFrameController controller ) {
|
||||
public void initDelegate(IMogoMapFrameController controller) {
|
||||
// do not implement
|
||||
}
|
||||
|
||||
@@ -67,55 +66,55 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
@Override
|
||||
public void changeToVRMode() {
|
||||
try {
|
||||
mMogoMapView.getMap().getUIController().changeMapMode( EnumMapUI.Type_VR);
|
||||
} catch ( Exception e ) {
|
||||
mMogoMapView.getMap().getUIController().changeMapMode(EnumMapUI.Type_VR);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init( Context context ) {
|
||||
public void init(Context context) {
|
||||
// do not implement
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews( Bundle savedInstanceState ) {
|
||||
super.initViews( savedInstanceState );
|
||||
mMogoMapView = findViewById( R.id.module_map_id_map );
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mMogoMapView = findViewById(R.id.module_map_id_map);
|
||||
mMogoMapView.onCreate(savedInstanceState);
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
if ( mMogoMap != null ) {
|
||||
mMogoMap.getUIController().showMyLocation( true );
|
||||
if (mMogoMap != null) {
|
||||
mMogoMap.getUIController().showMyLocation(true);
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected MapPresenter createPresenter() {
|
||||
return new MapPresenter( this );
|
||||
return new MapPresenter(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
initMapView();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState( @NonNull Bundle outState ) {
|
||||
super.onSaveInstanceState( outState );
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onSaveInstanceState( outState );
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onSaveInstanceState(outState);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if ( mIsControllerByOthersStatus ) {
|
||||
if (mIsControllerByOthersStatus) {
|
||||
return;
|
||||
}
|
||||
if ( mMogoMapView != null ) {
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onPause();
|
||||
}
|
||||
}
|
||||
@@ -123,10 +122,10 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if ( mIsControllerByOthersStatus ) {
|
||||
if (mIsControllerByOthersStatus) {
|
||||
return;
|
||||
}
|
||||
if ( mMogoMapView != null ) {
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onResume();
|
||||
}
|
||||
}
|
||||
@@ -134,38 +133,38 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
super.onLowMemory();
|
||||
if ( mMogoMapView != null ) {
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onLowMemory();
|
||||
}
|
||||
}
|
||||
|
||||
private void initMapView() {
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
if ( mMogoMap == null ) {
|
||||
if (mMogoMap == null) {
|
||||
return;
|
||||
}
|
||||
IMogoUiSettings uiSettings = mMogoMap.getUiSettings();
|
||||
if ( uiSettings != null ) {
|
||||
if (uiSettings != null) {
|
||||
//设置所有手势是否可用
|
||||
uiSettings.setAllGesturesEnabled( true );
|
||||
uiSettings.setAllGesturesEnabled(true);
|
||||
//设置指南针是否可见。
|
||||
uiSettings.setCompassEnabled( false );
|
||||
uiSettings.setCompassEnabled(false);
|
||||
//设置室内地图楼层切换控件是否可见。
|
||||
uiSettings.setIndoorSwitchEnabled( true );
|
||||
uiSettings.setIndoorSwitchEnabled(true);
|
||||
//设置定位按钮是否可见。
|
||||
uiSettings.setMyLocationButtonEnabled( false );
|
||||
uiSettings.setMyLocationButtonEnabled(false);
|
||||
//设置旋转手势是否可用。
|
||||
uiSettings.setRotateGesturesEnabled( false );
|
||||
uiSettings.setRotateGesturesEnabled(false);
|
||||
//设置比例尺控件是否可见
|
||||
uiSettings.setScaleControlsEnabled( true );
|
||||
uiSettings.setScaleControlsEnabled(true);
|
||||
//设置拖拽手势是否可用。
|
||||
uiSettings.setScrollGesturesEnabled( true );
|
||||
uiSettings.setScrollGesturesEnabled(true);
|
||||
//设置倾斜手势是否可用。
|
||||
uiSettings.setTiltGesturesEnabled( true );
|
||||
uiSettings.setTiltGesturesEnabled(true);
|
||||
//设置缩放按钮是否可见。
|
||||
uiSettings.setZoomControlsEnabled( false );
|
||||
uiSettings.setZoomControlsEnabled(false);
|
||||
//设置双指缩放手势是否可用。
|
||||
uiSettings.setZoomGesturesEnabled( true );
|
||||
uiSettings.setZoomGesturesEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if ( mMogoMapView != null ) {
|
||||
if (mMogoMapView != null) {
|
||||
mMogoMapView.onDestroy();
|
||||
mMogoMapView = null;
|
||||
mMogoMap = null;
|
||||
@@ -208,6 +207,7 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
|
||||
/**
|
||||
* sight mode
|
||||
*
|
||||
* @param mode
|
||||
*/
|
||||
public static final int SIGHT_MODE_NORMAL = 0;
|
||||
@@ -218,13 +218,13 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
|
||||
@Override
|
||||
public void setMapDAngle(int mode) {
|
||||
float angle = getSightModeAngle(mode);
|
||||
float angle = getSightModeAngle(mode);
|
||||
mMogoMapView.getMap().getUIController().setMapDAngle(angle);
|
||||
}
|
||||
|
||||
private float getSightModeAngle(int mode) {
|
||||
float angle = 0.0f;
|
||||
switch (mode){
|
||||
switch (mode) {
|
||||
case SIGHT_MODE_NORMAL:
|
||||
angle = 16.5f;
|
||||
case SIGHT_MODE_TOP:
|
||||
@@ -239,4 +239,9 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter >
|
||||
return angle;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CenterLine getCenterLineInfo(double lon, double lat, float angle) {
|
||||
return mMogoMapView.getMap().getUIController().getCenterLineInfo(lon, lat, angle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,10 @@ import com.mogo.module.common.MogoApisHandler;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 限速
|
||||
* @author mogoauto
|
||||
*/
|
||||
public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
|
||||
|
||||
private static SpeedLimitDataManager instance ;
|
||||
@@ -35,7 +39,7 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
|
||||
public void run() {
|
||||
if (mLocation != null){
|
||||
if (MogoMapUIController.getInstance() != null) {
|
||||
int speedLimmit = MogoMapUIController.getInstance().getSpeedLimmit(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
|
||||
int speedLimmit = MogoMapUIController.getInstance().getLimitSpeed(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.mogo.eagle.core.data.map
|
||||
|
||||
|
||||
/**
|
||||
* 道路中心经纬度集合
|
||||
*/
|
||||
class CenterLine {
|
||||
var id = "" //id
|
||||
var tile_id = "" //瓦片id
|
||||
var road_id = ""//道路id
|
||||
var lane_id = ""//车道id
|
||||
var points: ArrayList<LonLatPoint>? = null//道路经纬度
|
||||
var angle: Double? = 0.0//车道线id
|
||||
override fun toString(): String {
|
||||
return "CenterLine(id='$id', tile_id='$tile_id', road_id='$road_id', lane_id='$lane_id', points=$points, angle=$angle)"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.mogo.eagle.core.data.map;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class LonLatPoint implements Serializable {
|
||||
|
||||
private double longitude;
|
||||
private double latitude;
|
||||
private double altitude;
|
||||
private int duration;
|
||||
private double angle = 0;
|
||||
private String provider;
|
||||
private double distance;
|
||||
private double speed;
|
||||
|
||||
public LonLatPoint() {
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude, double angle) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public LonLatPoint(double longitude, double latitude, double altitude, double angle) {
|
||||
this.longitude = longitude;
|
||||
this.latitude = latitude;
|
||||
this.altitude = altitude;
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public String getProvider() {
|
||||
return provider;
|
||||
}
|
||||
|
||||
public void setProvider(String provider) {
|
||||
this.provider = provider;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getAltitude() {
|
||||
return altitude;
|
||||
}
|
||||
|
||||
public void setAltitude(double altitude) {
|
||||
this.altitude = altitude;
|
||||
}
|
||||
|
||||
public double getAngle() {
|
||||
return angle;
|
||||
}
|
||||
|
||||
public void setAngle(double angle) {
|
||||
this.angle = angle;
|
||||
}
|
||||
|
||||
public double getDistance() {
|
||||
return distance;
|
||||
}
|
||||
|
||||
public void setDistance(double distance) {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public double getSpeed() {
|
||||
return speed;
|
||||
}
|
||||
|
||||
public void setSpeed(double speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LonLatPoint{" +
|
||||
"longitude=" + longitude +
|
||||
", latitude=" + latitude +
|
||||
", altitude=" + altitude +
|
||||
", angle=" + angle +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.api.map.hd
|
||||
|
||||
import androidx.annotation.RawRes
|
||||
import com.mogo.eagle.core.data.map.CenterLine
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
/**
|
||||
@@ -28,4 +29,9 @@ interface IMoGoMapFragmentProvider : IMoGoFunctionServerProvider {
|
||||
* 设置地图视线角度
|
||||
*/
|
||||
fun setMapDAngle(mode: Int)
|
||||
|
||||
/**
|
||||
* 获取车道中心线信息
|
||||
*/
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine?
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.call.map
|
||||
import androidx.annotation.RawRes
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
|
||||
import com.mogo.eagle.core.data.map.CenterLine
|
||||
import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
@@ -14,7 +15,7 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
object CallerHDMapManager : CallerBase() {
|
||||
private val mapProviderApi: IMoGoMapFragmentProvider
|
||||
get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_MAP)
|
||||
.navigation() as IMoGoMapFragmentProvider;
|
||||
.navigation() as IMoGoMapFragmentProvider;
|
||||
|
||||
/**
|
||||
* 修改地图中心点
|
||||
@@ -32,11 +33,21 @@ object CallerHDMapManager : CallerBase() {
|
||||
* 修改高精地图自车图标
|
||||
* 传入资源ID
|
||||
*/
|
||||
fun changeCurrentIcon(@RawRes iconId: Int){
|
||||
fun changeCurrentIcon(@RawRes iconId: Int) {
|
||||
mapProviderApi.changeCurrentIcon(iconId)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置地图视线角度
|
||||
*/
|
||||
fun setMapDAngle(mode: Int) {
|
||||
mapProviderApi.setMapDAngle(mode)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车道中心线信息
|
||||
*/
|
||||
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float): CenterLine? {
|
||||
return mapProviderApi.getCenterLineInfo(lon, lat, angle)
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import android.view.View;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RawRes;
|
||||
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -108,12 +109,6 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
void loseLockMode();
|
||||
|
||||
/**
|
||||
* 设置锁车缩放级别
|
||||
*
|
||||
* @param var1 级别 3-20
|
||||
*/
|
||||
void setLockZoom(int var1);
|
||||
|
||||
/**
|
||||
* 预览全程
|
||||
@@ -200,13 +195,6 @@ public interface IMogoMapUIController {
|
||||
*/
|
||||
float calculateLineDistance(MogoLatLng p1, MogoLatLng p2) throws Exception;
|
||||
|
||||
/**
|
||||
* 当前的视图模式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
EnumMapUI getCurrentUiMode();
|
||||
|
||||
/**
|
||||
* 锁车状态
|
||||
*
|
||||
@@ -275,8 +263,17 @@ public interface IMogoMapUIController {
|
||||
* @param angle
|
||||
* @return
|
||||
*/
|
||||
int getSpeedLimmit(double lon, double lat, float angle);
|
||||
int getLimitSpeed(double lon, double lat, float angle);
|
||||
|
||||
/**
|
||||
* 获取车道中心线信息
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @param angle
|
||||
* @return
|
||||
*/
|
||||
CenterLine getCenterLineInfo(double lon, double lat, float angle);
|
||||
|
||||
/**
|
||||
* 自研地图是否匹配道路
|
||||
|
||||
@@ -46,6 +46,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
// 高精地图
|
||||
implementation rootProject.ext.dependencies.mogocustommap
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogo_core_utils
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_300;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_CROSS;
|
||||
import static com.mogo.map.uicontroller.VisualAngleMode.MAP_STYLE_VR_ANGLE_TOP;
|
||||
@@ -22,6 +21,7 @@ import android.view.View;
|
||||
import com.mogo.commons.constants.SharedPrefsConstants;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.CenterLine;
|
||||
import com.mogo.eagle.core.data.map.MapRoadInfo;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
@@ -94,7 +94,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
OnMapTouchListener,
|
||||
OnMarkClickListener,
|
||||
OnMapStyleListener,
|
||||
MapStyleController.IMapStyleAutoChangedListener,
|
||||
OnMapViewVisualAngleChangeListener,
|
||||
OnRoadInfoListener {
|
||||
|
||||
@@ -108,14 +107,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
.naviCursorRes(R.drawable.ic_amap_navi_cursor)
|
||||
.build();
|
||||
private CarCursorOption mCarCursorOption = DEFAULT_OPTION;
|
||||
private EnumMapUI mCurrentCarUIMode;
|
||||
private EnumMapUI mCurrentUI;
|
||||
private VisualAngleMode mVisualAngleMode = MODE_MEDIUM_SIGHT;
|
||||
|
||||
private int mLockZoom = 16;
|
||||
private long startTime;
|
||||
private float mDefaultZoomLevel = 16.0f;
|
||||
private boolean mIsCarLocked = false;
|
||||
private boolean mIsLightStyle = false;
|
||||
private boolean mMapLoaded = false;
|
||||
private boolean mIsFirstLocated = true;
|
||||
@@ -125,7 +120,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private volatile String mRoadId = null;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
startTime = System.currentTimeMillis();
|
||||
CallerLogger.INSTANCE.i(TAG, "autoop--AMapViewWrapper: init");
|
||||
this.mMapView = mMapView;
|
||||
initViews();
|
||||
@@ -151,7 +145,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
//修改自车模型,未来需区分车的类型
|
||||
options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true));
|
||||
// MapAutoApi.INSTANCE.getMyLocationStyle().myLocationIcon(HdMapBuildConfig.currentCarVrIconRes, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +172,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (roadId != null && !TextUtils.isEmpty(roadId)) {
|
||||
CallerLogger.INSTANCE.d(TAG, "onRoadIdInfo::" + roadId);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnRoadIdGet(roadId);
|
||||
} else {
|
||||
} else {
|
||||
CallerLogger.INSTANCE.d(TAG, "onRoadIdInfo::null");
|
||||
}
|
||||
}
|
||||
@@ -213,10 +206,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
LonLatPoint p2 = points.get(points.size() - 1);
|
||||
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.longitude, p1.latitude, p2.longitude, p2.latitude) * 10_0000;
|
||||
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo: --- distance: "+ distanceOfCarToStopLine);
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
|
||||
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if (carLoc != null) {
|
||||
CallerLogger.INSTANCE.d(TAG, "onStopLineInfo::null, car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
|
||||
}
|
||||
@@ -373,32 +366,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper().setScaleVRMode(true);
|
||||
mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
|
||||
// TODO 这里临时修改关闭2D
|
||||
// switch (ui) {
|
||||
// case CarUp_2D:
|
||||
// case CarUp_3D:
|
||||
// case NorthUP_2D:
|
||||
// setUIMode(ui);
|
||||
// break;
|
||||
// case Type_VR:
|
||||
// mMapView.getMapAutoViewHelper().setScaleVRMode(true);
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_VR);
|
||||
// return;
|
||||
// case Type_Light:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_DAY);
|
||||
// mIsLightStyle = true;
|
||||
// break;
|
||||
// case Type_Night:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(false);
|
||||
// mMapView.getMapAutoViewHelper().setMapStyle(MapAutoApi.MAP_STYLE_NIGHT);
|
||||
// mIsLightStyle = false;
|
||||
// break;
|
||||
// case Type_AUTO_LIGHT_Night:
|
||||
// mMapView.getMapAutoViewHelper().setAutoSwitchStyle(true);
|
||||
// break;
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +471,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "锁车");
|
||||
mMapView.getMapAutoViewHelper().setLockMode(true);
|
||||
mIsCarLocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -515,12 +481,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "解锁锁车");
|
||||
mMapView.getMapAutoViewHelper().setLockMode(false);
|
||||
mIsCarLocked = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockZoom(int var1) {
|
||||
mLockZoom = var1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -653,12 +613,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
return MogoMapUtils.calculateLineDistance(ObjectUtils.fromMogo(p1), ObjectUtils.fromMogo(p2));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
return mCurrentCarUIMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMyLocation(Location location) {
|
||||
}
|
||||
@@ -739,10 +693,15 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpeedLimmit(double lon, double lat, float angle) {
|
||||
public int getLimitSpeed(double lon, double lat, float angle) {
|
||||
return MapDataApi.INSTANCE.getLimitSpeed(lon, lat, angle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CenterLine getCenterLineInfo(double lon, double lat, float angle) {
|
||||
return ObjectUtils.transformCenterLine(MapDataApi.INSTANCE.getCenterLineInfo(lon, lat, angle));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
|
||||
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
|
||||
@@ -786,7 +745,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mIsFirstLocated = true;
|
||||
mIsDelayed = false;
|
||||
CallerLogger.INSTANCE.d(TAG, "同步定位:" + GsonUtils.toJson(location));
|
||||
MapStyleController.getInstance().onLocationChanged(location, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -940,26 +898,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_CAR);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStyleAutoChanged(boolean isVrMode) {
|
||||
if (isVrMode) {
|
||||
if (mCurrentUI != EnumMapUI.Type_VR) {
|
||||
CallerLogger.INSTANCE.d(TAG, "自动切换为vr模式");
|
||||
changeMapMode(EnumMapUI.Type_VR);
|
||||
}
|
||||
} else {
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
CallerLogger.INSTANCE.d(TAG, "自动切换为2D模式");
|
||||
if (mIsLightStyle) {
|
||||
changeMapMode(EnumMapUI.Type_Light);
|
||||
} else {
|
||||
changeMapMode(EnumMapUI.Type_Night);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean mRtkEnable = false;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-10
|
||||
* <p>
|
||||
* 拦截器
|
||||
*/
|
||||
public interface Interrupter {
|
||||
|
||||
/**
|
||||
* 是否拦截
|
||||
* @return true - 拦截, false - 不拦截
|
||||
*/
|
||||
boolean interrupt();
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-10
|
||||
* <p>
|
||||
* 地图视图中心点
|
||||
*/
|
||||
public class MapCenterPoint {
|
||||
|
||||
public final double x;
|
||||
public final double y;
|
||||
|
||||
public MapCenterPoint( double x, double y ) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.zhidaoauto.map.sdk.open.location.MogoLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/12/25
|
||||
*
|
||||
* 地图样式控制
|
||||
*/
|
||||
class MapStyleController {
|
||||
|
||||
|
||||
private static volatile MapStyleController sInstance;
|
||||
|
||||
private boolean mIsInVrMode = false;
|
||||
|
||||
private List< VrAreaFilter > mVrAreaFilters = new ArrayList<>();
|
||||
|
||||
private MapStyleController() {
|
||||
mVrAreaFilters.add( new ShunYiArea() );
|
||||
mVrAreaFilters.add( new OCHArea() );
|
||||
// mVrAreaFilters.add( new HuiXinXiJieArea() );
|
||||
}
|
||||
|
||||
public static MapStyleController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapStyleController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapStyleController();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private Object readResolve() {
|
||||
// 阻止反序列化,必须实现 Serializable 接口
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void onLocationChanged( MogoLocation location, IMapStyleAutoChangedListener listener ) {
|
||||
if ( location == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 网约车不自动切换vr、2d模式
|
||||
if ( DebugConfig.isOCHModule() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isInVrMode = false;
|
||||
for ( VrAreaFilter vrAreaFilter : mVrAreaFilters ) {
|
||||
if ( vrAreaFilter == null ) {
|
||||
continue;
|
||||
}
|
||||
isInVrMode |= vrAreaFilter.isVrArea( location );
|
||||
if ( isInVrMode ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( isInVrMode ) {
|
||||
if ( !mIsInVrMode ) {
|
||||
// 第一次进入 vr 区域,自动变为 vr 模式
|
||||
mIsInVrMode = true;
|
||||
if ( listener != null ) {
|
||||
listener.onStyleAutoChanged( true );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ( mIsInVrMode ) {
|
||||
// 驶出 vr 区域,自动变为 2d 模式
|
||||
mIsInVrMode = false;
|
||||
if ( listener != null ) {
|
||||
listener.onStyleAutoChanged( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface IMapStyleAutoChangedListener {
|
||||
void onStyleAutoChanged(boolean isVrMode);
|
||||
}
|
||||
|
||||
public interface VrAreaFilter {
|
||||
default boolean isVrArea(MogoLocation location) {
|
||||
if ( location == null ) {
|
||||
return false;
|
||||
}
|
||||
return location.getLat() > getLeftBottomLat() && location.getLon() > getLeftBottomLon()
|
||||
&& location.getLat() < getRightTopLat() && location.getLon() < getRightTopLon();
|
||||
}
|
||||
|
||||
double getLeftBottomLat();
|
||||
|
||||
double getLeftBottomLon();
|
||||
|
||||
double getRightTopLat();
|
||||
|
||||
double getRightTopLon();
|
||||
}
|
||||
|
||||
public static class ShunYiArea implements VrAreaFilter {
|
||||
|
||||
// 顺义一期高精地图范围(目前圈定了一个矩形区域,认为都是高精地图区域)
|
||||
private final double leftBottomLat = 40.18728;
|
||||
private final double leftBottomLon = 116.71194;
|
||||
private final double rightTopLat = 40.20671;
|
||||
private final double rightTopLon = 116.74804;
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLat() {
|
||||
return leftBottomLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return leftBottomLon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return rightTopLat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return rightTopLon;
|
||||
}
|
||||
}
|
||||
|
||||
public static class OCHArea implements VrAreaFilter {
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLat() {
|
||||
return 39.97645;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return 116.41673;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static class HuiXinXiJieArea implements VrAreaFilter {
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLat() {
|
||||
return 39.96741320378243;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getLeftBottomLon() {
|
||||
return 116.41045709250723;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLat() {
|
||||
return 39.98232698552779;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getRightTopLon() {
|
||||
return 116.41879656379113;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ 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.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.uicontroller.CarCursorOption;
|
||||
@@ -158,13 +159,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockZoom(int var1) {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
mDelegate.setLockZoom(var1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
@@ -288,14 +282,6 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
initDelegate();
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getCurrentUiMode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMyLocation(Location location) {
|
||||
@@ -364,13 +350,21 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpeedLimmit(double lon, double lat, float angle) {
|
||||
public int getLimitSpeed(double lon, double lat, float angle) {
|
||||
if (mDelegate != null) {
|
||||
return mDelegate.getSpeedLimmit(lon, lat, angle);
|
||||
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();
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.mogo.map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-04-10
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public interface Scene {
|
||||
|
||||
/**
|
||||
* 普通场景
|
||||
*/
|
||||
int COMMON = 0;
|
||||
|
||||
/**
|
||||
* 选点
|
||||
*/
|
||||
int CHOOSE_POINT = 1;
|
||||
|
||||
/**
|
||||
* 导航
|
||||
*/
|
||||
int NAVI = 2;
|
||||
|
||||
/**
|
||||
* 导航 vs 道路事件
|
||||
*/
|
||||
int NAVI_WITH_ROAD_EVENT = 21;
|
||||
|
||||
/**
|
||||
* 巡航
|
||||
*/
|
||||
int AIMLESS = 3;
|
||||
|
||||
/**
|
||||
* 巡航 vs 道路事件
|
||||
*/
|
||||
int AIMLESS_WITH_ROAD_EVENT = 31;
|
||||
|
||||
/**
|
||||
* 路线规划
|
||||
*/
|
||||
int CALCULATE_PATH = 4;
|
||||
|
||||
/**
|
||||
* 分类搜索
|
||||
*/
|
||||
int CATEGORY_SEARCH = 5;
|
||||
|
||||
/**
|
||||
* V2X触发了预警场景
|
||||
*/
|
||||
int CATEGORY_V2X_EVENT = 6;
|
||||
}
|
||||
@@ -18,7 +18,8 @@ import org.jetbrains.annotations.Nullable;
|
||||
*/
|
||||
public final class AMapInfoWindowAdapter implements InfoWindowAdapter, OnInfoWindowClickListener {
|
||||
|
||||
public View getInfoWindow( Marker marker ) {
|
||||
@Override
|
||||
public View getInfoWindow(Marker marker ) {
|
||||
if ( marker.getMObject() instanceof IMogoMarker ) {
|
||||
IMogoMarker mogoMarker = ( ( IMogoMarker ) marker.getMObject() );
|
||||
IMogoInfoWindowAdapter delegate = mogoMarker.getInfoWindowAdapter();
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.zhidaoauto.map.sdk.open.MapAutoApi;
|
||||
|
||||
@@ -130,13 +131,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLockZoom(int var1) {
|
||||
if (mClient != null) {
|
||||
mClient.setLockZoom(var1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview(Rect bounds) {
|
||||
if (mClient != null) {
|
||||
@@ -245,14 +239,6 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumMapUI getCurrentUiMode() {
|
||||
if (mClient != null) {
|
||||
return mClient.getCurrentUiMode();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMyLocation(Location location) {
|
||||
if (mClient != null) {
|
||||
@@ -310,8 +296,13 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSpeedLimmit(double lon, double lat, float angle) {
|
||||
return mClient.getSpeedLimmit(lon, lat, angle);
|
||||
public int getLimitSpeed(double lon, double lat, float angle) {
|
||||
return mClient.getLimitSpeed(lon, lat, angle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CenterLine getCenterLineInfo(double lon, double lat, float angle) {
|
||||
return mClient.getCenterLineInfo(lon, lat, angle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,9 +5,9 @@ import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
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.data.traffic.TrafficData;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.overlay.MogoPolylineOptions;
|
||||
import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
@@ -193,20 +193,6 @@ public class ObjectUtils {
|
||||
return new LonLatPoint(latLng.lon, latLng.lat);
|
||||
}
|
||||
|
||||
// public static NaviLatLng fromMogoAsNavi( MogoLatLng latLng ) {
|
||||
// if ( latLng == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// return new NaviLatLng( latLng.lat, latLng.lng );
|
||||
// }
|
||||
|
||||
// public static LatLng fromMogo2( MogoLatLng latLng ) {
|
||||
// if ( latLng == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// return new LatLng( latLng.lat, latLng.lng );
|
||||
// }
|
||||
|
||||
public static MogoLatLng fromAMap(LonLatPoint point) {
|
||||
if (point == null) {
|
||||
return null;
|
||||
@@ -214,13 +200,6 @@ public class ObjectUtils {
|
||||
return new MogoLatLng(point.getLatitude(), point.getLongitude());
|
||||
}
|
||||
|
||||
// public static MogoLatLng CameraPositionfromAMap( LatLng point ) {
|
||||
// if ( point == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// return new MogoLatLng( point.latitude, point.longitude );
|
||||
// }
|
||||
|
||||
public static GeocodeQuery fromMogo(MogoGeocodeQuery query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
@@ -237,44 +216,6 @@ public class ObjectUtils {
|
||||
return q;
|
||||
}
|
||||
|
||||
// public static MogoAoiItem fromAMap( AoiItem amapItem ) {
|
||||
// if ( amapItem == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoAoiItem mogoAoiItem = new MogoAoiItem();
|
||||
// mogoAoiItem.setAdCode( amapItem.getAdCode() );
|
||||
// mogoAoiItem.setAoiArea( amapItem.getAoiArea() );
|
||||
// mogoAoiItem.setAoiCenterPoint( fromAMap( amapItem.getAoiCenterPoint() ) );
|
||||
// mogoAoiItem.setAoiId( amapItem.getAoiId() );
|
||||
// mogoAoiItem.setAoiName( amapItem.getAoiName() );
|
||||
// return mogoAoiItem;
|
||||
// }
|
||||
//
|
||||
// public static MogoBusinessArea fromAMap( BusinessArea amapItem ) {
|
||||
// if ( amapItem == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoBusinessArea mogoBusinessArea = new MogoBusinessArea();
|
||||
// mogoBusinessArea.setCenterPoint( fromAMap( amapItem.getCenterPoint() ) );
|
||||
// mogoBusinessArea.setName( amapItem.getName() );
|
||||
// return mogoBusinessArea;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public static MogoCrossroad fromAMap( Crossroad amapItem ) {
|
||||
// if ( amapItem == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoCrossroad mogoCrossroad = new MogoCrossroad();
|
||||
// mogoCrossroad.setDirection( amapItem.getDirection() );
|
||||
// mogoCrossroad.setDistance( amapItem.getDistance() );
|
||||
// mogoCrossroad.setFirstRoadId( amapItem.getFirstRoadId() );
|
||||
// mogoCrossroad.setFirstRoadName( amapItem.getFirstRoadName() );
|
||||
// mogoCrossroad.setSecondRoadId( amapItem.getSecondRoadId() );
|
||||
// mogoCrossroad.setSecondRoadName( amapItem.getSecondRoadName() );
|
||||
// return mogoCrossroad;
|
||||
// }
|
||||
|
||||
public static MogoGeocodeAddress fromAMap(GeocodeAddress address) {
|
||||
if (address == null) {
|
||||
return null;
|
||||
@@ -311,77 +252,6 @@ public class ObjectUtils {
|
||||
return mogoGeocodeResult;
|
||||
}
|
||||
|
||||
// public static MogoIndoorData fromAMap( IndoorData data ) {
|
||||
// if ( data == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoIndoorData mogoIndoorData = new MogoIndoorData();
|
||||
// mogoIndoorData.setFloor( data.getFloor() );
|
||||
// mogoIndoorData.setFloorName( data.getFloorName() );
|
||||
// mogoIndoorData.setPoiId( data.getPoiId() );
|
||||
// return mogoIndoorData;
|
||||
// }
|
||||
//
|
||||
// public static MogoPhoto fromAMap( Photo photo ) {
|
||||
// if ( photo == null ) {f
|
||||
// return null;
|
||||
// }
|
||||
// MogoPhoto mogoPhoto = new MogoPhoto();
|
||||
// mogoPhoto.setTitle( photo.getTitle() );
|
||||
// mogoPhoto.setUrl( photo.getUrl() );
|
||||
// return mogoPhoto;
|
||||
// }
|
||||
//
|
||||
// public static MogoPoiItemExtension fromAMap( PoiItemExtension poiItemExtension ) {
|
||||
// if ( poiItemExtension == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoPoiItemExtension mogoPoiItemExtension = new MogoPoiItemExtension();
|
||||
// mogoPoiItemExtension.setOpentime( poiItemExtension.getOpentime() );
|
||||
// mogoPoiItemExtension.setRating( poiItemExtension.getmRating() );
|
||||
// return mogoPoiItemExtension;
|
||||
// }
|
||||
//
|
||||
// public static MogoRegeocodeRoad fromAMap( RegeocodeRoad regeocodeRoad ) {
|
||||
// if ( regeocodeRoad == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoRegeocodeRoad mogoRegeocodeRoad = new MogoRegeocodeRoad();
|
||||
// mogoRegeocodeRoad.setDirection( regeocodeRoad.getDirection() );
|
||||
// mogoRegeocodeRoad.setDistance( regeocodeRoad.getDistance() );
|
||||
// mogoRegeocodeRoad.setId( regeocodeRoad.getId() );
|
||||
// mogoRegeocodeRoad.setName( regeocodeRoad.getName() );
|
||||
// mogoRegeocodeRoad.setPoint( fromAMap( regeocodeRoad.getLatLngPoint() ) );
|
||||
// return mogoRegeocodeRoad;
|
||||
// }
|
||||
//
|
||||
// public static MogoStreetNumber fromAMap( StreetNumber streetNumber ) {
|
||||
// if ( streetNumber == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoStreetNumber mogoStreetNumber = new MogoStreetNumber();
|
||||
// mogoStreetNumber.setDirection( streetNumber.getDirection() );
|
||||
// mogoStreetNumber.setDistance( streetNumber.getDistance() );
|
||||
// mogoStreetNumber.setLatLonPoint( fromAMap( streetNumber.getLatLonPoint() ) );
|
||||
// mogoStreetNumber.setNumber( streetNumber.getNumber() );
|
||||
// mogoStreetNumber.setStreet( streetNumber.getStreet() );
|
||||
// return mogoStreetNumber;
|
||||
// }
|
||||
|
||||
// public static MogoSubPoiItem fromAMap( SubPoiItem subPoiItem ) {
|
||||
// if ( subPoiItem == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoSubPoiItem mogoSubPoiItem = new MogoSubPoiItem();
|
||||
// mogoSubPoiItem.setDistance( subPoiItem.getDistance() );
|
||||
// mogoSubPoiItem.setPoiId( subPoiItem.getPoiId() );
|
||||
// mogoSubPoiItem.setPoint( fromAMap( subPoiItem.getLatLonPoint() ) );
|
||||
// mogoSubPoiItem.setSnippet( subPoiItem.getSnippet() );
|
||||
// mogoSubPoiItem.setSubName( mogoSubPoiItem.getSubName() );
|
||||
// mogoSubPoiItem.setSubTypeDes( mogoSubPoiItem.getSubTypeDes() );
|
||||
// mogoSubPoiItem.setTitle( mogoSubPoiItem.getTitle() );
|
||||
// return mogoSubPoiItem;
|
||||
// }
|
||||
|
||||
public static MogoPoiItem fromAMap(PoiItem poiItem) {
|
||||
if (poiItem == null) {
|
||||
@@ -398,20 +268,7 @@ public class ObjectUtils {
|
||||
mogoPoiItem.setEmail(poiItem.getEmail());
|
||||
mogoPoiItem.setEnter(fromAMap(poiItem.getEnter()));
|
||||
mogoPoiItem.setExit(fromAMap(poiItem.getExit()));
|
||||
// mogoPoiItem.setIndoorData( fromAMap( poiItem.getIndoorData() ) );
|
||||
mogoPoiItem.setParkingType(poiItem.getParkingType());
|
||||
// mogoPoiItem.setIndoorMap( poiItem.isIndoorMap() );
|
||||
// if ( poiItem.getPhotos() != null ) {
|
||||
// List< MogoPhoto > mogoPhotos = new ArrayList<>();
|
||||
// for ( Photo photo : poiItem.getPhotos() ) {
|
||||
// MogoPhoto mogoPhoto = fromAMap( photo );
|
||||
// if ( mogoPhoto != null ) {
|
||||
// mogoPhotos.add( mogoPhoto );
|
||||
// }
|
||||
// }
|
||||
// mogoPoiItem.setPhotos( mogoPhotos );
|
||||
// }
|
||||
// mogoPoiItem.setPoiExtension( fromAMap( poiItem.getPoiExtension() ) );
|
||||
mogoPoiItem.setPoiId(poiItem.getPoiId());
|
||||
mogoPoiItem.setPoint(fromAMap(poiItem.getLonLatPoint()));
|
||||
mogoPoiItem.setPostcode(poiItem.getPostcode());
|
||||
@@ -419,16 +276,6 @@ public class ObjectUtils {
|
||||
mogoPoiItem.setProvinceName(poiItem.getProvinceName());
|
||||
mogoPoiItem.setShopID(poiItem.getShopID());
|
||||
mogoPoiItem.setSnippet(poiItem.getSnippet());
|
||||
// if ( poiItem.getSubPois() != null ) {
|
||||
// List< MogoSubPoiItem > mogoSubPoiItems = new ArrayList<>();
|
||||
// for ( SubPoiItem subPois : poiItem.getSubPois() ) {
|
||||
// MogoSubPoiItem mogoSubPoiItem = fromAMap( subPois );
|
||||
// if ( mogoPoiItem != null ) {
|
||||
// mogoSubPoiItems.add( mogoSubPoiItem );
|
||||
// }
|
||||
// }
|
||||
// mogoPoiItem.setSubPois( mogoSubPoiItems );
|
||||
// }
|
||||
mogoPoiItem.setTel(poiItem.getTel());
|
||||
mogoPoiItem.setTypeCode(poiItem.getTypeCode());
|
||||
mogoPoiItem.setTitle(poiItem.getTitle());
|
||||
@@ -443,43 +290,12 @@ public class ObjectUtils {
|
||||
}
|
||||
MogoRegeocodeAddress mogoRegeocodeAddress = new MogoRegeocodeAddress();
|
||||
mogoRegeocodeAddress.setAdCode(regeocodeAddress.getAdCode());
|
||||
// if ( regeocodeAddress.getAois() != null ) {
|
||||
// List< MogoAoiItem > items = new ArrayList<>();
|
||||
// for ( AoiItem aois : regeocodeAddress.getAois() ) {
|
||||
// final MogoAoiItem mogoAoiItem = fromAMap( aois );
|
||||
// if ( mogoAoiItem != null ) {
|
||||
// items.add( mogoAoiItem );
|
||||
// }
|
||||
// }
|
||||
// mogoRegeocodeAddress.setAois( items );
|
||||
// }
|
||||
|
||||
mogoRegeocodeAddress.setBuilding(regeocodeAddress.getBuilding());
|
||||
// if ( regeocodeAddress.getBusinessAreas() != null ) {
|
||||
// List< MogoBusinessArea > mogoBusinessAreas = new ArrayList<>();
|
||||
// for ( BusinessArea businessArea : regeocodeAddress.getBusinessAreas() ) {
|
||||
// MogoBusinessArea mogoBusinessArea = fromAMap( businessArea );
|
||||
// if ( mogoBusinessArea != null ) {
|
||||
// mogoBusinessAreas.add( mogoBusinessArea );
|
||||
// }
|
||||
// }
|
||||
// mogoRegeocodeAddress.setBusinessAreas( mogoBusinessAreas );
|
||||
// }
|
||||
|
||||
mogoRegeocodeAddress.setCity(regeocodeAddress.getCity());
|
||||
mogoRegeocodeAddress.setCityCode(regeocodeAddress.getCityCode());
|
||||
mogoRegeocodeAddress.setCountry(regeocodeAddress.getCountry());
|
||||
// if ( regeocodeAddress.getCrossroads() != null ) {
|
||||
// List< MogoCrossroad > mogoCrossroads = new ArrayList<>();
|
||||
// for ( Crossroad crossroad : regeocodeAddress.getCrossroads() ) {
|
||||
//
|
||||
// MogoCrossroad mogoCrossroad = fromAMap( crossroad );
|
||||
// if ( mogoCrossroad != null ) {
|
||||
// mogoCrossroads.add( mogoCrossroad );
|
||||
// }
|
||||
// }
|
||||
// mogoRegeocodeAddress.setCrossroads( mogoCrossroads );
|
||||
// }
|
||||
mogoRegeocodeAddress.setDistrict(regeocodeAddress.getDistrict());
|
||||
mogoRegeocodeAddress.setFormatAddress(regeocodeAddress.getFormatAddress());
|
||||
mogoRegeocodeAddress.setNeighborhood(regeocodeAddress.getNeighborhood());
|
||||
@@ -493,17 +309,6 @@ public class ObjectUtils {
|
||||
mogoRegeocodeAddress.setPois(mogoPoiItems);
|
||||
}
|
||||
mogoRegeocodeAddress.setProvince(regeocodeAddress.getProvince());
|
||||
// if ( regeocodeAddress.getRoads() != null ) {
|
||||
// List< MogoRegeocodeRoad > mogoRegeocodeRoads = new ArrayList<>();
|
||||
// for ( RegeocodeRoad road : regeocodeAddress.getRoads() ) {
|
||||
// MogoRegeocodeRoad mogoRegeocodeRoad = fromAMap( road );
|
||||
// if ( mogoRegeocodeRoad != null ) {
|
||||
// mogoRegeocodeRoads.add( mogoRegeocodeRoad );
|
||||
// }
|
||||
// }
|
||||
// mogoRegeocodeAddress.setRoads( mogoRegeocodeRoads );
|
||||
// }
|
||||
// mogoRegeocodeAddress.setStreetNumber( fromAMap( regeocodeAddress.getStreetNumber() ) );
|
||||
mogoRegeocodeAddress.setTowncode(regeocodeAddress.getTowncode());
|
||||
mogoRegeocodeAddress.setTownship(regeocodeAddress.getTownship());
|
||||
return mogoRegeocodeAddress;
|
||||
@@ -544,23 +349,12 @@ public class ObjectUtils {
|
||||
return mogoTip;
|
||||
}
|
||||
|
||||
// public static MogoPoi fromAMap( Poi poi ) {
|
||||
// if ( poi == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// MogoPoi mogoPoi = new MogoPoi();
|
||||
// mogoPoi.setCoordinate( fromAMap( poi.getCoordinate() ) );
|
||||
// mogoPoi.setName( poi.getName() );
|
||||
// mogoPoi.setPoiId( poi.getPoiId() );
|
||||
// return mogoPoi;
|
||||
// }
|
||||
|
||||
public static MogoPoiSearchQuery fromAMap(Query query) {
|
||||
if (query == null) {
|
||||
return null;
|
||||
}
|
||||
MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery(query.getKeyword(), query.getCategory(), query.getCity());
|
||||
// mogoPoiSearchQuery.setBuilding( query.getBuilding() );
|
||||
mogoPoiSearchQuery.setCityLimit(query.getCityLimit());
|
||||
mogoPoiSearchQuery.setDistanceSort(query.getDistanceSort());
|
||||
mogoPoiSearchQuery.setLocation(fromAMap(query.getLocation()));
|
||||
@@ -575,9 +369,9 @@ public class ObjectUtils {
|
||||
}
|
||||
Query psq = new Query(query.getQuery(), "", "");
|
||||
String category = getCategory(query.getQuery());
|
||||
if (!category.equals(""))
|
||||
if (!category.equals("")) {
|
||||
psq = new Query("", "", getCategory(query.getQuery()));
|
||||
// psq.setBuilding( query.getBuilding() );
|
||||
}
|
||||
psq.setCityLimit(query.isCityLimit());
|
||||
psq.setDistanceSort(query.isDistanceSort());
|
||||
psq.setLocation(fromMogo(query.getLocation()));
|
||||
@@ -673,11 +467,6 @@ public class ObjectUtils {
|
||||
if (options.getColorValues() != null) {
|
||||
target.colorValues(options.getColorValues());
|
||||
}
|
||||
// target.transparency( options.getTransparency() );
|
||||
// target.aboveMaskLayer( options.isAboveMaskLayer() );
|
||||
// target.lineCapType( PolylineOptions.LineCapType.LineCapRound );
|
||||
// target.lineJoinType( PolylineOptions.LineJoinType.LineJoinRound );
|
||||
// target.setDottedLineType( PolylineOptions.DOTTEDLINE_TYPE_CIRCLE );
|
||||
return target;
|
||||
}
|
||||
|
||||
@@ -704,4 +493,35 @@ public class ObjectUtils {
|
||||
}
|
||||
return category;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换对象
|
||||
*
|
||||
* @return 转换后的对象
|
||||
*/
|
||||
public static CenterLine transformCenterLine(com.zhidaoauto.map.sdk.open.road.CenterLine centerLine) {
|
||||
CenterLine resultCenterLine = null;
|
||||
if (centerLine != null) {
|
||||
resultCenterLine.setId(centerLine.id);
|
||||
resultCenterLine.setLane_id(centerLine.lane_id);
|
||||
resultCenterLine.setAngle(centerLine.angle);
|
||||
resultCenterLine.setRoad_id(centerLine.road_id);
|
||||
resultCenterLine.setTile_id(centerLine.tile_id);
|
||||
ArrayList<com.mogo.eagle.core.data.map.LonLatPoint> arrayList = new ArrayList<>();
|
||||
for (com.zhidaoauto.map.sdk.open.query.LonLatPoint point : centerLine.points) {
|
||||
com.mogo.eagle.core.data.map.LonLatPoint lonLatPoint = new com.mogo.eagle.core.data.map.LonLatPoint();
|
||||
lonLatPoint.setAltitude(point.altitude);
|
||||
lonLatPoint.setAngle(point.angle);
|
||||
lonLatPoint.setDistance(point.distance);
|
||||
lonLatPoint.setLatitude(point.latitude);
|
||||
lonLatPoint.setLongitude(point.longitude);
|
||||
lonLatPoint.setProvider(point.provider);
|
||||
lonLatPoint.setSpeed(point.speed);
|
||||
lonLatPoint.setDuration(point.duration);
|
||||
arrayList.add(lonLatPoint);
|
||||
}
|
||||
resultCenterLine.setPoints(arrayList);
|
||||
}
|
||||
return resultCenterLine;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user