[2.13.2] add interface of wgs84 to gaode
This commit is contained in:
@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.map.entity.MarkerLocation
|
||||
import com.mogo.eagle.core.data.map.entity.MarkerUserInfo
|
||||
import com.mogo.eagle.core.data.map.entity.V2XRoadEventEntity
|
||||
import com.mogo.eagle.core.function.v2x.events.scenario.scene.airoad.AiRoadMarker
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.v2x.data.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import roadwork.Road
|
||||
@@ -83,12 +84,9 @@ fun Road.RW_PB.toRoadMarker(): V2XMarkerCardResult =
|
||||
l3.poiType = this.roadwork?.poiType?.toString()
|
||||
l3.generateTime = this.roadwork?.detectTime ?: 0L
|
||||
l3.location = V2XMarkerLocation().also { l4 ->
|
||||
val p = CoordinateUtils.transformWgsToGcj(
|
||||
this.roadwork?.center?.point?.lat ?: 0.0,
|
||||
this.roadwork?.center?.point?.lon ?: 0.0
|
||||
)
|
||||
l4.lon = p[0]
|
||||
l4.lat = p[1]
|
||||
val p = MogoMap.getInstance().mogoMap.switchLonLat(this.roadwork?.center?.point?.lon ?: 0.0,this.roadwork?.center?.point?.lat ?: 0.0)
|
||||
l4.lon = p.lon
|
||||
l4.lat = p.lat
|
||||
l4.angle = this.roadwork?.center?.road?.bearing?.toDouble() ?: 0.0
|
||||
}
|
||||
})
|
||||
@@ -119,9 +117,9 @@ fun MessagePad.TrackedObject.toRoadMarker(poiType: String): V2XMarkerCardResult
|
||||
l3.poiType = poiType
|
||||
l3.generateTime = 0L
|
||||
l3.location = V2XMarkerLocation().also { l4 ->
|
||||
val p = CoordinateUtils.transformWgsToGcj(this.latitude, this.longitude)
|
||||
l4.lon = p[0]
|
||||
l4.lat = p[1]
|
||||
val p = MogoMap.getInstance().mogoMap.switchLonLat(this.longitude,this.latitude)
|
||||
l4.lon = p.lon
|
||||
l4.lat = p.lat
|
||||
l4.angle = this.heading
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.map;
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.map.center.CenterLine;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
@@ -42,7 +43,7 @@ public interface IMogoMap {
|
||||
* @param options
|
||||
* @return
|
||||
*/
|
||||
IMogoMarker addMarker( String tag, MogoMarkerOptions options );
|
||||
IMogoMarker addMarker(String tag, MogoMarkerOptions options);
|
||||
|
||||
|
||||
/**
|
||||
@@ -50,7 +51,7 @@ public interface IMogoMap {
|
||||
*
|
||||
* @param optionsArrayList 锚点集合
|
||||
*/
|
||||
void updateBatchMarkerPosition(HashMap<String,MessagePad.TrackedObject> optionsArrayList);
|
||||
void updateBatchMarkerPosition(HashMap<String, MessagePad.TrackedObject> optionsArrayList);
|
||||
|
||||
/**
|
||||
* 添加感知使用到的3d模型
|
||||
@@ -75,7 +76,7 @@ public interface IMogoMap {
|
||||
* @param moveToCenter
|
||||
* @return
|
||||
*/
|
||||
ArrayList< IMogoMarker > addMarkers( String tag, ArrayList< MogoMarkerOptions > options, boolean moveToCenter );
|
||||
ArrayList<IMogoMarker> addMarkers(String tag, ArrayList<MogoMarkerOptions> options, boolean moveToCenter);
|
||||
|
||||
/**
|
||||
* 从地图上删除所有的overlay(marker,circle,polyline 等对象)。
|
||||
@@ -87,7 +88,7 @@ public interface IMogoMap {
|
||||
*
|
||||
* @param isKeepMyLocationOverlay
|
||||
*/
|
||||
void clear( boolean isKeepMyLocationOverlay );
|
||||
void clear(boolean isKeepMyLocationOverlay);
|
||||
|
||||
/**
|
||||
* 设置屏幕上的某个像素点为地图中心点。
|
||||
@@ -95,42 +96,42 @@ public interface IMogoMap {
|
||||
* @param x
|
||||
* @param y
|
||||
*/
|
||||
void setPointToCenter( int x, int y );
|
||||
void setPointToCenter(int x, int y);
|
||||
|
||||
/**
|
||||
* 设置地图POI是否允许点击。
|
||||
*
|
||||
* @param touchPoiEnable
|
||||
*/
|
||||
void setTouchPoiEnable( boolean touchPoiEnable );
|
||||
void setTouchPoiEnable(boolean touchPoiEnable);
|
||||
|
||||
/**
|
||||
* 设置是否打开交通路况图层。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void setTrafficEnable( boolean enable );
|
||||
void setTrafficEnable(boolean enable);
|
||||
|
||||
/**
|
||||
* 设置是否显示3D建筑物,默认显示。
|
||||
*
|
||||
* @param enabled
|
||||
*/
|
||||
void showBuildings( boolean enabled );
|
||||
void showBuildings(boolean enabled);
|
||||
|
||||
/**
|
||||
* 设置是否显示室内地图,默认不显示。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void showIndoorMap( boolean enable );
|
||||
void showIndoorMap(boolean enable);
|
||||
|
||||
/**
|
||||
* 设置是否显示底图文字标注,默认显示。
|
||||
*
|
||||
* @param enable
|
||||
*/
|
||||
void showMapText( boolean enable );
|
||||
void showMapText(boolean enable);
|
||||
|
||||
/**
|
||||
* 停止当前执行的改变地图状态的动画。
|
||||
@@ -149,7 +150,7 @@ public interface IMogoMap {
|
||||
*
|
||||
* @param zoom
|
||||
*/
|
||||
void changeZoom( float zoom );
|
||||
void changeZoom(float zoom);
|
||||
|
||||
/**
|
||||
* 获取缩放比例
|
||||
@@ -169,13 +170,14 @@ public interface IMogoMap {
|
||||
* @param options
|
||||
* @return
|
||||
*/
|
||||
IMogoPolyline addPolyline( MogoPolylineOptions options );
|
||||
IMogoPolyline addPolyline(MogoPolylineOptions options);
|
||||
|
||||
/**
|
||||
* 获取行驶方向一定长度的中心线
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @param distance 获取车道中心线的长度,> 0: 行驶方向前方距离, <0 行驶方向后方距离
|
||||
* @return 中心线相关数据
|
||||
*/
|
||||
@@ -184,10 +186,20 @@ public interface IMogoMap {
|
||||
|
||||
/**
|
||||
* 根据自车经纬度和航向角,获取道路名称
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param angle 航向角
|
||||
* @return 道路名称等相关信息
|
||||
*/
|
||||
RoadNameInfo getRoadName(double lon, double lat, float angle);
|
||||
|
||||
/**
|
||||
* 经纬度转换 wgs84 -> 高德
|
||||
*
|
||||
* @param lon
|
||||
* @param lat
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng switchLonLat(double lon, double lat);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.graphics.Point;
|
||||
import android.util.Pair;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.center.CenterLine;
|
||||
import com.mogo.map.marker.AMapInfoWindowAdapter;
|
||||
@@ -339,6 +340,12 @@ public class AMapWrapper implements IMogoMap {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng switchLonLat(double lon, double lat) {
|
||||
LonLatPoint lonLatPoint = MapTools.INSTANCE.switchLonLat(new LonLatPoint(lon,lat));
|
||||
return new MogoLatLng(lonLatPoint.latitude,lonLatPoint.longitude);
|
||||
}
|
||||
|
||||
private List<Pair<Double, Double>> convert(List<LonLatPoint> points) {
|
||||
if (points == null || points.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
|
||||
Reference in New Issue
Block a user