[map-sdk]地图版本3.3.0.10

This commit is contained in:
wangyanjun
2023-11-28 20:26:32 +08:00
parent 2f73803631
commit 1f6f44e5b6
189 changed files with 970 additions and 342 deletions

View File

@@ -45,6 +45,7 @@ class MapBox {
dis: Float,
isCancel: Boolean = false
)
external fun llaGetRoutePath(trajectorys : DoubleArray,isCancel: Boolean = false)
external fun updateCacheFile(isCancel: Boolean = false)
external fun modifyRedisFileVersion(version: Int, isCancel: Boolean = false)

View File

@@ -2,6 +2,7 @@ package com.autonavi.nge.map
import android.content.res.AssetManager
import android.util.Log
import com.zhidaoauto.map.sdk.open.MapAutoApi
class MapEngine {
@@ -1014,6 +1015,17 @@ class MapEngine {
setTextureJni(mObj,name,ba)
}
}
fun setStyleName(name:String){
if (mObj != 0L) {
setPainterCmdJni(mObj,"style",name)
}
}
fun onChangeStyle(styleMode:Int){
if(styleMode== MapAutoApi.MAP_STYLE_NIGHT_VR)
setStyleName("night")
else if(styleMode== MapAutoApi.MAP_STYLE_DAY_VR)
setStyleName("day")
}
private external fun loadJni(projectDir: String, mapView: MapView?,assetManager: AssetManager?): Long
private external fun resizeJni(obj:Long,newWidth: Int, newHeight: Int)

View File

@@ -149,7 +149,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mHandler = object : Handler(mapViewThread.looper) {
override fun handleMessage(msg: Message) {
when (msg.what) {
ZOOM_CHANGE -> mMapController?.dispatchZoomChanged()
ZOOM_CHANGE -> mMapController?.dispatchZoomChanged(msg.obj as Float)
// ROTATE_CHANGE ->mMapController?.dispatchRotationAngleChanged((msg.obj as Float))
// DAngle_CHANGE -> mMapController?.dispatchDAngleChanged()
// FOCUS_CHANGE -> mMapController?.dispatchFocusChanged()
@@ -183,41 +183,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
}
}
// private val Hndler: Handler = object : Handler(Looper.getMainLooper()) {
// override fun handleMessage(msg: Message) {
// when (msg.what) {
// ZOOM_CHANGE -> mMapController?.dispatchZoomChanged()
// ROTATE_CHANGE ->mMapController?.dispatchRotationAngleChanged((msg.obj as Float))
// DAngle_CHANGE -> mMapController?.dispatchDAngleChanged()
// FOCUS_CHANGE -> mMapController?.dispatchFocusChanged()
// RENDER_CHANGE -> {
// mEventController?.dispatchRenderListener(msg.arg1)
// }
// RENDER_COMPLETE -> {
// if (DEBUG) {
// Log.i(TAG, "mapop--load render complete-start")
// }
//// CommonEventController.instance?.dispatchCameraChangeFinishListener(CommonController.instance.mapAutoView?.getMapAutoViewHelper()?.getCameraPosition() ?: null)
// if (DEBUG) {
// Log.i(TAG, "mapop--load render complete-end")
// }
// }
// LOAD_COMPLETE -> {
// if (DEBUG) {
// Log.i(TAG, "mapop--load complete-start")
// }
// mEventController?.dispatchMapLoadedListener()
// }
//
// INIT_COMPLETE -> {
// if (DEBUG) {
// Log.i(TAG, "mapop--init complete-start")
// }
// mEventController?.dispatchMapLoadedInitListener()
// }
// }
// }
// }
override fun getMapEngine(): MapEngine {
return mMapEngine
@@ -747,6 +714,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// setStyleDir("sdcard/shmdata/style")
val styleMode = mMapStyleParams.getStyleMode()
val dir = Constant.nDSDataPath
if(!loadP(dir)){
return
}
@@ -1115,13 +1083,13 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private var isScroll = true
//可以斜滑
private var isFling = true
private var isFling = false
//可以旋转
private var isRotate = true
private var isRotate = false
//可以缩放
private var isCanZoom = true
private var isCanZoom = false
private var isVr = true
@@ -1189,11 +1157,14 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// mHandler.sendEmptyMessage(FOCUS_CHANGE)
}
fun onMapZoomChanging() {
fun onMapZoomChanging(zoomIndex: Float) {
if (DEBUG) {
Log.i(TAG, "mapop--onMapZoomChanging")
Log.i(TAG, "mapop--onMapZoomChanging--:${zoomIndex}")
}
mHandler.sendEmptyMessage(ZOOM_CHANGE)
val msg = Message.obtain()
msg.what = ZOOM_CHANGE
msg.obj = zoomIndex
mHandler.sendMessage(msg)
}
fun onMapRAngleChanging(angle:Float) {
@@ -1206,11 +1177,14 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// mHandler.sendMessage(msg)
}
fun onMapDAngleChanging() {
fun onMapDAngleChanging(angle:Float) {
// if (DEBUG) {
// Log.i(TAG, "mapop--onMapDAngleChanging")
// Log.i(TAG, "mapop--onMapDAngleChanging:${angle}")
// }
// mHandler.sendEmptyMessage(DAngle_CHANGE)
// val msg = Message.obtain()
// msg.what = DAngle_CHANGE
// msg.obj = angle
// mHandler.sendMessage(msg)
}
override fun loadP(

View File

@@ -30,7 +30,7 @@ interface IEventController {
fun exit()
fun addCameraChangeListener(cameraChangeListener: OnCameraChangeListener)
fun removeCameraChangeListener(cameraChangeListener: OnCameraChangeListener)
fun dispatchCameraChangeListener(type: Int, value: Int)
fun dispatchCameraChangeListener(type: Int, value: Float)
fun dispatchCameraChangeFinishListener(position: CameraPosition?)
fun addMapTouchListener(mapTouchListener: OnMapTouchListener)
fun removeMapTouchListener(mapTouchListener: OnMapTouchListener)
@@ -67,7 +67,7 @@ interface IEventController {
fun isMarkClickListenerListEmpty():Boolean
fun addMapStatusListener(mapStatusListener: MapStatusListener, type: Int)
fun removeMapStatusListener(mapStatusListener: MapStatusListener, type: Int)
fun dispatchMapStatusListener(type:Int, value: Int)
fun dispatchMapStatusListener(type:Int, value: Float)
fun addRenderListener(renderListener : OnRenderListener)
fun removeRenderListener(renderListener : OnRenderListener)
fun dispatchRenderListener(duration:Int)
@@ -89,4 +89,8 @@ interface IEventController {
fun addRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener)
fun removeRoadSideFenceRegionListener(onRoadSideFenceRegionListener: OnRoadSideFenceRegionListener)
fun dispatchRoadSideFenceRegionListener(status: Int)
fun getRoadInfoListenerList(): ArrayList<OnRoadInfoListener>?
fun getRoadSideFenceRegionListener(): ArrayList<OnRoadSideFenceRegionListener>?
}

View File

@@ -54,9 +54,9 @@ interface IMapController {
fun setCenter(lon: Double, lat: Double)
fun animateTo(lon: Double, lat: Double, alt: Float, rotateAngle: Float, mDuration: Int)
fun dispatchFocusChanged()
fun dispatchZoomChanged()
fun dispatchZoomChanged(zoomIndex: Float)
fun dispatchRotationAngleChanged(rotateAngle: Float)
fun dispatchDAngleChanged()
fun dispatchDAngleChanged(dAngle: Float)
fun getMapScreenShot(var1: OnMapScreenShotListener)
//NaviController相关

View File

@@ -29,6 +29,9 @@ object ConstantExt {
//天空盒模式
const val MAP_STYLE_VR_SKY_BOX = 10
//高程数据模式
const val MAP_STYLE_VR_BRIDGE= 100
//漫游距离1公里
const val ROAM_DIS_1KM = 1000f
//漫游距离3公里
@@ -54,11 +57,11 @@ object ConstantExt {
const val MAP_STYLE_VR_ZOOM: Int = 20
//VR模式下的远视角 角度
const val MAP_STYLE_VR_OVER_LOOK_ANGLE_FAR = 11.5f
const val MAP_STYLE_VR_OVER_LOOK_ANGLE_FAR = 13.5f
//VR模式下的远视角 缩放值
const val MAP_STYLE_VR_ZOOM_VAL_FAR = 1f
//VR模式下的远视角 高度
const val MAP_STYLE_VR_EYE_HEIGHT_FAR = 40f
const val MAP_STYLE_VR_EYE_HEIGHT_FAR = 30f
//VR模式下的近视角 角度
@@ -132,7 +135,7 @@ object ConstantExt {
const val MAP_STYLE_VR_EYE_HEIGHT_TRANS = 30f
//天空盒模式
const val MAP_STYLE_VR_OVER_LOOK_ANGLE_SKYBOX = 28f//视角
const val MAP_STYLE_VR_OVER_LOOK_ANGLE_SKYBOX = 13f//视角
const val MAP_STYLE_VR_ZOOM_VAL_SKYBOX = 0.8f//缩放
const val MAP_STYLE_VR_EYE_HEIGHT_SKYBOX = 12f//高度
@@ -155,6 +158,12 @@ object ConstantExt {
//VR模式下的中视角视域
const val MAP_STYLE_VR_VIEW_FIELD_ANGLE_MIDDLE = 20f
//VR模式下的高程数据视角
const val MAP_STYLE_VR_POSITION_BRIDGE = 2.6f
const val MAP_STYLE_VR_OVER_LOOK_ANGLE_BRIDGE = 12.3f
const val MAP_STYLE_VR_ZOOM_VAL_BRIDGE = 0.8f
const val MAP_STYLE_VR_EYE_HEIGHT_BRIDGE = 20f
//设置天气
const val WEATHER = "wheatherType"
@@ -173,6 +182,7 @@ object ConstantExt {
const val PLANE = "planeUseTex"
const val BLUR = "blur"
const val STREET_LIGHT = "isStreetLightEffectEnable"
const val BRIDGE = "show_bridge"
//地图视角测试
//地图测试视角角度

View File

@@ -104,7 +104,7 @@ class MapEventController(): IEventController {
mCameraChangeListenerList?.remove(cameraChangeListener)
}
override fun dispatchCameraChangeListener(type: Int, value: Int){
override fun dispatchCameraChangeListener(type: Int, value: Float){
mCameraChangeListenerList?.let {
for(listener in it){
listener.onCameraChange(type, value)
@@ -404,7 +404,7 @@ class MapEventController(): IEventController {
}
override fun dispatchMapStatusListener(type:Int, value: Int){
override fun dispatchMapStatusListener(type:Int, value: Float){
when(type){
MapAutoApi.LISTENER_TYPE_FOCUS->{
mFocusListenerList?.let {
@@ -566,4 +566,12 @@ class MapEventController(): IEventController {
}
}
}
override fun getRoadInfoListenerList(): ArrayList<OnRoadInfoListener>? {
return mRoadInfoListenerList
}
override fun getRoadSideFenceRegionListener(): ArrayList<OnRoadSideFenceRegionListener>? {
return mRoamRegionListenerList
}
}

View File

@@ -50,7 +50,7 @@ class LocationHelper(
)
} else {
it.setAnimMarkerRes(
R.raw.guangquan_day,
R.raw.guangquan,
MyLocationStyle.ANIM_WAIT_FRAME_DAY,
MyLocationStyle.ANIM_PERIOD_DAY
)

View File

@@ -83,6 +83,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
private var roadLineTimeJob: Job? = null
private var roamJob: Job? = null
private var transJob: Job? = null
private var skyJob: Job? = null
private var zoomJob: Job? = null
private var styleJob: Job? = null
private var destLonLatPoint: LonLatPoint? = null
@@ -262,7 +263,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
}
override fun lookUpDown() {
dispatchDAngleChanged()
dispatchDAngleChanged(getDAngle())
}
override fun zoomIn() {
@@ -681,8 +682,11 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
// lis.onMapStatusChangeListener(LISTENER_TYPE_ROTATE, rotateAngle.toInt())
// }
// }
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_ROTATE, rotateAngle.toInt())
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_ROTATE, rotateAngle.toInt())
if (DEBUG) {
Log.d(TAG, "styleop-dispatchRotationAngleChanged: $rotateAngle")
}
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_ROTATE, rotateAngle)
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_ROTATE, rotateAngle)
}
//焦点变化时的事件
@@ -693,24 +697,27 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
// lis.onMapStatusChangeListener(LISTENER_TYPE_FOCUS, 0)
// }
// }
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_FOCUS, 0)
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_FOCUS, 0)
if (DEBUG) {
Log.d(TAG, "styleop-dispatchFocusChanged")
}
mEventController?.dispatchMapStatusListener(LISTENER_TYPE_FOCUS, 0f)
mEventController?.dispatchCameraChangeListener(LISTENER_TYPE_FOCUS, 0f)
}
override fun dispatchZoomChanged() {
override fun dispatchZoomChanged(zoomIndex: Float) {
if(!isSurfaceCreated()) {
return
}
setMarkerScale()
val currentZoom = getZoom()
val currentZoom = zoomIndex
if (DEBUG) {
Log.d(TAG, "styleop--dispatchZoomChanged: currentZoom:${currentZoom},lastZoom:${lastZoom} ${mMapView.isTouching()}")
}
if (currentZoom == lastZoom) {
if (currentZoom.toInt() == lastZoom) {
return
}else{
lastZoom = currentZoom
lastZoom = currentZoom.toInt()
//TODO 暂时去掉无用的逻辑
// mMapView.ClearAllTmcLines()
}
@@ -763,8 +770,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
}
//车辆摆动变化事件
override fun dispatchDAngleChanged() {
val angle = getDAngle().toInt()
override fun dispatchDAngleChanged(angle: Float) {
if (DEBUG) {
Log.d(TAG, "styleop-DAngle: $angle")
}
@@ -916,6 +922,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
withContext(Dispatchers.Main) {
mEventController?.dispatchMapStyleListener(stylemode)
}
mMapView.getMapEngine().onChangeStyle(stylemode);
}
}
@@ -986,7 +993,15 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
}
mMapStyleParams.setVrPerspectiveMode(arrays[0])
mMapStyleParams.setVrEyeHeight(arrays[1])
if(mMapStyleParams.getVrAngleMode()==ConstantExt.MAP_STYLE_VR_BRIDGE){
var fac = 100.0f/(arrays[0]*8f)/20f
var lookAtZ = alt + 5.0f
var cameraHeight = arrays[2] + lookAtZ
arrays[2]=cameraHeight*fac;
mMapView.getMapEngine().setScreenToOriginDis(lookAtZ*fac)
}
if (lastAnimZoom == arrays[0] && lastOverLookAngle == arrays[1] && lastEyeHeight == arrays[2]) {
mMapView.getMapEngine()
.animateTo(lon, lat, alt, -1f, rotateAngle, -1f, -1f, mDuration, -1f)
} else {
@@ -1302,6 +1317,7 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
mEventController?.dispatchRoamStatusListener(3, "切换视角结束漫游:$type")
}
transJob?.cancel()
skyJob?.cancel()
//还原漫游模式状态结束
if (!mLockLocation.getLockCar() && type != ConstantExt.MAP_STYLE_VR_ROAM) {
mLockLocation.setLockCar(true)
@@ -1310,6 +1326,9 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.FOG, "disable")
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.SKYBOX, "disable")
}
if(type != ConstantExt.MAP_STYLE_VR_BRIDGE){
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "disable")
}
// mMapView.setIsFarViewAngel(false)
when (type) {
ConstantExt.MAP_STYLE_VR_ANGLE_MIDDLE -> {
@@ -1343,9 +1362,20 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
}
ConstantExt.MAP_STYLE_VR_SKY_BOX -> {
// mMapView.getMapEngine().setCfgKeyVal("isSkyBoxFastChange", "disable")
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.FOG, "enable")
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.SKYBOX, "enable")
skyJob = getDemaningScope()?.launch(Dispatchers.IO) {
interpolation(
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_SKYBOX,
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_SKYBOX,
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_SKYBOX,
ConstantExt.MAP_STYLE_VR_SKY_BOX,
-1
)
delay(1000)
mMapView.getMapEngine().setCfgKeyVal("isSkyBoxFastChange", "disable")
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.FOG, "enable")
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.SKYBOX, "enable")
}
//
}
ConstantExt.MAP_STYLE_VR_ANGLE_FAR -> {
@@ -1466,6 +1496,18 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
}
}
ConstantExt.MAP_STYLE_VR_BRIDGE->{
mMapView.getMapEngine().setCfgKeyVal(ConstantExt.BRIDGE, "enable")
interpolation(
ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_BRIDGE,
ConstantExt.MAP_STYLE_VR_OVER_LOOK_ANGLE_BRIDGE,
ConstantExt.MAP_STYLE_VR_ZOOM_VAL_BRIDGE,
ConstantExt.MAP_STYLE_VR_BRIDGE,
-1
)
}
}
if(type != ConstantExt.MAP_STYLE_VR_ROAM) {
mEventController?.dispatchMapViewVisualAngleChangeListener(type)
@@ -1982,6 +2024,9 @@ class MapController(private var context: Context?, private val mMapView: IMapVie
zoomJob?.cancel()
zoomJob = null
skyJob?.cancel()
skyJob = null
isRoam.set(false)
roamDis = 0.0

View File

@@ -19,7 +19,7 @@ object MapStyleHelper {
private val TAG = javaClass.simpleName
//更新样式时版本+1
val currentStyleVersion = 65
val currentStyleVersion = 66
private var copyJob:Job? = null

View File

@@ -42,14 +42,14 @@ public class MapZoomAdjuster implements MapStatusListener {
}
@Override
public void onMapStatusChanged(int type, int value) {
public void onMapStatusChanged(int type, float value) {
if (MapController.LISTENER_TYPE_ZOOM == type) {
adjustZoomChange(value, 10);
}
}
void adjustZoomChange(int value, int delaysecond) {
void adjustZoomChange(float value, int delaysecond) {
if (mMapMode >= NAVMODE && mFollowCarMode && value != NAVZOOMLEVEL) {
cancelAdjustZoomChange();
mNaviControllerHandler.sendEmptyMessageDelayed(MSG_ZOOM_CHANGED, 1000*delaysecond); /* delay 10s */

View File

@@ -112,7 +112,7 @@ public class DirectionLayer extends ImageView implements MapStatusListener {
return true;
}
@Override
public void onMapStatusChanged(int type, int value) {
public void onMapStatusChanged(int type, float value) {
postInvalidate();
}

View File

@@ -84,7 +84,7 @@ public class PanelBtnScale extends Panel implements MapStatusListener {
if(mMapController.getEventController() != null){
mMapController.getEventController().addMapStatusListener(this, MapController.LISTENER_TYPE_ZOOM);
}
mMapController.dispatchZoomChanged();
mMapController.dispatchZoomChanged(mMapController.getZoom());
}
@@ -145,7 +145,7 @@ public class PanelBtnScale extends Panel implements MapStatusListener {
}
@Override
public void onMapStatusChanged(int type, int value) {
public void onMapStatusChanged(int type, float value) {
if(mMapController ==null){
return;
}

View File

@@ -175,7 +175,7 @@ public class PolyLineView extends View implements MapStatusListener {
@Override
public void onMapStatusChanged(int type, int value) {
public void onMapStatusChanged(int type, float value) {
invalidate();
}
}

View File

@@ -12,6 +12,15 @@ import com.zhidaoauto.map.data.road.RoadRect
import com.zhidaoauto.map.data.road.RoadRectInfos
import com.zhidaoauto.map.data.road.RoadSign
import com.zhidaoauto.map.data.road.RoadSignPostion
import com.zhidaoauto.map.data.road.RouteCamera
import com.zhidaoauto.map.data.road.RouteLane
import com.zhidaoauto.map.data.road.RouteLine
import com.zhidaoauto.map.data.road.RoutePath
import com.zhidaoauto.map.data.road.RouteRsu
import com.zhidaoauto.map.data.road.RouteStep
import com.zhidaoauto.map.data.road.RouteStopLine
import com.zhidaoauto.map.data.road.RouteTrafficLight
import com.zhidaoauto.map.data.road.RouteZebraLine
import com.zhidaoauto.map.data.road.SinglePointRoadInfo
import com.zhidaoauto.map.data.road.StopLine
import com.zhidaoauto.map.data.road.ZebraLine
@@ -31,6 +40,7 @@ import com.zhidaoauto.map.sdk.open.city.CityCodeModel
import com.zhidaoauto.map.sdk.open.city.CityCodeResult
import com.zhidaoauto.map.sdk.open.data.CityInfo
import com.zhidaoauto.map.sdk.open.data.MapDataApi
import com.zhidaoauto.map.sdk.open.tools.MapTools
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
@@ -1118,7 +1128,6 @@ class RoadHelper private constructor() {
return
}
cancelCacheHDData()
cacheList.add(id)
cacheHDDataByCity(id,false,object : IResult<Boolean> {
@@ -1239,6 +1248,168 @@ class RoadHelper private constructor() {
}
}
fun getRouteInfo(routeList : ArrayList<LonLatPoint> , call:IResult<RoutePath>){
var key = StringBuffer("llaGetRoutePath_")
for(lonlat in routeList){
key.append("${lonlat.longitude.toTenDecimalsStr()}_${lonlat.latitude.toTenDecimalsStr()}_")
}
key.append("${RoadResultController.CANCELTAG}false")
RoadResultController.instance.addRoadResultListener(key.toString(),object :IRoadData{
override fun result(code: Int, result: ByteArray?) {
if (CompileConfig.DEBUG) {
Log.d(TAG, "roadop--getRouteInfo--code:${code},result: $result")
}
if (result?.isEmpty() == true) {
call.result(1, null)
return
}
result?.let {
val buf = ByteBufferHelper.bytes2ByteBuffer(result)
buf?.let {
val routePath = RoutePath()
val list = ArrayList<RouteStep>()
val size = buf.int
for(i in 0 until size){
val routeStep = RouteStep()
routeStep.id = buf.long.toInt()
routeStep.tileId = buf.int
routeStep.type = buf.int
routeStep.name = ByteBufferHelper.buf2Str(buf)?:""
routeStep.limitSpeed = buf.int
val routeLane = RouteLane()
routeLane.laneId = buf.int
routeLane.laneWidth = buf.long/1e8.toFloat()
val lonLatSize = buf.int
val lonlats = ArrayList<LonLatPoint>()
for(j in 0 until lonLatSize step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
lonlats.add(lonLatPoint)
}
routeLane.lanePoints = lonlats
routeStep.lanes = routeLane
val crossSize = buf.int
val crossPoints = ArrayList<LonLatPoint>()
for(k in 0 until crossSize step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
crossPoints.add(lonLatPoint)
}
routeStep.points = crossPoints
val stopLines = ArrayList<RouteStopLine>()
val stopLines_size = buf.int
for(m in 0 until stopLines_size) {
val stopLine = RouteStopLine()
stopLine.length = buf.long / 1e8
val stopSize = buf.int
val stopPoints = ArrayList<LonLatPoint>()
for (l in 0 until stopSize step 2) {
val lonLatPoint = LonLatPoint(buf.long / 1e8, buf.long / 1e8)
stopPoints.add(lonLatPoint)
}
stopLine.stopLinePoints = stopPoints
stopLines.add(stopLine)
}
routeStep.stopLine = stopLines
var zebraLines = ArrayList<RouteZebraLine>()
val zebraLine_size = buf.int
for(m in 0 until zebraLine_size){
val routeZebraLine = RouteZebraLine()
routeZebraLine.id = buf.int
routeZebraLine.dis = buf.long/1e8.toFloat()
val zebraLine_pts = buf.int
val zebraLinePoints = ArrayList<LonLatPoint>()
for(n in 0 until zebraLine_pts step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
zebraLinePoints.add(lonLatPoint)
}
routeZebraLine.zebraLinePoints = zebraLinePoints
zebraLines.add(routeZebraLine)
}
routeStep.zebraLines = zebraLines
var trafficLights = ArrayList<RouteTrafficLight>()
val trafficLight_size = buf.int
for(o in 0 until trafficLight_size){
val routeTrafficLight = RouteTrafficLight()
routeTrafficLight.id = buf.int
routeTrafficLight.type = buf.int
routeTrafficLight.shape = buf.int
val trafficLight_pts = buf.int
val trafficLightPoints = ArrayList<LonLatPoint>()
for(p in 0 until trafficLight_pts step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
trafficLightPoints.add(lonLatPoint)
}
routeTrafficLight.trafficLightPoints = trafficLightPoints
trafficLights.add(routeTrafficLight)
}
routeStep.trafficLights = trafficLights
var cameras = ArrayList<RouteCamera>()
val camera_size = buf.int
for(q in 0 until camera_size){
val routeCamera = RouteCamera()
routeCamera.id = buf.int
routeCamera.type = buf.int
routeCamera.shape = buf.int
val camera_pts = buf.int
val cameraPoints = ArrayList<LonLatPoint>()
for(r in 0 until camera_pts step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
cameraPoints.add(lonLatPoint)
}
routeCamera.cameraPoints = cameraPoints
cameras.add(routeCamera)
}
routeStep.cameras = cameras
var rsus = ArrayList<RouteRsu>()
val rsu_size = buf.int
for(s in 0 until rsu_size){
val routeRsu = RouteRsu()
routeRsu.id = buf.long.toInt()
routeRsu.type = buf.int
routeRsu.shape = buf.int
val routeRsu_pts = buf.int
val routeRsuPoints = ArrayList<LonLatPoint>()
for(t in 0 until routeRsu_pts step 2){
val lonLatPoint = LonLatPoint(buf.long /1e8, buf.long /1e8)
routeRsuPoints.add(lonLatPoint)
}
routeRsu.rsuPoints = routeRsuPoints
rsus.add(routeRsu)
}
routeStep.rsus = rsus
list.add(routeStep)
}
if(list.isNotEmpty()){
routePath.steps = list
if (CompileConfig.DEBUG) {
Log.d(TAG, "roadop--getRouteInfo--routePath:${routePath}")
}
call.result(0, routePath)
return
}
}
}
call.result(1,null)
}
})
val data = MapTools.listToArray(routeList,false)
try {
mapBox.llaGetRoutePath(data)
}catch (e: Exception){
if (CompileConfig.DEBUG) {
Log.e(TAG, e.toString())
}
}
}
fun isInRoadSideFenceRegion(lon: Double, lat: Double, call: IResult<Int>){
val time = System.currentTimeMillis()

View File

@@ -24,6 +24,7 @@ enum class HDTypes(
area(19), //景点区域
regional(20), //人行步道
geometricLinear(21), //线区域,路测智能体等
geometricSurface(22); //面区域,自行
geometricSurface(22), //面区域,自行
poi(23),
}

View File

@@ -31,7 +31,6 @@ import com.zhidaoauto.map.sdk.open.view.MapAutoView
import io.netty.buffer.Unpooled
import java.math.BigDecimal
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import kotlin.math.abs
import kotlin.math.pow
@@ -57,6 +56,7 @@ object MapAutoApi {
const val MAP_STYLE_VR_ROAM = 7 //漫游模式
const val MAP_STYLE_VR_TRANS = 8//过渡模式
const val MAP_STYLE_VR_ERHAI_B2 = 9//洱海模式
const val MAP_STYLE_VR_SKY_BOX = 10 //天空盒模式
const val MAP_STYLE_VR_ANGLE_NEAR = 0
const val MAP_STYLE_VR_ANGLE_MIDDLE = 1
@@ -521,13 +521,13 @@ object MapAutoApi {
val byteBuffer = Unpooled.buffer()
val str = "1111112345678sjkfdhdkb"
byteBuffer.writeInt(str.length)
byteBuffer.writeCharSequence(str, StandardCharsets.UTF_8)
byteBuffer.writeCharSequence(str, Charset.forName("utf-8"))
byteBuffer.writeBoolean(true)
byteBuffer.writeInt(999)
byteBuffer.writeInt(12)
val length = byteBuffer.readInt()
println("$length")
println("${byteBuffer.readCharSequence(length, StandardCharsets.UTF_8)}")
println("${byteBuffer.readCharSequence(length, Charset.forName("utf-8"))}")
println("${byteBuffer.readBoolean()}")
println("${byteBuffer.readInt()}")

View File

@@ -12,7 +12,6 @@ import com.zhidaoauto.map.sdk.inner.utils.Recorder
import io.netty.buffer.Unpooled
import java.math.BigDecimal
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import kotlin.math.pow
object NavAutoApi {
@@ -168,13 +167,13 @@ object NavAutoApi {
val byteBuffer = Unpooled.buffer()
val str = "1111112345678sjkfdhdkb"
byteBuffer.writeInt(str.length)
byteBuffer.writeCharSequence(str, StandardCharsets.UTF_8)
byteBuffer.writeCharSequence(str, Charset.forName("utf-8"))
byteBuffer.writeBoolean(true)
byteBuffer.writeInt(999)
byteBuffer.writeInt(12)
val length = byteBuffer.readInt()
println("$length")
println("${byteBuffer.readCharSequence(length, StandardCharsets.UTF_8)}")
println("${byteBuffer.readCharSequence(length, Charset.forName("utf-8"))}")
println("${byteBuffer.readBoolean()}")
println("${byteBuffer.readInt()}")
}

View File

@@ -7,5 +7,5 @@ package com.zhidaoauto.map.sdk.open.abs
* @param value 当前状态值
*/
interface MapStatusListener {
fun onMapStatusChanged(type: Int, value: Int)
fun onMapStatusChanged(type: Int, value: Float)
}

View File

@@ -4,7 +4,7 @@ import com.zhidaoauto.map.sdk.open.camera.CameraPosition
interface OnCameraChangeListener {
fun onCameraChange(type:Int,value:Int)
fun onCameraChange(type:Int,value:Float)
fun onCameraChangeFinish(position: CameraPosition?)
}

View File

@@ -13,6 +13,7 @@ import com.zhidaoauto.map.data.road.Lane
import com.zhidaoauto.map.data.road.RoadCross
import com.zhidaoauto.map.data.road.RoadNameInfo
import com.zhidaoauto.map.data.road.RoadRectInfos
import com.zhidaoauto.map.data.road.RoutePath
import com.zhidaoauto.map.data.road.SinglePointRoadInfo
import com.zhidaoauto.map.data.road.StopLine
import com.zhidaoauto.map.data.road.ZebraLine
@@ -83,13 +84,6 @@ object MapDataApi {
}
fun getRouteInfo(
centerLon: Float,
centerLat: Float, coor: Int, type: Int
): String {
Recorder.add("roadop-getRouteInfo:$centerLon,$centerLat,$coor,$type")
return RoadHelper.getInstance()?.getRoadInfo(centerLon, centerLat, coor, type)?:""
}
/**
* 获取道路关键点数据
@@ -394,6 +388,10 @@ object MapDataApi {
}
fun getRouteInfo(routeList : ArrayList<LonLatPoint>,call:IResult<RoutePath> ){
RoadHelper.getInstance()?.getRouteInfo(routeList,call)
}

View File

@@ -41,7 +41,7 @@ class MapException : Exception {
}
private fun init(msg: String) {
if ("用户签名未通过" == msg) {
if ("用户签名错误" == msg) {
errorCode = 1001
} else if ("用户key不正确或过期" == msg) {
errorCode = 1002
@@ -146,7 +146,7 @@ class MapException : Exception {
companion object {
const val CODE_AMAP_SUCCESS = 1000
const val AMAP_SIGNATURE_ERROR = "用户签名未通过"
const val AMAP_SIGNATURE_ERROR = "用户签名错误"
const val AMAP_INVALID_USER_KEY = "用户key不正确或过期"
const val AMAP_SERVICE_NOT_AVAILBALE = "请求服务不存在"
const val AMAP_DAILY_QUERY_OVER_LIMIT = "访问已超出日访问量"

View File

@@ -222,6 +222,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
markerSimpleData.color = markerOptions.color
markerSimpleData.text = markerOptions.text
markerSimpleData.status = markerOptions.status
markerSimpleData.grayScale = markerOptions.grayScale
if (preMarkerMap.containsKey(id)) {
// pre data
@@ -275,6 +276,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
tempSimpleData.color = markerSimpleData.color
tempSimpleData.text = markerSimpleData.text
tempSimpleData.status = markerSimpleData.status
tempSimpleData.grayScale = markerSimpleData.grayScale
var tempList = interpolationDataSetMap[time]
if (tempList == null) {
tempList = ArrayList()

View File

@@ -165,6 +165,7 @@ class MarkerController(mapController: IMapController) : IMarkerController {
.append(markerOption.color).append(",")
.append(markerOption.text.trim()).append(",")
.append(markerOption.status).append(",")
.append(markerOption.grayScale).append(",")
}
if(otherBuffer.length>1){
otherBuffer.deleteCharAt(otherBuffer.length-1)

View File

@@ -114,6 +114,8 @@ class MarkerOptions {
var changeColorAngle: Float = 0f
var mixColor = 0 //是否混合颜色 0 不混合 1 混合
private var icons: ArrayList<String> = ArrayList()
var averageFlag: Int = 1
@@ -194,6 +196,11 @@ class MarkerOptions {
return this
}
fun setMixColor(isMixColor: Int): MarkerOptions{
this.mixColor = isMixColor
return this
}
fun updateInfowindowBitmap(markerInfoBitmap: BitmapDescriptor,mapController: IMapController?): MarkerOptions {
val markerInfoView = markerInfoBitmap.getBytes()

View File

@@ -26,6 +26,8 @@ class MarkerSimpleData {
var text: String = ""
//状态
var status: Int = 0
//置灰
var grayScale: Int = 0

View File

@@ -45,7 +45,7 @@ class DirectionView: ImageView, MapStatusListener {
}
override fun onMapStatusChanged(type: Int, value: Int) {
override fun onMapStatusChanged(type: Int, value: Float) {
postInvalidate()
}

View File

@@ -955,100 +955,114 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
private fun getRoadInfo(mogoLocation: MogoLocation) {
if (System.currentTimeMillis() - mLastTimeRoadInfo > mIntervalTimeRoadInfo) {
mLastTimeRoadInfo = System.currentTimeMillis()
mLastRoadLonLatPoint?.let {
if(CompileConfig.DEBUG){
Log.i(TAG, "roadop--cancelTask last: $mLastRoadLonLatPoint")
}
//发现有任务堆积时100米为超参按照常识5秒内未返回数据取消之前道路相关任务
if(MapTools.getDistance(it.latitude,it.longitude,mogoLocation.lat,mogoLocation.lon) > 100.0){
if(CompileConfig.DEBUG){
Log.i(TAG, "roadop--cancelTask:distance>200 : $mLastRoadLonLatPoint")
if(mEventController?.getRoadInfoListenerList()?.size?:0 > 0) {
if (System.currentTimeMillis() - mLastTimeRoadInfo > mIntervalTimeRoadInfo) {
mLastTimeRoadInfo = System.currentTimeMillis()
mLastRoadLonLatPoint?.let {
if (CompileConfig.DEBUG) {
Log.i(TAG, "roadop--cancelTask last: $mLastRoadLonLatPoint")
}
//发现有任务堆积时100米为超参按照常识5秒内未返回数据取消之前道路相关任务
if (MapTools.getDistance(
it.latitude,
it.longitude,
mogoLocation.lat,
mogoLocation.lon
) > 100.0
) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "roadop--cancelTask:distance>200 : $mLastRoadLonLatPoint")
}
// 取消任务
RoadHelper.getInstance()?.cancelTask()
}
// 取消任务
RoadHelper.getInstance()?.cancelTask()
}
}
// mLastRoadLonLatPoint = LonLatPoint(mogoLocation.lon,mogoLocation.lat)
// 获取车道中心线数据
RoadHelper.getInstance()?.getCenterLine(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object :
IResult<CenterLine> {
override fun result(code: Int, result: CenterLine?) {
mLastRoadLonLatPoint = LonLatPoint(mogoLocation.lon,mogoLocation.lat)
mEventController?.dispatchRoadIdInfo(
result?.road_id,
result?.lane_id
)
}
})
RoadHelper.getInstance()?.getStopLine(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object : IResult<StopLine> {
override fun result(code: Int, result: StopLine?) {
mEventController?.dispatchStopLineInfo(result)
}
// 获取车道中心线数据
RoadHelper.getInstance()?.getCenterLine(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object :
IResult<CenterLine> {
override fun result(code: Int, result: CenterLine?) {
mLastRoadLonLatPoint = LonLatPoint(mogoLocation.lon, mogoLocation.lat)
mEventController?.dispatchRoadIdInfo(
result?.road_id,
result?.lane_id
)
}
})
RoadHelper.getInstance()?.getStopLine(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object : IResult<StopLine> {
override fun result(code: Int, result: StopLine?) {
mEventController?.dispatchStopLineInfo(result)
}
})
RoadHelper.getInstance()?.getCrossRoad(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object : IResult<RoadCross> {
override fun result(code: Int, result: RoadCross?) {
mEventController?.dispatchRoadCrossInfo(result)
}
})
RoadHelper.getInstance()?.getCrossRoad(
mogoLocation.lon,
mogoLocation.lat,
mogoLocation.heading.toFloat(),
true,
object : IResult<RoadCross> {
override fun result(code: Int, result: RoadCross?) {
mEventController?.dispatchRoadCrossInfo(result)
}
})
})
}
}
}
private fun isInRoadSideFenceRegion(mogoLocation: MogoLocation) {
if (System.currentTimeMillis() - mLastTimeRoadSideFence > mIntervalTimeRoadSideFence) {
mLastTimeRoadSideFence = System.currentTimeMillis()
mLastRoadSideFenceLonLatPoint?.let {
if (CompileConfig.DEBUG) {
Log.i(TAG, "roadSideFence--op--cancelTask last: $mLastRoadSideFenceLonLatPoint")
}
//发现有任务堆积时100米为超参按照常识5秒内未返回数据取消之前道路相关任务
if (MapTools.getDistance(
it.latitude,
it.longitude,
mogoLocation.lat,
mogoLocation.lon
) > 100.0
) {
if(mEventController?.getRoadSideFenceRegionListener()?.size?:0 > 0) {
if (System.currentTimeMillis() - mLastTimeRoadSideFence > mIntervalTimeRoadSideFence) {
mLastTimeRoadSideFence = System.currentTimeMillis()
mLastRoadSideFenceLonLatPoint?.let {
if (CompileConfig.DEBUG) {
Log.i(TAG, "roadop--cancelTask:distance>200 : $mLastRoadLonLatPoint")
Log.i(
TAG,
"roadSideFence--op--cancelTask last: $mLastRoadSideFenceLonLatPoint"
)
}
// 取消任务
RoadHelper.getInstance()?.cancelTask()
}
}
RoadHelper.getInstance()?.isInRoadSideFenceRegion(
mogoLocation.lon,
mogoLocation.lat,
object : IResult<Int> {
override fun result(code: Int, result: Int?) {
mLastRoadSideFenceLonLatPoint = LonLatPoint(mogoLocation.lon,mogoLocation.lat)
result?.let {
mEventController?.dispatchRoadSideFenceRegionListener(it)
//发现有任务堆积时100米为超参按照常识5秒内未返回数据取消之前道路相关任务
if (MapTools.getDistance(
it.latitude,
it.longitude,
mogoLocation.lat,
mogoLocation.lon
) > 100.0
) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "roadop--cancelTask:distance>200 : $mLastRoadLonLatPoint")
}
// 取消任务
RoadHelper.getInstance()?.cancelTask()
}
})
}
RoadHelper.getInstance()?.isInRoadSideFenceRegion(
mogoLocation.lon,
mogoLocation.lat,
object : IResult<Int> {
override fun result(code: Int, result: Int?) {
mLastRoadSideFenceLonLatPoint =
LonLatPoint(mogoLocation.lon, mogoLocation.lat)
result?.let {
mEventController?.dispatchRoadSideFenceRegionListener(it)
}
}
})
}
}
}
override fun getCurrentLonLatPoint(): LonLatPoint {

View File

@@ -42,10 +42,10 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置地图的刷新状态以及频率
* @param enableSync
*/
fun setRenderFrequency(enableSync: Boolean,renderTimePer:Int){
fun setRenderFrequency(enableSync: Boolean, renderTimePer: Int) {
mMapAutoView.getClerk()?.add("$enableSync,$renderTimePer")
mMapAutoView.getMapController()?.setRenderFrequency(
enableSync,renderTimePer
enableSync, renderTimePer
)
}
@@ -53,9 +53,9 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置在车在屏幕的相对位置
* @param param defult = 4 range (1..6) 设置自车位置 offset 1.0-6.0 <4.0车向上,>4.0车向下
*/
fun setSelfCarPosition(param:Float){
fun setSelfCarPosition(param: Float) {
mMapAutoView.getClerk()?.add("$param")
var overAngle = (getMapDAngle())?:6.5f
var overAngle = (getMapDAngle()) ?: 6.5f
mMapAutoView.getMapController()?.setScreenToOriginDis(param)
overAngle += 0.01f
setMapDAngle(overAngle)
@@ -70,7 +70,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param screenToOrigin defult = 4
*/
@Deprecated(message = "dead")
fun setEyePosition(eyeToOrigin:Float,screenToOrigin:Float){
fun setEyePosition(eyeToOrigin: Float, screenToOrigin: Float) {
mMapAutoView.getClerk()?.add("$eyeToOrigin,$screenToOrigin")
mMapAutoView.getMapController()?.setEyeToOriginDis(eyeToOrigin)
mMapAutoView.getMapController()?.setScreenToOriginDis(screenToOrigin)
@@ -186,7 +186,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
}
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.zoomIn()
mMapAutoView.getMapController()?.dispatchZoomChanged()
mMapAutoView.getMapController()?.dispatchZoomChanged(getZoom().toFloat())
}
/**
@@ -196,7 +196,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun getZoom(): Int {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getZoom()?: 16
return mMapAutoView.getMapController()?.getZoom() ?: 16
}
@@ -233,7 +233,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun setVrEyeHeight(eyeHeight: Float) {
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.interpolation(eyeHeight,-1f, -1f, -1, -1)
mMapAutoView.getMapController()?.interpolation(eyeHeight, -1f, -1f, -1, -1)
}
@@ -248,24 +248,31 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param mDuration 动画时长
* @param isGPS 是否wgs84坐标系
*/
fun animateTo( lon: Double,
lat: Double,
zoom: Float,
rotateAngle: Float,
overlookAngle: Float,
eyeHeight: Float,
mDuration:Int,
isGPS: Boolean) {
if(CompileConfig.DEBUG){
Log.i(TAG,"animateTo:lon:${lon},lat:${lat},zoom:${zoom},rotateAngle:${rotateAngle},overlookAngle:${overlookAngle},mDuration:${mDuration}")
fun animateTo(
lon: Double,
lat: Double,
zoom: Float,
rotateAngle: Float,
overlookAngle: Float,
eyeHeight: Float,
mDuration: Int,
isGPS: Boolean
) {
if (CompileConfig.DEBUG) {
Log.i(
TAG,
"animateTo:lon:${lon},lat:${lat},zoom:${zoom},rotateAngle:${rotateAngle},overlookAngle:${overlookAngle},mDuration:${mDuration}"
)
}
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.setStartFrame(zoom, overlookAngle, eyeHeight)
if(!isGPS) {
val lonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(LonLatPoint(lon, lat))
mMapAutoView.getMapController()?.animateTo(lonLat.lon, lonLat.lat, 0f,rotateAngle, mDuration)
}else{
mMapAutoView.getMapController()?.animateTo(lon, lat, 0f,rotateAngle, mDuration)
if (!isGPS) {
val lonLat =
CommonProxy.getInstance().getLonLatProxy().switchLonLat(LonLatPoint(lon, lat))
mMapAutoView.getMapController()
?.animateTo(lonLat.lon, lonLat.lat, 0f, rotateAngle, mDuration)
} else {
mMapAutoView.getMapController()?.animateTo(lon, lat, 0f, rotateAngle, mDuration)
}
}
@@ -278,18 +285,22 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param mDuration 动画时长
* @param isGPS 是否wgs84坐标系
*/
fun animateTo( lon: Double,
lat: Double,
rotateAngle: Float,
mDuration:Int,
isGPS: Boolean) {
fun animateTo(
lon: Double,
lat: Double,
rotateAngle: Float,
mDuration: Int,
isGPS: Boolean
) {
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.setStartFrame(-1f, -1f, -1f)
if(!isGPS) {
val lonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(LonLatPoint(lon, lat))
mMapAutoView.getMapController()?.animateTo(lonLat.lon, lonLat.lat, 0f, rotateAngle, mDuration)
}else{
mMapAutoView.getMapController()?.animateTo(lon, lat, 0f, rotateAngle, mDuration)
if (!isGPS) {
val lonLat =
CommonProxy.getInstance().getLonLatProxy().switchLonLat(LonLatPoint(lon, lat))
mMapAutoView.getMapController()
?.animateTo(lonLat.lon, lonLat.lat, 0f, rotateAngle, mDuration)
} else {
mMapAutoView.getMapController()?.animateTo(lon, lat, 0f, rotateAngle, mDuration)
}
}
@@ -300,7 +311,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param eyeHeight 眼睛高度
* @param mDuration 动画时长
*/
fun animateTo(zoom: Float, overlookAngle: Float, eyeHeight: Float, mDuration:Int) {
fun animateTo(zoom: Float, overlookAngle: Float, eyeHeight: Float, mDuration: Int) {
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.interpolation(eyeHeight, overlookAngle, zoom, -1, -1)
}
@@ -317,7 +328,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
mMapAutoView.getMapController()?.setDAngle(angle)
}
fun getMapDAngle(): Float?{
fun getMapDAngle(): Float? {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getDAngle()
}
@@ -334,8 +345,14 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
mMapAutoView.getClerk()?.add()
val center = getCenter()
val lonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(center)
mMapAutoView.getMapController()?.setStartFrame(-1f,-1f,-1f)
mMapAutoView.getMapController()?.animateTo(lonLat.lon, lonLat.lat, 0f, rotateAngle,ConstantExt.MAP_ANIM_DEFAULT_DURATION)
mMapAutoView.getMapController()?.setStartFrame(-1f, -1f, -1f)
mMapAutoView.getMapController()?.animateTo(
lonLat.lon,
lonLat.lat,
0f,
rotateAngle,
ConstantExt.MAP_ANIM_DEFAULT_DURATION
)
}
/**
@@ -358,7 +375,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun getMapViewRotation(): Float {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getRotateAngle() ?: 0.0f
return mMapAutoView.getMapController()?.getRotateAngle() ?: 0.0f
}
@@ -368,7 +385,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param mapPerspective 视图模式 1 2D模式 2 3D模式 3:车头向上 4:正北模式
* @param deviationAngle 正北模式地图偏转角度 默认0f
*/
fun setMapViewPerspective(mapPerspective: Int,deviationAngle:Float = 0f) {
fun setMapViewPerspective(mapPerspective: Int, deviationAngle: Float = 0f) {
mMapAutoView.getClerk()?.add()
mMapAutoView.setDeviationAngle(deviationAngle)
mMapAutoView.getMapController()?.getMapStyleParams()?.setPerspectiveMode(mapPerspective)
@@ -383,7 +400,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun getMapViewPerspective(): Float {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getMapViewPerspective() ?: MapAutoApi.MAP_PERSPECTIVE_2D.toFloat()
return mMapAutoView.getMapController()?.getMapViewPerspective()
?: MapAutoApi.MAP_PERSPECTIVE_2D.toFloat()
}
/**
@@ -393,7 +411,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun getRulerInfo(): Float {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getRulerInfo() ?: 0.0f
return mMapAutoView.getMapController()?.getRulerInfo() ?: 0.0f
}
/**
@@ -402,7 +420,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
fun clearSearchPoi() {
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.clearSearchResult()
mMapAutoView.getPanelManager()?.setPanel(PanelManager.PANEL_WHAT_RESET, PanelManager.PANEL_MODE_PANEL_BTN_LEFT)
mMapAutoView.getPanelManager()
?.setPanel(PanelManager.PANEL_WHAT_RESET, PanelManager.PANEL_MODE_PANEL_BTN_LEFT)
}
/**
@@ -426,7 +445,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
*/
fun getMapStyle(): Int {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getMapStyleParams()?.getStyleMode()?:MapAutoApi.MAP_STYLE_NIGHT_VR
return mMapAutoView.getMapController()?.getMapStyleParams()?.getStyleMode()
?: MapAutoApi.MAP_STYLE_NIGHT_VR
}
@@ -437,7 +457,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
fun getMyLocationEnabled(): Boolean {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getLocationView()?.getMyLocationEnabled()?:false
return mMapAutoView.getLocationView()?.getMyLocationEnabled() ?: false
}
/**
@@ -614,7 +634,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
//隐藏缩放按钮
fun hiddenZoom() {
mMapAutoView.getClerk()?.add()
mMapAutoView.getPanelManager()?.setPanel(PanelManager.PANEL_WHAT_HID, PanelManager.PANEL_BTN_ZOOM)
mMapAutoView.getPanelManager()
?.setPanel(PanelManager.PANEL_WHAT_HID, PanelManager.PANEL_BTN_ZOOM)
}
/**
@@ -748,7 +769,6 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
}
/**
* 地图截屏
*/
@@ -781,23 +801,30 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
}
}
}
MapCameraMessage.Type.zoomTo -> {
mMapAutoView.getMapController()?.setZoom(mapCameraMessage.zoom.toInt())
}
MapCameraMessage.Type.zoomOut -> {
mMapAutoView.getMapController()?.zoomOut()
}
MapCameraMessage.Type.newLatLngBounds -> {
val latLngBounds = mapCameraMessage.bounds
if (latLngBounds != null && latLngBounds.isLegal()) {
val zoomIndex = autoZoom(latLngBounds.southwest!!, latLngBounds.northeast!!)
if (CompileConfig.DEBUG) {
Log.i(TAG, "mapop-moveCamera-newLatLngBounds:,${latLngBounds},zoom:${zoomIndex}")
Log.i(
TAG,
"mapop-moveCamera-newLatLngBounds:,${latLngBounds},zoom:${zoomIndex}"
)
}
mMapAutoView.getMapController()?.setZoom(zoomIndex)
}
}
else -> {
throw NotImplementException()
}
@@ -846,6 +873,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.drawThickLine(polylineOptions)
}
/**
* 绘制圆
*/
@@ -902,7 +930,10 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
Log.i(TAG, "mapop-custommap--setPointToCenter")
}
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.setOffset((MapTools.viewWidth*(x-0.5f)).toInt(), ((MapTools.viewWidth*(y-0.5f)).toInt()))
mMapAutoView.getMapController()?.setOffset(
(MapTools.viewWidth * (x - 0.5f)).toInt(),
((MapTools.viewWidth * (y - 0.5f)).toInt())
)
// mMapAutoView.getPanelManager()?.setPanelPos(PanelManager.PANEL_MODE_MAP,0,0,0,0)
}
@@ -921,7 +952,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
Log.i(TAG, "mapop-custommap--clearPanel")
}
mMapAutoView.getClerk()?.add()
mMapAutoView.getPanelManager()?.setPanel(PanelManager.PANEL_WHAT_HID, PanelManager.PANEL_MODE_VIEW_MAIN)
mMapAutoView.getPanelManager()
?.setPanel(PanelManager.PANEL_WHAT_HID, PanelManager.PANEL_MODE_VIEW_MAIN)
}
// 自动切换夜间模式开关
@@ -948,7 +980,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
Log.i(TAG, "mapop-custommap--getIsUseExtraGPSData")
}
mMapAutoView.getClerk()?.add()
return mMapAutoView.getLocationClient()?.isUseExtraGPSData()?:false
return mMapAutoView.getLocationClient()?.isUseExtraGPSData() ?: false
}
//传入外部数据
@@ -1023,7 +1055,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
Log.i(TAG, "mapop-custommap--getScalePerPixel")
}
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getResulation() ?: 0.0f
return mMapAutoView.getMapController()?.getResulation() ?: 0.0f
}
//自动缩放
@@ -1034,7 +1066,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
mMapAutoView.getClerk()?.add()
val minLonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(minLonLatPoint)
val maxLonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(maxLonLatPoint)
return mMapAutoView.getMapController()?.getSuitableZoom(minLonLat.lon, minLonLat.lat, maxLonLat.lon, maxLonLat.lat) ?: 16
return mMapAutoView.getMapController()
?.getSuitableZoom(minLonLat.lon, minLonLat.lat, maxLonLat.lon, maxLonLat.lat) ?: 16
}
@@ -1050,7 +1083,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
fun isTrafficOn(): Boolean {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.isTrafficOn()?: false
return mMapAutoView.getMapController()?.isTrafficOn() ?: false
}
//设置是否打开交通路况图层
@@ -1104,7 +1137,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* 修改锚点的变形比例
*/
fun setAnchorScale(wRate: Float,hRate: Float) {
fun setAnchorScale(wRate: Float, hRate: Float) {
mMapAutoView.getClerk()?.add()
// mMapAutoView.getMapController()?.setAnchorScale(wRate, hRate)
}
@@ -1113,21 +1146,21 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置缩放
* @param zoomVal
*/
fun setZoomVal(zoomVal:Float){
fun setZoomVal(zoomVal: Float) {
mMapAutoView.getClerk()?.add("$zoomVal")
mMapAutoView.getMapController()?.setZoomValue(zoomVal)
}
//获取眼睛高度
fun getEyeHeight(): Float{
fun getEyeHeight(): Float {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getEyeHeight()?: ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_MIDDLE
return mMapAutoView.getMapController()?.getEyeHeight()
?: ConstantExt.MAP_STYLE_VR_EYE_HEIGHT_MIDDLE
}
//设置眼睛高度
fun setEyeHeight(eyeHeight: Float){
fun setEyeHeight(eyeHeight: Float) {
mMapAutoView.getClerk()?.add("$eyeHeight")
mMapAutoView.getMapController()?.setEyeHeight(eyeHeight)
}
@@ -1135,28 +1168,28 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* 设置视阈
*/
fun setVerticalViewFieldAngle(r: Float){
fun setVerticalViewFieldAngle(r: Float) {
mMapAutoView.getClerk()?.add("$r")
mMapAutoView.getMapController()?.setVerticalViewFieldAngle(r)
}
fun getVerticalViewFieldAngle(): Float?{
fun getVerticalViewFieldAngle(): Float? {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getVerticalViewFieldAngle()
return mMapAutoView.getMapController()?.getVerticalViewFieldAngle()
}
/**
* 设置是否自动切换视角
*/
fun setSwitchViewAngle(isSwitchViewAngle: Boolean){
fun setSwitchViewAngle(isSwitchViewAngle: Boolean) {
mMapAutoView.getClerk()?.add("$isSwitchViewAngle")
mMapAutoView.getMapController()?.getMapStyleParams()?.setSwitchViewAngle(isSwitchViewAngle)
}
fun isSwitchViewAngle(): Boolean{
fun isSwitchViewAngle(): Boolean {
mMapAutoView.getClerk()?.add()
return mMapAutoView.getMapController()?.getMapStyleParams()?.isSwitchViewAngle()?:false
return mMapAutoView.getMapController()?.getMapStyleParams()?.isSwitchViewAngle() ?: false
}
/**
@@ -1172,7 +1205,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* const val MAP_STYLE_VR_ROAM = 7
* const val MAP_STYLE_VR_TRANS = 8
*/
fun setMapViewVisualAngle(type: Int){
fun setMapViewVisualAngle(type: Int) {
mMapAutoView.getClerk()?.add("$type")
if (CompileConfig.DEBUG) {
Log.i(TAG, "setMapViewVisualAngle:${type}")
@@ -1185,7 +1218,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置是否只在高精地图缩放
* @param isScaleVr
*/
fun setScaleVRMode(isScaleVr: Boolean){
fun setScaleVRMode(isScaleVr: Boolean) {
mMapAutoView.getClerk()?.add("$isScaleVr")
mMapAutoView.getMapController()?.setVrMode(isScaleVr)
}
@@ -1196,12 +1229,12 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param lonLatPoint
* @param isGps
*/
fun setNearViewAnglePosition(lonLatPoint: LonLatPoint, isGps: Boolean){
fun setNearViewAnglePosition(lonLatPoint: LonLatPoint, isGps: Boolean) {
mMapAutoView.getClerk()?.add("$lonLatPoint,$isGps")
val lonLat: LonLat
if(!isGps) {
if (!isGps) {
lonLat = CommonProxy.getInstance().getLonLatProxy().switchLonLat(lonLatPoint)
}else{
} else {
lonLat = LonLat(lonLatPoint.longitude, lonLatPoint.latitude)
}
mMapAutoView.getMapController()?.setNearViewAnglePosition(lonLat)
@@ -1209,7 +1242,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
}
fun testMapViewAngle(type: Int){
fun testMapViewAngle(type: Int) {
mMapAutoView.getClerk()?.add("$type")
mMapAutoView.getMapController()?.testMapViewAngle(type)
}
@@ -1219,10 +1252,10 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param type 0=默认 1=左黄 2=右黄 3=双黄 4=双红
* @param time 闪烁时间
*/
fun setTailLightsType(type: Int, time: Int){
fun setTailLightsType(type: Int, time: Int) {
mMapAutoView.getClerk()?.add("$type,$time")
var flashTime = time
if(flashTime < 500) {
if (flashTime < 500) {
flashTime = 500
}
mMapAutoView.getMapController()?.setTailLightsType(type, flashTime)
@@ -1231,29 +1264,36 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* 设置锚点渐变色
*/
fun setAnchorGradientColor(startColor: String, endColor: String, startDistance: Float, endDistance: Float){
fun setAnchorGradientColor(
startColor: String,
endColor: String,
startDistance: Float,
endDistance: Float
) {
mMapAutoView.getClerk()?.add("$startColor,$endColor,$startDistance,$endDistance")
mMapAutoView.getMapController()?.setAnchorGradientColor(startColor, endColor, startDistance, endDistance)
mMapAutoView.getMapController()
?.setAnchorGradientColor(startColor, endColor, startDistance, endDistance)
}
/**
* @param isUseTrace 1使用轨迹 0自有漫游模式
* @param dis: 漫游长度
* @param speed: 速度
*/
fun setRoamStyle(isUseTrace: Int, dis: Float, speed: Float){
fun setRoamStyle(isUseTrace: Int, dis: Float, speed: Float) {
mMapAutoView.getClerk()?.add("$isUseTrace,$dis,$speed")
var roamDis = dis
if(roamDis > ConstantExt.ROAM_DIS_MAX){
if (roamDis > ConstantExt.ROAM_DIS_MAX) {
roamDis = ConstantExt.ROAM_DIS_MAX
} else if(roamDis < 0){
} else if (roamDis < 0) {
roamDis = ConstantExt.ROAM_DIS_1KM
}
var roamSpeed = speed
if(roamSpeed > ConstantExt.ROAM_SPEED_80){
if (roamSpeed > ConstantExt.ROAM_SPEED_80) {
roamSpeed = ConstantExt.ROAM_SPEED_80
} else if(roamSpeed < ConstantExt.ROAM_SPEED_30){
} else if (roamSpeed < ConstantExt.ROAM_SPEED_30) {
roamSpeed = ConstantExt.ROAM_SPEED_30
}
mMapAutoView.getMapController()?.setRoamStyle(isUseTrace, roamDis, roamSpeed)
@@ -1262,19 +1302,17 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* @param travelList 轨迹路径
*/
fun setRoamTrajectory(travelList: ArrayList<LonLatPoint>?){
fun setRoamTrajectory(travelList: ArrayList<LonLatPoint>?) {
mMapAutoView.getClerk()?.add()
mMapAutoView.getMapController()?.setRoamTrajectory(travelList)
}
/**
* 设置锁车后的恢复时间
* @param time 等待时间
*/
fun setLockCarRecycleWaitTime(time: Long){
fun setLockCarRecycleWaitTime(time: Long) {
mMapAutoView.getClerk()?.add("$time")
mMapAutoView.getMapController()?.setWaitTime(time)
}
@@ -1282,7 +1320,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* 设置锁车状态
*/
fun setIsAutoLockCar(isLockCar: Boolean){
fun setIsAutoLockCar(isLockCar: Boolean) {
mMapAutoView.getClerk()?.add("$isLockCar")
mMapAutoView.getMapController()?.setIsAutoLockCar(isLockCar)
}
@@ -1290,15 +1328,15 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
/**
* 转换UTM坐标和经纬度坐标数据
*/
fun switchData(x: Double, y: Double, isWgs84: Boolean): DoubleArray?{
fun switchData(x: Double, y: Double, isWgs84: Boolean): DoubleArray? {
mMapAutoView.getClerk()?.add("$x,$y,$isWgs84")
return mMapAutoView.getMapController()?.switchData(x,y,isWgs84)
return mMapAutoView.getMapController()?.switchData(x, y, isWgs84)
}
/**
* 设置漫游模式
*/
fun setTransitionStyle(){
fun setTransitionStyle() {
mMapAutoView.getClerk()?.add()
setMapViewVisualAngle(MapAutoApi.MAP_STYLE_VR_TRANS)
}
@@ -1315,7 +1353,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 是否显示盲区
* @param visible true 显示 false 隐藏
*/
fun setDeadZoneVisible(visible: Boolean){
fun setDeadZoneVisible(visible: Boolean) {
mMapAutoView.getMapController()?.setDeadZoneVisible(visible)
}
@@ -1324,8 +1362,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置天气接口
* @param type 0:没有天气效果 1:雨天 2:雪天
*/
fun setWeatherType(type: String){
if (CompileConfig.DEBUG){
fun setWeatherType(type: String) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "setWeatherType:${type}")
}
mMapAutoView.getMapController()?.setWeatherType(type)
@@ -1335,8 +1373,8 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置是否启用天气渲染
* @param isEnable
*/
fun setWeatherEnable(isEnable: Boolean){
if (CompileConfig.DEBUG){
fun setWeatherEnable(isEnable: Boolean) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "setWeatherEnable:${isEnable}")
}
mMapAutoView.setWeatherEnable(isEnable)
@@ -1348,28 +1386,19 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param lat 纬度
* @param call 回调
*/
fun getWeatherInfo(lon: Double, lat: Double, call: WeatherResult){
if (CompileConfig.DEBUG){
fun getWeatherInfo(lon: Double, lat: Double, call: WeatherResult) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "getWeatherInfo:${lon},$lat")
}
mMapAutoView.getMapController()?.getWeatherInfo(lon,lat,call)
mMapAutoView.getMapController()?.getWeatherInfo(lon, lat, call)
}
/**
* 设置启用天空盒模式
*/
fun setSkyBoxMode(){
if (CompileConfig.DEBUG){
Log.i(TAG, "setSkyBoxMode")
}
mMapAutoView.getMapController()?.setSkyBoxMode()
}
/**
* 设置是否启用大雾
* @param isEnable
*/
fun setFogMode(isEnable: Boolean){
if (CompileConfig.DEBUG){
fun setFogMode(isEnable: Boolean) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "setFogMode")
}
mMapAutoView.getMapController()?.setFogMode(isEnable)
@@ -1382,7 +1411,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param width 宽度
* @param duration 动画时长
*/
fun setLightWave(list: List<LonLatPoint>, width: Double, duration: Double){
fun setLightWave(list: List<LonLatPoint>, width: Double, duration: Double) {
mMapAutoView.getMapController()?.setLightWave(list, width, duration)
}
@@ -1390,7 +1419,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置引导线
* @param list 引导线轨迹
*/
fun setGuideLine(list: List<LonLatPoint>?, drawEleLength:Float){
fun setGuideLine(list: List<LonLatPoint>?, drawEleLength: Float) {
mMapAutoView.getMapController()?.setGuideLine(list, drawEleLength)
}
@@ -1398,9 +1427,9 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置道路纹理带下
* @param size 纹理大小 取值范围?
*/
fun setRoadTexSize(size: Float){
fun setRoadTexSize(size: Float) {
mMapAutoView.getClerk()?.add("$size")
if (CompileConfig.DEBUG){
if (CompileConfig.DEBUG) {
Log.i(TAG, "setRoadTexSize")
}
mMapAutoView.getMapController()?.setRoadTexSize(size)
@@ -1410,9 +1439,9 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置是否启用纹理绘制路面
* @param isEnable
*/
fun setRoadUseTexture(isEnable: Boolean){
fun setRoadUseTexture(isEnable: Boolean) {
mMapAutoView.getClerk()?.add("$isEnable")
if (CompileConfig.DEBUG){
if (CompileConfig.DEBUG) {
Log.i(TAG, "setRoadUseTexture")
}
mMapAutoView.getMapController()?.setRoadUseTexture(isEnable)
@@ -1422,16 +1451,21 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置是否启用纹理绘制地面
* @param isEnable
*/
fun setPlaneUseTexture(isEnable: Boolean){
fun setPlaneUseTexture(isEnable: Boolean) {
mMapAutoView.getClerk()?.add("$isEnable")
if (CompileConfig.DEBUG){
if (CompileConfig.DEBUG) {
Log.i(TAG, "setPlaneUseTexture")
}
mMapAutoView.getMapController()?.setPlaneUseTexture(isEnable)
}
fun addImagetoImageManager(imageKey: String, imageByteArray: ByteArray, width: Int, height: Int):Int?{
fun addImagetoImageManager(
imageKey: String,
imageByteArray: ByteArray,
width: Int,
height: Int
): Int? {
return mMapAutoView.getMapController()?.addImage(
imageKey,
imageByteArray,
@@ -1439,6 +1473,7 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
height
)
}
/**
* 地图中心点周围模糊属性
* @param isEnable 是否开启
@@ -1447,7 +1482,13 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* @param endDis 结束距离
* @param density 密度
*/
fun setMapCenterBlur(isEnable: Boolean, color: String?, starDis: Float?, endDis: Float?, density: Float?) {
fun setMapCenterBlur(
isEnable: Boolean,
color: String?,
starDis: Float?,
endDis: Float?,
density: Float?
) {
mMapAutoView.getClerk()?.add("$isEnable,$color,$starDis,$endDis,$density")
mMapAutoView.getMapController()?.setMapCenterBlur(isEnable, color, starDis, endDis, density)
}
@@ -1457,8 +1498,30 @@ class MapAutoViewHelper(mapAutoView: MapAutoView) {
* 设置是否启用夜间路灯效果
* @param isEnable
*/
fun setStreetLightNightEffectIsEnable(isEnable: Boolean){
fun setStreetLightNightEffectIsEnable(isEnable: Boolean) {
mMapAutoView.getClerk()?.add("$isEnable")
mMapAutoView.getMapController()?.setStreetLightEffectIsEnable(isEnable)
}
/**
* 切换默认视角
*/
fun switchDefaultPerspective() {
if (CompileConfig.DEBUG) {
Log.i(TAG, "switchDefaultPerspective")
}
mMapAutoView.getMapController()?.setMapViewVisualAngle(mMapAutoView.getMapStyleParams()?.getVrAngleDefaultMode()?:MapStyleParams.MAP_STYLE_VR_ANGLE_MIDDLE)
}
/**
* 设置默认视角
*/
fun setDefaultPerspective(mode: Int) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "setDefaultPerspective: mode${mode}")
}
mMapAutoView.getMapStyleParams()?.setVrAngleDefaultMode(mode)
}
}

View File

@@ -46,6 +46,7 @@ class MapStyleParams: IMapStyleParams {
HDTypes.regional.type,
HDTypes.geometricLinear.type,
HDTypes.geometricSurface.type,
HDTypes.poi.type,
// HDTypes.TREE.type,
)
/**
@@ -56,7 +57,6 @@ class MapStyleParams: IMapStyleParams {
* const val MAP_STYLE_DAY_NAV = 3 //日间导航模式
* const val MAP_STYLE_NIGHT_NAV = 4 //夜间导航模式
*/
@Volatile
private var styleMode: Int = MapAutoApi.MAP_STYLE_NIGHT_VR
/**
@@ -98,7 +98,7 @@ class MapStyleParams: IMapStyleParams {
private var isSkyBoxEnable = false
// 是否开启天气
private var isWeatherEnable = true
private var isWeatherEnable = false
//是否使用光圈
private var isDisplayAnim = false