地图模块适配

This commit is contained in:
jiaguofeng
2023-08-11 14:51:19 +08:00
parent 661816af8f
commit 74c0a81e68
30 changed files with 452 additions and 674 deletions

View File

@@ -52,7 +52,7 @@ dependencies {
implementation rootProject.ext.dependencies.androidxrecyclerview
implementation rootProject.ext.dependencies.androidxannotation
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.recyclerviewadapterhelper
// implementation rootProject.ext.dependencies.recyclerviewadapterhelper
implementation rootProject.ext.dependencies.retrofit
implementation rootProject.ext.dependencies.retrofitconvertergson
@@ -65,7 +65,7 @@ dependencies {
implementation 'com.zhidaoauto.map:net:1.0.1'
implementation 'com.zhidaoauto.machine:mapcore:3.0.0.4'
implementation 'com.zhidaoauto.machine:mapcore:3.0.0.5'
}

View File

@@ -1,6 +1,5 @@
package com.autonavi.nge;
import static com.amap.api.navi.AmapNaviPage.TAG;
import android.util.Log;
@@ -8,6 +7,7 @@ import com.zhidaoauto.map.sdk.inner.CompileConfig;
import com.zhidaoauto.map.sdk.inner.road.RoadResultController;
public class MapBox {
private static final String TAG = "MapBox";
static {
System.loadLibrary("map");
}

View File

@@ -1,58 +1,58 @@
package com.autonavi.nge.guidance
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.zhidaoauto.map.sdk.R
import com.zhidaoauto.map.sdk.inner.CompileConfig
import java.text.DecimalFormat
class RouteBookAdapter : BaseQuickAdapter<RouteBookItem, BaseViewHolder>(R.layout.routebook_child_item) {
private val TAG = javaClass.simpleName
override fun getDefItemCount(): Int {
return super.getDefItemCount()
}
override fun convert(helper: BaseViewHolder, item: RouteBookItem) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "routebookop--helper.adapterPosition:${helper.adapterPosition}")
}
when (helper.adapterPosition) {
0 -> {
helper.getView<LinearLayout>(R.id.routebook_child_item_info_ll).visibility = View.VISIBLE
helper.getView<ImageView>(R.id.imgView).setImageResource(NaviDirRes.getResID(501))
helper.getView<TextView>(R.id.orientation).text = "${item.routeName?:"起点"}出发"
helper.getView<TextView>(R.id.length).visibility = View.GONE
}
else -> {
helper.getView<TextView>(R.id.orientation).text = item.routeName
helper.getView<ImageView>(R.id.imgView).setImageResource(NaviDirRes.getResID(item.turnID))
if (item.routeName == "目的地") {
helper.getView<TextView>(R.id.length).visibility = View.GONE
} else {
helper.getView<TextView>(R.id.length).visibility = View.VISIBLE
val i = item.routelength
if (i > 1000) {
val df = DecimalFormat("#.0")
val string = df.format(i.toDouble() / 1000)
val strs = string.split(".")
if (strs.size >= 2 && strs[1] == "0") {
helper.getView<TextView>(R.id.length).text = """继续前行${strs[0]}km${item.routeSpeech}""".trimIndent()
} else {
helper.getView<TextView>(R.id.length).text = """继续前行${string}km${item.routeSpeech}""".trimIndent()
}
} else {
helper.getView<TextView>(R.id.length).text = """继续前行${i}m${item.routeSpeech}""".trimIndent()
}
}
}
}
}
}
//package com.autonavi.nge.guidance
//
//import android.util.Log
//import android.view.View
//import android.widget.ImageView
//import android.widget.LinearLayout
//import android.widget.TextView
//import com.chad.library.adapter.base.BaseQuickAdapter
//import com.chad.library.adapter.base.viewholder.BaseViewHolder
//import com.zhidaoauto.map.sdk.R
//import com.zhidaoauto.map.sdk.inner.CompileConfig
//import java.text.DecimalFormat
//
//class RouteBookAdapter : BaseQuickAdapter<RouteBookItem, BaseViewHolder>(R.layout.routebook_child_item) {
//
// private val TAG = javaClass.simpleName
//
//
// override fun getDefItemCount(): Int {
// return super.getDefItemCount()
// }
//
// override fun convert(helper: BaseViewHolder, item: RouteBookItem) {
// if (CompileConfig.DEBUG) {
// Log.i(TAG, "routebookop--helper.adapterPosition:${helper.adapterPosition}")
// }
// when (helper.adapterPosition) {
// 0 -> {
// helper.getView<LinearLayout>(R.id.routebook_child_item_info_ll).visibility = View.VISIBLE
// helper.getView<ImageView>(R.id.imgView).setImageResource(NaviDirRes.getResID(501))
// helper.getView<TextView>(R.id.orientation).text = "从${item.routeName?:"起点"}出发"
// helper.getView<TextView>(R.id.length).visibility = View.GONE
// }
// else -> {
// helper.getView<TextView>(R.id.orientation).text = item.routeName
// helper.getView<ImageView>(R.id.imgView).setImageResource(NaviDirRes.getResID(item.turnID))
// if (item.routeName == "目的地") {
// helper.getView<TextView>(R.id.length).visibility = View.GONE
// } else {
// helper.getView<TextView>(R.id.length).visibility = View.VISIBLE
// val i = item.routelength
// if (i > 1000) {
// val df = DecimalFormat("#.0")
// val string = df.format(i.toDouble() / 1000)
// val strs = string.split(".")
// if (strs.size >= 2 && strs[1] == "0") {
// helper.getView<TextView>(R.id.length).text = """继续前行${strs[0]}km${item.routeSpeech}""".trimIndent()
// } else {
// helper.getView<TextView>(R.id.length).text = """继续前行${string}km${item.routeSpeech}""".trimIndent()
// }
// } else {
// helper.getView<TextView>(R.id.length).text = """继续前行${i}m${item.routeSpeech}""".trimIndent()
// }
// }
// }
// }
// }
//}

View File

@@ -113,8 +113,8 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// 地图POI是否允许点击。
private var mPoiTouchEnable = true
private var viewWidth = 1920
private var viewHeight = 1040
private var mViewWidth = 1920
private var mViewHeight = 1040
var mLonLat: LonLat? = null
private val ZOOM_CHANGE = 0x7F
private val FOCUS_CHANGE = 0x9F
@@ -123,6 +123,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
private val RENDER_COMPLETE = 0x15F
private val LOAD_COMPLETE = 0x17F
private val RENDER_CHANGE = 0x19F
private val INIT_COMPLETE = 0x21F
private val LISTENER_TYPE_SCREEN = 0x5F
private val DELAY_TIME: Long = 500
private val VELOCITY_MEASURE: Float = 3000f
@@ -183,6 +184,13 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
// CommonController.instance.naviAutoView?.mNaviViewListener?.onNaviViewLoaded()
}
INIT_COMPLETE -> {
if (DEBUG) {
Log.i(TAG, "mapop--init complete-start")
}
mEventController?.dispatchMapLoadedInitListener()
}
else -> {
}
}
@@ -628,7 +636,7 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if(mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_NIGHT_VR || mMapStyleParams.getStyleMode() == MapAutoApi.MAP_STYLE_DAY_VR) {
mMapController?.setMapViewVisualAngle(mMapStyleParams.getDefaultPerspective())
}
mEventController?.dispatchMapLoadedInitListener()
mHandler.sendEmptyMessage(INIT_COMPLETE)
if(DEBUG){
Log.i(TAG, "mapop-surfaceop--onDrawFramethreadop:${Thread.currentThread().id}")
}
@@ -658,14 +666,14 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
if (DEBUG) {
Log.i(TAG, "mapop--surfaceop--resize:${width},${height}")
}
if (width == 0 || height == 0 || (viewWidth == width && viewHeight == height)) {
if (width == 0 || height == 0 || (mViewWidth == width && mViewHeight == height)) {
return
}
// gl.glViewport(0, 0, width, height)
viewWidth = width
viewHeight = height
MapTools.viewHeight = viewWidth
MapTools.viewWidth = viewHeight
mViewWidth = width
mViewHeight = height
MapTools.viewHeight = mViewWidth
MapTools.viewWidth = mViewHeight
if (DEBUG) {
Log.i(TAG, "mapop--surfaceop--resize:${width},${height}")
}
@@ -1129,6 +1137,14 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
return isTouchingFlag
}
override fun getViewWidth(): Int{
return mViewWidth
}
override fun getViewHeight(): Int{
return mViewHeight
}
override fun isCanZoom(): Boolean {
return isCanZoom
}
@@ -1232,10 +1248,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
mStylePath = path
}
override fun resizeP(w: Int, h: Int) {
mMapEngine.resize(w, h)
}
override fun renderP() {
mMapEngine.render()
}
@@ -1324,7 +1336,6 @@ class MapView(context: Context, private val mMapStyleParams: IMapStyleParams, pr
init {
System.loadLibrary("map")
System.loadLibrary("common")
}
init {

View File

@@ -18,8 +18,8 @@ interface IMapView {
fun isSurfaceCreated(): Boolean
fun isLoaded(): Boolean
fun isTouching(): Boolean
fun getWidth(): Int
fun getHeight(): Int
fun getViewWidth(): Int
fun getViewHeight(): Int
fun getTilt(): Float
@@ -27,8 +27,6 @@ interface IMapView {
fun unloadP()
fun resizeP(w: Int, h: Int)
fun renderP()
// fun renderLocationP(lon: Float, lat: Float, providerType: Int): Int

View File

@@ -29,7 +29,7 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
private val infoWindowClickListenerMap: MutableMap<String, OnInfoWindowClickListener> = HashMap<String, OnInfoWindowClickListener>()
private val animationListenerMap: MutableMap<String, OnAnimationListener> = HashMap<String, OnAnimationListener>()
private val markDragListenerMap: MutableMap<String, OnMarkerDragListener> = HashMap()
private val markerIconCacheMap = HashMap<Int,String>()
private val markerIconCacheMap = ConcurrentHashMap<Int,String>()
private val markerInfoCacheMap = ConcurrentHashMap<String,String>()
//点击infoview区域
@@ -329,12 +329,20 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
fun getRoateAngle(id: String?): Float {
val rotateAngle = getMarkerProperty(id!!, "rotateAngle")
return java.lang.Float.valueOf(rotateAngle)
return if (TextUtils.isEmpty(rotateAngle)) {
0f
} else {
rotateAngle.toFloat()
}
}
fun getDraggable(id: String?): Boolean {
val draggable = getMarkerProperty(id!!, "draggable")
return draggable!!.toBoolean()
return if (TextUtils.isEmpty(draggable)) {
false
} else {
draggable.toBoolean()
}
}
fun setPeriod(id: String?, period: Int) {
@@ -343,7 +351,11 @@ class MarkerNativeInterface(private val mMapController: IMapController): IMarker
fun getPeriod(id: String?): Int {
val period = getMarkerProperty(id!!, "period")
return period!!.toInt()
return if (TextUtils.isEmpty(period)) {
0
} else {
period.toInt()
}
}
fun showInfoWindow(id: String?) {

View File

@@ -26,7 +26,7 @@ class MapDataProvider : ContentProvider() {
if (CompileConfig.DEBUG) {
Log.i(TAG, "queryop MapDataProvider onCreate")
}
mMatcher.addURI(context.packageName+ConstantExt.AUTHORITY, ConstantExt.STR_QUERY, ConstantExt.CODE_QUERY)
mMatcher.addURI(context?.packageName+ConstantExt.AUTHORITY, ConstantExt.STR_QUERY, ConstantExt.CODE_QUERY)
return true
}

View File

@@ -25,7 +25,6 @@ import android.widget.TextView
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import com.autonavi.nge.guidance.RouteBook
import com.autonavi.nge.guidance.RouteBookAdapter
import com.autonavi.nge.obj.SubCategory
import com.autonavi.nge.routing.RoutingProvider
import com.zhidaoauto.map.sdk.R
@@ -288,7 +287,7 @@ object Constant {
Environment.MEDIA_MOUNTED
) {
mbExternalStorage = true
res = context.externalCacheDir.absolutePath +"/map/"
res = context.externalCacheDir?.absolutePath +"/map/"
// res = (Environment.getExternalStorageDirectory().absolutePath
// + "/Android/data/" + context.packageName+"/map/")
} else {
@@ -415,54 +414,6 @@ object Constant {
return viewDialog
}
@JvmStatic
fun getRouteBookDialog(act: Activity): Dialog {
val dialog = Dialog(act, R.style.Dialog_Fullscreen)
var routebook: RouteBook? = null
try {
// routebook = CommonController.instance.iNavigationCore?.Guidance_RouteBook(0, 0, 4)
} catch (e: RemoteException) {
e.printStackTrace()
}
val adapter = RouteBookAdapter()
val view = RecyclerView(act)
view.adapter = adapter
adapter.setDiffNewData(routebook?.bookdata)
// 线性布局
val layout = LinearLayout(act)
// 设置布局垂直方向
layout.orientation = LinearLayout.VERTICAL
val m_TextView = TextView(act)
m_TextView.layoutParams = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
m_TextView.setBackgroundColor(Color.BLACK)
m_TextView.textSize = 18f
m_TextView.setTextColor(Color.WHITE)
m_TextView.text = "距离:" + getDisString(routebook?.totalLength ?: 0) + " 时间:" + getTimeString(routebook?.totalTime ?: 0)
m_TextView.gravity = Gravity.CENTER_HORIZONTAL
m_TextView.setPadding(0, 10, 0, 20)
layout.addView(
m_TextView,
LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
)
layout.addView(
view,
LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT
)
)
dialog.setContentView(layout)
dialog.setOnCancelListener { dialog.dismiss() }
dialog.setOnKeyListener { paramDialogInterface, paramInt, paramKeyEvent -> false }
return dialog
}
fun getNaviDialog(act: Activity): Dialog {
val items =
arrayOf<CharSequence>("开始导航", "模拟导航", "路线详情", "导航设置", "语音设置")

View File

@@ -30,7 +30,7 @@ object FileUtils {
if (!mWorkingPath.exists()) {
mWorkingPath.mkdirs()
}
var files: Array<String>
var files: Array<String>?
try {
// 获得Assets文件夹下指定文件夹一共有多少文件
files = assetManager.list(assetDir);
@@ -225,7 +225,7 @@ object FileUtils {
val file = File(path)
for (dirFile in subDirFile) {
val secondList = assetManager.list("${assetDir}/${file.name}")
if (secondList.isNotEmpty() && dirFile.isDirectory && file.name.equals(dirFile.name)) {
if (secondList != null && secondList.isNotEmpty() && dirFile.isDirectory && file.name.equals(dirFile.name)) {
if (isSame(assetManager, "${assetDir}/${file.name}", dirFile.path)) {
count++
subDirFile.remove(dirFile)

View File

@@ -189,7 +189,7 @@ object Recorder {
} else {
val context:Context? = MapDataApi.getContext()
if(context != null){
context.externalCacheDir.absolutePath +"/map/$name"
context.externalCacheDir?.absolutePath +"/map/$name"
}else{
Environment.getExternalStorageDirectory().absolutePath + "/Android/data/map/$name"

View File

@@ -1,9 +1,6 @@
package com.zhidaoauto.map.sdk.inner.utils
import android.content.Context
import com.amap.api.location.CoordinateConverter
import com.amap.api.location.CoordinateConverter.CoordType
import com.amap.api.location.DPoint
import com.zhidaoauto.map.sdk.inner.abs.IMapController
import java.math.BigDecimal
@@ -201,41 +198,10 @@ object TransformUtils {
}
fun tempTrans(param:DoubleArray,context: Context?){
var doubleArrayParam = param
// System.out.println("origin:${doubleArrayParam.joinToString() }");
transform(doubleArrayParam,context)
// System.out.println("middle:${index},${if(index%2==0){"GPS:"}else{"GCJ:"}}--${doubleArrayParam.joinToString()}")
// System.out.println("result:${doubleArrayParam.joinToString()}")
}
fun transform(doubleArray: DoubleArray,context: Context?){
System.out.println("origin:${doubleArray.joinToString()}")
val point = gd_Transform(context, DPoint(doubleArray[1],doubleArray[0]))
val gdarray = doubleArrayOf(point.longitude,point.latitude)
System.out.println("gaode:${gdarray.joinToString()}")
val mogo = transformWgs84ToGcj02(doubleArray[1], doubleArray[0])
System.out.println("mogo:${mogo.joinToString()}")
val gaodetoOrigin = transformGcj02toWgs84(gdarray[1], gdarray[0])
System.out.println("gaode-to-origin:${gaodetoOrigin.joinToString()}")
val mogotoOrigin = transformGcj02toWgs84(mogo[1], mogo[0])
System.out.println("mogo-to-origin:${mogotoOrigin.joinToString()}")
}
fun gd_Transform(context: Context?,sourceLatLng:DPoint):DPoint{
val converter = CoordinateConverter(context)
// CoordType.GPS 待转换坐标类型
converter.from(CoordType.GPS)
// sourceLatLng待转换坐标点 LatLng类型
converter.coord(sourceLatLng)
// 执行转换操作
return converter.convert()
}
fun outOfScreen(context: Context, lon: Double, lat: Double,mapController: IMapController?): Boolean{
val displayMetrics = context.resources.getDisplayMetrics()

View File

@@ -113,32 +113,28 @@ object MapAutoApi {
CommonController.instance.init(context)
Recorder.i("common","$mapParams")
val customPath = context.filesDir.absolutePath
if (com.zhidaoauto.map.sdk.BuildConfig.ONLINE) {
if (TextUtils.isEmpty(mapParams.getStyleDir())) {
val stylePath = "${customPath}/shmdata/mogo_style"
mapParams.setStyleDir(stylePath)
MapStyleHelper.copyAssetsToSdcard(context, "style", stylePath)
}else{
MapStyleHelper.loadStyleOver.set(true)
}
if (!TextUtils.isEmpty(mapParams.getCachePath())) {
MapDataHelper.updateData(context, mapParams.getCachePath()!!)
}else{
MapDataHelper.updateData(context, CommonUtils.getCachePath(context))
}
if (TextUtils.isEmpty(mapParams.getStyleDir())) {
val stylePath = "${customPath}/shmdata/mogo_style"
mapParams.setStyleDir(stylePath)
MapStyleHelper.copyAssetsToSdcard(context, "style", stylePath)
}else{
MapStyleHelper.loadStyleOver.set(true)
}
if (!TextUtils.isEmpty(mapParams.getCachePath())) {
MapDataHelper.updateData(context, mapParams.getCachePath()!!)
}else{
MapDataHelper.updateData(context, CommonUtils.getCachePath(context))
}
if (com.zhidaoauto.map.sdk.BuildConfig.MODE == 3) {
// VR
if(mapParams.getDataFileSource() == 0){
MapHdDataHelper.initDataMgr(context)
}else if (TextUtils.isEmpty(mapParams.getHdmapPath())) {
mapParams.setHdmapPath("${customPath}/shmdata")
MapHdDataHelper.copyAssetsToSdcard(context, "hdmapData", "${customPath}/shmdata/hdmapData")
}else{
MapHdDataHelper.loadDataOver.set(true)
}
// VR
if(mapParams.getDataFileSource() == 0){
MapHdDataHelper.initDataMgr(context)
}else if (TextUtils.isEmpty(mapParams.getHdmapPath())) {
mapParams.setHdmapPath("${customPath}/shmdata")
MapHdDataHelper.copyAssetsToSdcard(context, "hdmapData", "${customPath}/shmdata/hdmapData")
}else{
MapHdDataHelper.loadDataOver.set(true)
}
MapHelper.init(mapParams)
}

View File

@@ -34,7 +34,7 @@ object MapDataApi {
return mContext
}
fun startZeus(context: Context) {
fun startZeus(context: Context?) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "mapop-start")
}

View File

@@ -4,6 +4,7 @@ import android.Manifest
import android.content.Context
import android.content.pm.PackageManager
import android.location.Criteria
import android.location.Location
import android.location.LocationManager
import android.os.Bundle
import android.text.TextUtils
@@ -243,7 +244,7 @@ class LocationClient : android.location.LocationListener {
}
//使用外部数据 coor是坐标系
fun setExtraGPSData(coor: Int, location: android.location.Location) {
fun setExtraGPSData(coor: Int, location: Location) {
if (!mIsUseExtraGPSData.get()) {
return
}
@@ -253,13 +254,13 @@ class LocationClient : android.location.LocationListener {
var localLocation = MogoLocation()
localLocation.lon = lon
localLocation.lat = lat
localLocation.provider = location.provider
localLocation.provider = location.provider?:"gps"
localLocation.speed = location.speed
localLocation.altitude = location.altitude
// mContext?.let {
// SharedPrefsMgr.getInstance(it).putString(ConstantExt.SHARED_KEY_LOCATION, JSON.toJSONString(location))
// }
optimizeLocation(localLocation, TextUtils.equals(location.provider, Constant.GPS_RTK),location.provider.contains("RTK"))
optimizeLocation(localLocation, TextUtils.equals(location.provider, Constant.GPS_RTK),location.provider?.contains("RTK")?:false)
}
//使用外部数据 coor是坐标系
@@ -273,7 +274,7 @@ class LocationClient : android.location.LocationListener {
optimizeLocation(location, TextUtils.equals(location.provider, Constant.GPS_RTK),location.provider.contains("RTK"))
}
override fun onLocationChanged(alocation: android.location.Location?) {
override fun onLocationChanged(alocation: Location) {
if (mIsUseExtraGPSData.get()) {
return;
}
@@ -304,10 +305,10 @@ class LocationClient : android.location.LocationListener {
override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
}
override fun onProviderEnabled(provider: String?) {
override fun onProviderEnabled(provider: String) {
}
override fun onProviderDisabled(provider: String?) {
override fun onProviderDisabled(provider: String) {
}

View File

@@ -12,9 +12,11 @@ import com.zhidaoauto.map.sdk.inner.abs.IMapController
import com.zhidaoauto.map.sdk.inner.abs.IMarkerController
import com.zhidaoauto.map.sdk.inner.utils.BitmapUtils
import com.zhidaoauto.map.sdk.inner.utils.Constants
import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
import com.zhidaoauto.map.sdk.open.marker.Marker
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions
import com.zhidaoauto.map.sdk.open.query.LonLatPoint
import java.util.concurrent.atomic.AtomicBoolean
class MyLocationStyle(private var mContext:Context?,private var mMarkerController: IMarkerController?,private var mMapController: IMapController?) {
val TAG = javaClass.simpleName
@@ -57,12 +59,12 @@ class MyLocationStyle(private var mContext:Context?,private var mMarkerControlle
// 3D夜间资源
var car3DResId: Int = R.raw.car
//执行标记
private var executeFlag:AtomicBoolean = AtomicBoolean()
var guangquanResId: Int = R.raw.guangquan
var locationPath: String? = null
//执行标记
private var executeFlag: AtomicBoolean = AtomicBoolean(false)
private var animWaitFrame = ANIM_WAIT_FRAME_NIGHT
private var animPeriod = ANIM_PERIOD_NIGHT
@@ -212,6 +214,9 @@ class MyLocationStyle(private var mContext:Context?,private var mMarkerControlle
fun setLonLat(lonLat: LonLat, angle: Double) {
mMapController?.getClerk()?.add("${lonLat.lon},${lonLat.lat},${angle}")
if(TransformUtils.outOfChina(lonLat.lat, lonLat.lon)){
return
}
if (CompileConfig.DEBUG) {
Log.i(TAG, "autoop--markerop---selfop-setLonLat-${lonLat},mMarker:${mMarker?.getId()}")
}
@@ -394,6 +399,7 @@ class MyLocationStyle(private var mContext:Context?,private var mMarkerControlle
}
fun exit() {
mMapController?.getClerk()?.add()
executeFlag.set(false)
mMarker?.remove()
mMarker?.destroy()
@@ -406,10 +412,11 @@ class MyLocationStyle(private var mContext:Context?,private var mMarkerControlle
}
if(mMarker == null){
executeFlag.set(true)
mMarker = MarkerHelper.addSelfCar(markerOptions)
mMarker = mMarkerController?.addSelfCar(markerOptions)
executeFlag.set(false)
}
}
}

View File

@@ -1,314 +0,0 @@
package com.zhidaoauto.map.sdk.open.location.sys
import android.Manifest
import android.annotation.SuppressLint
import android.app.Service
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.location.*
import android.os.Bundle
import android.provider.Settings
import android.util.Log
import android.widget.Toast
import androidx.core.app.ActivityCompat
import com.zhidaoauto.map.sdk.inner.CompileConfig
import java.io.IOException
import java.util.*
object LocationApi {
val TAG = javaClass.simpleName
var mLocationManager: LocationManager? = null
var mListener: OnLocationChangeListener? = null
var myLocationListener: LocationListener? = null
fun init(context: Context) {
var locationManager = context.getSystemService(Service.LOCATION_SERVICE) as LocationManager
val providerEnabled: Boolean = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
if (providerEnabled) {
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
return
}
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
0,
0.0f,
object : LocationListener {
override fun onLocationChanged(location: Location?) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "locationop-onLocationChanged-${location}")
}
}
override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
if (CompileConfig.DEBUG) {
Log.i(
TAG,
"locationop-onStatusChanged-provider:${provider},status:${status}"
)
}
}
override fun onProviderEnabled(provider: String?) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "locationop-onProviderEnabled-${provider}")
}
}
override fun onProviderDisabled(provider: String?) {
if (CompileConfig.DEBUG) {
Log.i(TAG, "locationop-onProviderDisabled-${provider}")
}
}
})
}
}
/**
* 判断Gps是否可用
*
* @return {@code true}: 是<br>{@code false}: 否
*/
fun isGpsEnabled(context: Context): Boolean {
var lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
return lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
}
/**
* 判断定位是否可用
*
* @return {@code true}: 是<br>{@code false}: 否
*/
fun isLocationEnabled(context: Context): Boolean {
var lm = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
return lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER) || lm.isProviderEnabled(
LocationManager.GPS_PROVIDER
)
}
/**
* 打开Gps设置界面
*/
fun openGpsSettings(context: Context) {
var intent = Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
}
/**
* 注册
* <p>使用完记得调用{@link #unregister()}</p>
* <p>需添加权限 {@code <uses-permission android:name="android.permission.INTERNET"/>}</p>
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>}</p>
* <p>需添加权限 {@code <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>}</p>
* <p>如果{@code minDistance}为0则通过{@code minTime}来定时更新;</p>
* <p>{@code minDistance}不为0则以{@code minDistance}为准;</p>
* <p>两者都为0则随时刷新。</p>
*
* @param minTime 位置信息更新周期(单位:毫秒)
* @param minDistance 位置变化最小距离:当位置距离变化超过此值时,将更新位置信息(单位:米)
* @param listener 位置刷新的回调接口
* @return {@code true}: 初始化成功<br>{@code false}: 初始化失败
*/
@SuppressLint("MissingPermission") fun register(
context: Context,
minTime: Long,
minDistance: Float,
listener: OnLocationChangeListener?
): Boolean {
if (CompileConfig.DEBUG) {
Log.e(TAG, "locationop-register")
}
if (listener == null)
return false
mLocationManager = context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
mListener = listener
if (!isLocationEnabled(context)) {
Toast.makeText(context, "无法定位,请打开定位服务", Toast.LENGTH_SHORT).show();
return false;
}
var provider = mLocationManager?.getBestProvider(getCriteria(), true);
var location = mLocationManager?.getLastKnownLocation(provider);
if (location != null) {
Log.i(TAG,"locationop-getLastKnownLocation-${location}")
listener.getLastKnownLocation(location);
}
myLocationListener = object : LocationListener {
override fun onLocationChanged(location: Location?) {
Log.i(TAG,"locationop-onLocationChanged-${location}")
mListener?.onLocationChanged(location)
}
override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) {
mListener?.onStatusChanged(provider, status, extras)
when (status) {
LocationProvider.AVAILABLE ->
if (CompileConfig.DEBUG) {
Log.e("onStatusChanged", "locationop-当前GPS状态为可见状态")
};
LocationProvider.OUT_OF_SERVICE ->
if (CompileConfig.DEBUG) {
Log.e("onStatusChanged", "locationop-当前GPS状态为服务区外状态")
}
LocationProvider.TEMPORARILY_UNAVAILABLE ->
if (CompileConfig.DEBUG) {
Log.e("onStatusChanged", "locationop-当前GPS状态为暂停服务状态")
};
}
}
override fun onProviderEnabled(provider: String?) {
}
override fun onProviderDisabled(provider: String?) {
}
}
mLocationManager?.requestLocationUpdates(
provider,
minTime,
minDistance,
myLocationListener
);
return true;
}
/**
* 注销
*/
fun unregister() {
if (mLocationManager != null) {
if (myLocationListener != null) {
mLocationManager?.removeUpdates(myLocationListener);
myLocationListener = null;
}
mLocationManager = null;
}
}
/**
* 设置定位参数
*
* @return {@link Criteria}
*/
fun getCriteria(): Criteria {
var criteria = Criteria()
//设置定位精确度 Criteria.ACCURACY_COARSE比较粗略Criteria.ACCURACY_FINE则比较精细
criteria.setAccuracy(Criteria.ACCURACY_FINE);
//设置是否要求速度
criteria.setSpeedRequired(true);
// 设置是否允许运营商收费
criteria.setCostAllowed(true);
//设置是否需要方位信息
criteria.setBearingRequired(true);
//设置是否需要海拔信息
criteria.setAltitudeRequired(true);
// 设置对电源的需求
criteria.setPowerRequirement(Criteria.POWER_HIGH);
return criteria;
}
/**
* 根据经纬度获取地理位置
*
* @param context 上下文
* @param latitude 纬度
* @param longitude 经度
* @return {@link Address}
*/
fun getAddress(context: Context, latitude: Double, longitude: Double): Address? {
var geocoder = Geocoder(context, Locale.getDefault());
try {
var addresses = geocoder.getFromLocation(latitude, longitude, 1)
if (addresses.size > 0)
return addresses.get(0);
} catch (e: IOException) {
e.printStackTrace();
}
return null
}
/**
* 根据经纬度获取所在国家
*
* @param context 上下文
* @param latitude 纬度
* @param longitude 经度
* @return 所在国家
*/
fun getCountryName(context: Context, latitude: Double, longitude: Double): String {
var address = getAddress(context, latitude, longitude);
address?.let {
return it.getCountryName()
}
return "unknown"
}
/**
* 根据经纬度获取所在地
*
* @param context 上下文
* @param latitude 纬度
* @param longitude 经度
* @return 所在地
*/
fun getLocality(context: Context, latitude: Double, longitude: Double): String {
var address = getAddress(context, latitude, longitude)
address?.let {
return it.getLocality()
}
return "unknown"
}
/**
* 根据经纬度获取所在街道
*
* @param context 上下文
* @param latitude 纬度
* @param longitude 经度
* @return 所在街道
*/
fun getStreet(context: Context, latitude: Double, longitude: Double): String {
var address = getAddress(context, latitude, longitude)
address?.let {
return it.getAddressLine(0)
}
return "unknown"
}
interface OnLocationChangeListener {
/**
* 获取最后一次保留的坐标
*
* @param location 坐标
*/
fun getLastKnownLocation(location: Location)
/**
* 当坐标改变时触发此函数如果Provider传进相同的坐标它就不会被触发
*
* @param location 坐标
*/
fun onLocationChanged(location: Location?)
/**
* provider的在可用、暂时不可用和无服务三个状态直接切换时触发此函数
*
* @param provider 提供者
* @param status 状态
* @param extras provider可选包
*/
fun onStatusChanged(provider: String?, status: Int, extras: Bundle?);//位置状态发生改变
}
}

View File

@@ -34,19 +34,22 @@ public class BitmapDescriptor : Parcelable, Cloneable {
}
public override fun clone(): BitmapDescriptor {
return try {
BitmapDescriptor(
Bitmap.createBitmap(bitmap),
width,
height
)
} catch (var3: Throwable) {
return BitmapDescriptor(
Bitmap.createBitmap(bitmap),
width,
height
)
bitmap?.let {
return try {
BitmapDescriptor(
Bitmap.createBitmap(it),
width,
height
)
} catch (var3: Throwable) {
return BitmapDescriptor(
Bitmap.createBitmap(it),
width,
height
)
}
}
return BitmapDescriptor(bitmap)
}
/**

View File

@@ -57,7 +57,7 @@ public class Marker(private var markerOptions: MarkerOptions,private var mMapCon
private var historyLocationList: ArrayList<LonLatPoint>? = null
private var mHandler: Handler = object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message?) {
override fun handleMessage(msg: Message) {
super.handleMessage(msg)
var type = msg?.arg1
var animation: Animation? = markerAnimationMap.get(type)

View File

@@ -12,6 +12,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicBoolean
class MarkerCacheController(private val mapAutoView: MapAutoView) {
@@ -19,7 +20,8 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
private var taskJob: Job? = null
var cacheInterval = 300
private var exit: Boolean = false
private var isExecuting: AtomicBoolean = AtomicBoolean()
//设置是否开启更新锚点策略,默认关闭
var delayStrategy: Boolean = false
@@ -53,7 +55,7 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
init {
lastPreTime = 0L
exit = false
isExecuting.set(false)
lastPreTime = 0L
}
@@ -119,7 +121,9 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
fun addCache(dataSet: MarkerDataSet?) {
if(taskJob == null){
execute()
if(!isExecuting.get()){
execute()
}
}
if (dataSet == null) {
return
@@ -155,7 +159,9 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
@Synchronized
fun addCache(originBatchData: MarkerBatchData?) {
if(taskJob == null){
execute()
if(!isExecuting.get()){
execute()
}
}
if (CompileConfig.DEBUG) {
Log.i(TAG, "addCache:life-start")
@@ -420,8 +426,8 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
}
fun destory() {
exit = true
taskJob?.cancel()
isExecuting.set(false)
taskJob = null
timeList.clear()
cacheMap.clear()
@@ -433,9 +439,10 @@ class MarkerCacheController(private val mapAutoView: MapAutoView) {
@Synchronized
private fun execute() {
isExecuting.set(true)
taskJob?.cancel()
taskJob = mapAutoView.getMapController()?.getDemaningScope()?.launch(Dispatchers.IO) {
while (!exit) {
while (isExecuting.get()) {
if (dataStrategy) {
if (!timeList.isEmpty() && !cacheMap.isEmpty()) {

View File

@@ -122,17 +122,23 @@ class TmcBarView : View {
////计算tmcBar在绘制过程中每一小段的长度
val itemHeight = Math.round(trafficStatus.getLength() * rateDistanceToViewHeight * 100.0f) * 0.01f
realDistanceSum += itemHeight
canvas.drawRect(0.0f, realDistanceSum - itemHeight, width.toFloat(), realDistanceSum, getPaintInColor(getColor(trafficStatus.getStatus())))
getPaintInColor(getColor(trafficStatus.getStatus()))?.let {
canvas.drawRect(0.0f, realDistanceSum - itemHeight, width.toFloat(), realDistanceSum, it)
}
--tmcBarLength
}
tmcBarLength = height + (mCarHeight shr 1)
//补全光柱图,使用颜色==第一段的颜色
if (realDistanceSum < tmcBarLength.toFloat()) {
canvas.drawRect(0.0f, realDistanceSum, width.toFloat(), tmcBarLength.toFloat(), getPaintInColor(getColor((mTmcBarItems!![0]).getStatus())))
getPaintInColor(getColor((mTmcBarItems!![0]).getStatus()))?.let {
canvas.drawRect(0.0f, realDistanceSum, width.toFloat(), tmcBarLength.toFloat(), it)
}
}
//补全光柱图,使用颜色==第一段的颜色
if (this.height.toFloat() > mCursorPos) {
canvas.drawRect(0.0f, mCursorPos + (mCarHeight shr 1).toFloat(), width.toFloat(), this.height.toFloat(), getPaintInColor(getColor(-1)))
getPaintInColor(getColor(-1))?.let {
canvas.drawRect(0.0f, mCursorPos + (mCarHeight shr 1).toFloat(), width.toFloat(), this.height.toFloat(), it)
}
}
if (mTmcBarListener != null) {
mTmcBarListener!!.dismissBottomTag()

View File

@@ -12,13 +12,13 @@ import kotlinx.android.synthetic.main.view_trafficbar.view.tmcBarTxt
import kotlinx.android.synthetic.main.view_trafficbar.view.tmcBarView
class TrafficProgressBar : FrameLayout {
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle) {
init()
}
constructor(context: Context?) : super(context) {
constructor(context: Context) : super(context) {
init()
}
constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
init()
}

View File

@@ -2,13 +2,16 @@ package com.zhidaoauto.map.sdk.open.tools
import android.content.Context
import android.util.Log
import android.widget.FrameLayout
import com.zhidaoauto.map.sdk.inner.CompileConfig
import com.zhidaoauto.map.sdk.open.view.MapAutoView
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.io.IOException
import kotlin.random.Random
class MonitorPressApi {
@@ -94,7 +97,7 @@ class MonitorPressApi {
TaskManager.instance.resetTask()
val rv = (Math.random() * 16).toInt()
val rv = (Math.random() * 17).toInt()
var trackIndex = (Math.random() * (mFiles!!.size - 1)).toInt()
if(CompileConfig.DEBUG){
Log.i(TAG, "onClick--randomop: rv:${rv},trackIndex:${trackIndex}")
@@ -152,6 +155,20 @@ class MonitorPressApi {
// TaskManager.instance.monitorMarkerAdd(trackIndex,mapAutoView)
TaskManager.instance.monitorCancleCacheHdData()
}
16 -> {
withContext(Dispatchers.Main){
val per = Random.nextDouble()
val layoutParams = mapAutoView.layoutParams as FrameLayout.LayoutParams
layoutParams.width = (2560 * per).toInt()
layoutParams.height = (1400 * per).toInt()
mapAutoView.layoutParams = layoutParams
if(CompileConfig.DEBUG){
Log.i(TAG, "resizeop:${layoutParams.width},${layoutParams.height}--${layoutParams}")
}
mapAutoView.postInvalidate()
}
}
else -> {
TaskManager.instance.monitor2DMarkerAdd(trackIndex,mapAutoView)

View File

@@ -230,7 +230,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
*/
private fun handlerInitMapView() {
//BuildConfig.MODE: 1.offline 2.online 3.VR
if (MapStyleHelper.loadStyleOver.get() && ((MapHdDataHelper.loadDataOver.get() && BuildConfig.MODE >= 3) || BuildConfig.MODE < 3)) {
if (MapStyleHelper.loadStyleOver.get() && MapHdDataHelper.loadDataOver.get()) {
initMapView()
} else {
mHandler.removeCallbacksAndMessages(MSG_MAP_INIT)
@@ -293,7 +293,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
fun initMapView() {
private fun initMapView() {
if (CompileConfig.DEBUG) {
Log.i(TAG, "autoop-mapop-initMapView--start")
}
@@ -363,7 +363,9 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
}
}
if(mogoLocation.lon == 0.0 || mogoLocation.lat == 0.0){
return
}
val lonLatPoint = LonLatPoint(mogoLocation.lon, mogoLocation.lat,mogoLocation.altitude,mogoLocation.heading)
lonLatPoint.provider = mogoLocation.provider
if (CompileConfig.DEBUG) {
@@ -388,7 +390,9 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
}
}
}
if(lonLatPoint.longitude == 0.0 || lonLatPoint.latitude == 0.0){
return
}
if(CompileConfig.DEBUG) {
Log.i(TAG, "autoop-locationop-lockop-onLocationChanged-location:${lonLatPoint}")
}

View File

@@ -51,8 +51,8 @@ dependencies {
implementation rootProject.ext.dependencies.arouter
kapt rootProject.ext.dependencies.aroutercompiler
// 高精地图
implementation rootProject.ext.dependencies.mogocustommap
// implementation project(':libraries:mapmodule')
// implementation rootProject.ext.dependencies.mogocustommap
implementation project(':libraries:mapmodule')
// 高德地图
// api rootProject.ext.dependencies.amaplocation
api rootProject.ext.dependencies.amapnavi3dmap

View File

@@ -62,6 +62,7 @@ import com.mogo.map.utils.MogoMapUtils;
import com.mogo.map.utils.ObjectUtils;
import com.mogo.map.utils.ResIdCache;
import com.zhidaoauto.map.sdk.open.MapAutoApi;
import com.zhidaoauto.map.sdk.open.abs.IResult;
import com.zhidaoauto.map.sdk.open.abs.MapStatusListener;
import com.zhidaoauto.map.sdk.open.abs.OnCameraChangeListener;
import com.zhidaoauto.map.sdk.open.abs.OnHdDataDownByCityListener;
@@ -83,11 +84,12 @@ import com.zhidaoauto.map.sdk.open.location.LocationClient;
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle;
import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory;
import com.zhidaoauto.map.sdk.open.marker.Marker;
import com.zhidaoauto.map.sdk.open.marker.MarkerHelper;
import com.zhidaoauto.map.sdk.open.marker.OnMarkClickListener;
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
import com.zhidaoauto.map.sdk.open.road.RoadCross;
import com.zhidaoauto.map.sdk.open.road.RoadRectInfos;
import com.zhidaoauto.map.sdk.open.road.StopLine;
import com.zhidaoauto.map.sdk.open.routeinfo.RoadInfo;
import com.zhidaoauto.map.sdk.open.tools.MapTools;
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
import com.zhidaoauto.map.sdk.open.view.MapAutoViewHelper;
@@ -136,7 +138,7 @@ public class AMapViewWrapper implements IMogoMapView,
private void initViews() {
// 初始化首次地图进入的时候的样式, MapAutoApi.INSTANCE.init(context, mapParams);将影响这里的数据
int mapStyle = MapAutoApi.INSTANCE.getMapParams().getStyleMode();
int mapStyle = mMapView.getMapStyleParams().getStyleMode();
CallerLogger.INSTANCE.d(M_MAP + TAG, "默认配置地图模式mapStyle=" + mapStyle);
switch (mapStyle) {
case MapAutoApi.MAP_STYLE_DAY:
@@ -197,7 +199,7 @@ public class AMapViewWrapper implements IMogoMapView,
mMapView.setOnRoamStatusListener(this);
mMapView.setOnMapViewVisualAngleChangeListener(this);
mMapView.setOnRoadInfoListener(this, 1);
MapAutoApi.INSTANCE.registerLogListener(this);
MapAutoApi.INSTANCE.registerLogListener(this,mMapView.getEventController());
CallerLogger.INSTANCE.d(M_MAP + TAG, "styleop - initListeners - setOnMapStyleListener - view " + mMapView);
}
@@ -225,14 +227,14 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onStopLineInfo(@androidx.annotation.Nullable StopLine stopLine) {
MogoLocation carLoc = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84();
if (stopLine != null && stopLine.road_id != null && !stopLine.road_id.isEmpty() && stopLine.points != null && stopLine.points.size() > 0) {
ArrayList<LonLatPoint> points = stopLine.points;
if (stopLine != null && stopLine.getRoad_id() != null && !stopLine.getRoad_id().isEmpty() && stopLine.getPoints() != null && stopLine.getPoints().size() > 0) {
ArrayList<LonLatPoint> points = stopLine.getPoints();
if (carLoc != null) {
// //CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo:stop_line" + stopLine + ", car_loc:{lon: " + carLoc.getLatitude() + ", lat: " + carLoc.getLongitude() + "}");
MapRoadInfo.StopLine stopInfo = convert(stopLine);
LonLatPoint p1 = points.get(0);
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;
double distanceOfCarToStopLine = MapDataApi.INSTANCE.getNearstFromPointToSegment(carLoc.getLongitude(), carLoc.getLatitude(), p1.getLongitude(), p1.getLatitude(), p2.getLongitude(), p2.getLatitude()) * 10_0000;
stopInfo.setDistanceOfCarToStopLine(distanceOfCarToStopLine);
//CallerLogger.INSTANCE.d(M_MAP + TAG, "onStopLineInfo: --- distance: " + distanceOfCarToStopLine);
CallerMapRoadListenerManager.INSTANCE.invokeListenersOnStopLineGet(stopInfo);
@@ -246,21 +248,21 @@ public class AMapViewWrapper implements IMogoMapView,
private MapRoadInfo.StopLine convert(StopLine line) {
MapRoadInfo.StopLine ret = new MapRoadInfo.StopLine();
ret.setDistance(line.distance);
ret.setLaneId(line.lane_id);
ret.setRoadId(line.road_id);
ret.setTieId(line.tile_id);
ArrayList<LonLatPoint> points = line.points;
ret.setDistance(line.getDistance());
ret.setLaneId(line.getLane_id());
ret.setRoadId(line.getRoad_id());
ret.setTieId(line.getTile_id());
ArrayList<LonLatPoint> points = line.getPoints();
if (points != null && points.size() > 0) {
List<MogoLatLng> newPoints = new ArrayList<>();
for (int i = 0; i < points.size(); i++) {
LonLatPoint lonLatPoint = points.get(i);
MogoLatLng latLng = new MogoLatLng(lonLatPoint.latitude, lonLatPoint.longitude);
latLng.duration = lonLatPoint.duration;
latLng.angle = lonLatPoint.angle;
latLng.speed = lonLatPoint.speed;
latLng.altitude = lonLatPoint.altitude;
latLng.provider = lonLatPoint.provider;
MogoLatLng latLng = new MogoLatLng(lonLatPoint.getLatitude(), lonLatPoint.getLongitude());
latLng.duration = lonLatPoint.getDuration();
latLng.angle = lonLatPoint.getAngle();
latLng.speed = lonLatPoint.getSpeed();
latLng.altitude = lonLatPoint.getAltitude();
latLng.provider = lonLatPoint.getProvider();
newPoints.add(latLng);
}
ret.setPoints(newPoints);
@@ -316,7 +318,7 @@ public class AMapViewWrapper implements IMogoMapView,
mMapView.setOnMapTouchListener(null);
mMapView.setOnMapClickListener(null);
mMapView.setOnCameraChangeListener(null);
MapAutoApi.INSTANCE.unregisterLogListener(this);
MapAutoApi.INSTANCE.unregisterLogListener(this,mMapView.getEventController());
CallerLogger.INSTANCE.d(M_MAP + TAG, "map onDestroy");
}
@@ -485,7 +487,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void initMyLocation() {
if (checkAMapView()) {
MarkerHelper.INSTANCE.addPreModel(R.raw.guangquan);
mMapView.getMarkerController().addPreModel(R.raw.guangquan);
// MarkerHelper.addPreModel(R.raw.guangquan_day)
mMapView.getMapAutoViewHelper().setMyLocationEnabled(true);
}
@@ -509,13 +511,13 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public MogoLatLng getCameraNorthEastPosition() {
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion().getRightTopPoint());
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion(mMapView.getMapController()).getRightTopPoint());
}
@Override
public MogoLatLng getCameraSouthWestPosition() {
try {
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion().getLeftBottomPoint());
return ObjectUtils.fromAMap(MapTools.INSTANCE.getVisibleRegion(mMapView.getMapController()).getLeftBottomPoint());
} catch (Exception e) {
e.printStackTrace();
}
@@ -549,7 +551,7 @@ public class AMapViewWrapper implements IMogoMapView,
public Point getLocationPointInScreen(MogoLatLng latLng) {
if (checkAMapView()) {
try {
return MapTools.INSTANCE.toScreenLocation(ObjectUtils.fromMogo(latLng));
return MapTools.INSTANCE.toScreenLocation(ObjectUtils.fromMogo(latLng),mMapView.getMapController());
} catch (Exception e) {
e.printStackTrace();
return null;
@@ -563,7 +565,7 @@ public class AMapViewWrapper implements IMogoMapView,
if (checkAMapView()) {
try {
return ObjectUtils.fromAMap(
MapTools.INSTANCE.fromScreenLocation(point));
MapTools.INSTANCE.fromScreenLocation(point,mMapView.getMapController()));
} catch (Exception e) {
e.printStackTrace();
return null;
@@ -701,15 +703,7 @@ public class AMapViewWrapper implements IMogoMapView,
return getMap().getUIController().getTileId(lon, lat);
}
@Override
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 result(@NonNull String filePath) {
@@ -917,10 +911,6 @@ public class AMapViewWrapper implements IMogoMapView,
return MapAutoApi.INSTANCE.getAngle(startLon, startLat, endLon, endLat);
}
@Override
public Double getRoadAngle(Double lon, Double lat, float angle) {
return MapDataApi.INSTANCE.getRoadRectInfo(lon, lat, angle).getAngle();
}
/**
* 加载3D模型
@@ -1023,7 +1013,7 @@ public class AMapViewWrapper implements IMogoMapView,
public void setIsDrawPointCloud(Boolean isDrawPointCloud) {
try {
// 是否绘制点云
PointCloudHelper.INSTANCE.setIsDrawPointCloud(isDrawPointCloud);
PointCloudHelper.INSTANCE.setIsDrawPointCloud(isDrawPointCloud,mMapView.getMapController());
} catch (Exception e) {
e.printStackTrace();
}
@@ -1032,13 +1022,13 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void setPointCloudSize(Float pointCloudSize) {
//设置点云大小
PointCloudHelper.INSTANCE.setPointCloudSize(pointCloudSize);
PointCloudHelper.INSTANCE.setPointCloudSize(pointCloudSize,mMapView.getMapController());
}
@Override
public void setPointCloudColor(String color) {
// 设置点云颜色
PointCloudHelper.INSTANCE.setPointCloudColor(color);
PointCloudHelper.INSTANCE.setPointCloudColor(color,mMapView.getMapController());
}
@Override
@@ -1130,14 +1120,20 @@ public class AMapViewWrapper implements IMogoMapView,
CallerLogger.INSTANCE.i(M_MAP + TAG, "gdCityCode is:" + gdCityCode);
Integer id = HDMapUtils.getHDCityCode(gdCityCode);
if (id != null) {
List<CityInfo> cityInfoList = mMapView.getMapAutoViewHelper().getAllCityCode();
if (cityInfoList != null) {
for (CityInfo cityInfo : cityInfoList) {
if (id == cityInfo.getCityCode()) {
return cityInfo.isCache;
//TODO 回调改造
mMapView.getMapAutoViewHelper().getAllCityCode(new IResult<ArrayList<CityInfo>>() {
@Override
public void result(int code, @androidx.annotation.Nullable ArrayList<CityInfo> cityInfoList) {
if (cityInfoList != null) {
for (CityInfo cityInfo : cityInfoList) {
if (id == cityInfo.getCityCode()) {
// return cityInfo.isCache();
}
}
}
}
}
});
}
}
return false;

View File

@@ -3,7 +3,9 @@ package com.mogo.map;
import android.annotation.SuppressLint;
import android.graphics.Point;
import android.util.Pair;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.map.center.CenterLine;
import com.mogo.map.overlay.proxy.line.IMapPolylineOverlay;
@@ -13,11 +15,11 @@ import com.mogo.map.road.RoadNameInfo;
import com.mogo.map.uicontroller.AMapUIController;
import com.mogo.map.uicontroller.IMogoMapUIController;
import com.mogo.map.utils.ObjectUtils;
import com.zhidaoauto.map.sdk.open.abs.IResult;
import com.zhidaoauto.map.sdk.open.data.MapDataApi;
import com.zhidaoauto.map.sdk.open.data.SinglePointRoadInfo;
import com.zhidaoauto.map.sdk.open.marker.BatchMarkerOptions;
import com.zhidaoauto.map.sdk.open.marker.Marker;
import com.zhidaoauto.map.sdk.open.marker.MarkerHelper;
import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
import com.zhidaoauto.map.sdk.open.poyline.Polyline;
@@ -87,7 +89,7 @@ public class AMapWrapper implements IMogoMap {
if (!checkAMap()) {
return null;
}
MarkerOptions markerOptions = ObjectUtils.fromMogo(options);
MarkerOptions markerOptions = ObjectUtils.fromMogo(options,mMapView);
if (markerOptions == null) {
CallerLogger.INSTANCE.e(TAG, "marker参数为空");
return null;
@@ -96,7 +98,7 @@ public class AMapWrapper implements IMogoMap {
if (delegate == null) {
return null;
}
return new AMapPointWrapper(options.getId(), delegate);
return new AMapPointWrapper(options.getId(), delegate,mMapView);
}
@Override
@@ -104,16 +106,16 @@ public class AMapWrapper implements IMogoMap {
if (!checkAMap()) {
return null;
}
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options);
PolylineOptions polylineOptions = ObjectUtils.fromMogo(options,mMapView);
if (polylineOptions == null) {
CallerLogger.INSTANCE.e(TAG, "polyline参数为空");
return null;
}
Polyline delegate = polylineOptions.lineWidth > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
Polyline delegate = polylineOptions.getLineWidth() > 0 ? mAMap.drawThickLine(polylineOptions) : mAMap.drawLine(polylineOptions);
if (delegate == null) {
return null;
}
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate);
return new com.mogo.map.overlay.wrapper.line.AMapPolylineWrapper(options.getId(), delegate,mMapView);
}
BatchMarkerOptions batchMarkerOptions = new BatchMarkerOptions();
@@ -138,13 +140,15 @@ public class AMapWrapper implements IMogoMap {
return;
}
long time = markerOptionsArrayList.get(0).getTime();
batchMarkerOptions.list = markerOptionsArrayList;
batchMarkerOptions.delayStrategy = false;
batchMarkerOptions.ruleAngle = 8.0f;
batchMarkerOptions.controlIcon = 1;
batchMarkerOptions.satelliteTime = time;
batchMarkerOptions.deleteRule = 0;
MarkerHelper.INSTANCE.updateBatchMarkerPositon(batchMarkerOptions);
batchMarkerOptions.setList(markerOptionsArrayList);
batchMarkerOptions.setDelayStrategy(false);
batchMarkerOptions.setRuleAngle(8.0f);
batchMarkerOptions.setControlIcon(1);
batchMarkerOptions.setSatelliteTime(time);
batchMarkerOptions.setDeleteRule(0);
if(mMapView.getMarkerController() != null){
mMapView.getMarkerController().updateBatchMarkerPositon(batchMarkerOptions);
}
}
BatchMarkerOptions aiBatchMarkerOptions = new BatchMarkerOptions();
@@ -170,19 +174,23 @@ public class AMapWrapper implements IMogoMap {
}
long time = markerOptionsArrayList.get(0).getTime();
// 最后一个参数,是否管理锚点的删除
aiBatchMarkerOptions.list = markerOptionsArrayList;
aiBatchMarkerOptions.delayStrategy = false;
aiBatchMarkerOptions.ruleAngle = 8.0f;
aiBatchMarkerOptions.controlIcon = 1;
aiBatchMarkerOptions.satelliteTime = time;
aiBatchMarkerOptions.deleteRule = 0;
MarkerHelper.INSTANCE.updateBatchMarkerPositon(aiBatchMarkerOptions);
aiBatchMarkerOptions.setList(markerOptionsArrayList);
aiBatchMarkerOptions.setDelayStrategy(false);
aiBatchMarkerOptions.setRuleAngle(8.0f);
aiBatchMarkerOptions.setControlIcon(1);
aiBatchMarkerOptions.setSatelliteTime(time);
aiBatchMarkerOptions.setDeleteRule(0);
if(mMapView.getMarkerController() != null) {
mMapView.getMarkerController().updateBatchMarkerPositon(aiBatchMarkerOptions);
}
}
@Override
public String addPreVehicleModel(int type, int modelRes) {
try {
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
if(mMapView.getMarkerController() != null){
return mMapView.getMarkerController().addPreVehicleModel(type, modelRes);
}
} catch (Exception e) {
e.printStackTrace();
}
@@ -192,7 +200,9 @@ public class AMapWrapper implements IMogoMap {
@Override
public void removeMarker(String uuidString) {
try {
MarkerHelper.INSTANCE.removeMarker(uuidString);
if(mMapView.getMarkerController() != null){
mMapView.getMarkerController().removeMarker(uuidString);
}
} catch (Exception e) {
e.printStackTrace();
}
@@ -215,7 +225,7 @@ public class AMapWrapper implements IMogoMap {
@Override
public void setPointToCenter(int x, int y) {
if (checkAMap()) {
LonLatPoint lonLatPoint = MapTools.INSTANCE.fromScreenLocation(new Point(x, y));
LonLatPoint lonLatPoint = MapTools.INSTANCE.fromScreenLocation(new Point(x, y), mMapView.getMapController());
mAMap.setCenter(lonLatPoint);
}
}
@@ -273,20 +283,7 @@ public class AMapWrapper implements IMogoMap {
return singlePointRoadInfo != null ? singlePointRoadInfo.getLaneWidth() : 0;
}
@Override
public CenterLine getCenterLineRangeInfo(double lon, double lat, float angle, float distance) {
try {
com.zhidaoauto.map.sdk.open.road.CenterLine info = MapDataApi.INSTANCE.getCenterLineRangeInfo(lon, lat, angle, distance);
CenterLine ret = null;
if (info != null) {
ret = new CenterLine(info.id, info.tile_id, info.road_id, info.lane_id, convert(info.points), info.angle == null ? 0f : info.angle);
}
return ret;
} catch (Throwable t) {
t.printStackTrace();
return null;
}
}
@Override
public RoadNameInfo getRoadName(double lon, double lat, float angle) {
@@ -298,14 +295,5 @@ public class AMapWrapper implements IMogoMap {
return null;
}
private List<Pair<Double, Double>> convert(List<LonLatPoint> points) {
if (points == null || points.isEmpty()) {
return Collections.emptyList();
}
List<Pair<Double, Double>> ret = new ArrayList<>(points.size());
for (LonLatPoint p : points) {
ret.add(Pair.create(p.longitude, p.latitude));
}
return ret;
}
}

View File

@@ -0,0 +1,126 @@
package com.mogo.map
import android.util.Pair
import com.mogo.eagle.core.data.map.CenterLine
import com.mogo.map.utils.ObjectUtils
import com.zhidaoauto.map.sdk.open.abs.IResult
import com.zhidaoauto.map.sdk.open.data.MapDataApi
import com.zhidaoauto.map.sdk.open.query.LonLatPoint
import com.zhidaoauto.map.sdk.open.road.RoadRectInfos
import com.zhidaoauto.map.sdk.open.routeinfo.RoadInfo
/**
* 地图数据工具
*/
object MapDataWrapper {
/**
* 获取车道中心线数据
* @param lon 经度
* @param lat 纬度
* @param angle 角度
* @param call 回调
*/
fun getCenterLineInfo(lon: Double, lat: Double, angle: Float,call:IResult<CenterLine>){
MapDataApi.getCenterLineInfo(
lon,
lat,
angle,
object : IResult<com.zhidaoauto.map.sdk.open.road.CenterLine> {
override fun result(
code: Int,
result: com.zhidaoauto.map.sdk.open.road.CenterLine?
) {
call.result(0,ObjectUtils.transformCenterLine(result))
}
})
}
/**
* 获取车道限速
* @param lon 经度
* @param lat 纬度
* @param angle 角度
* @param call 回调
*/
fun getLimitSpeed(lon: Double, lat: Double, angle: Float,call : IResult<Int>) {
MapDataApi.getLimitSpeed(lon, lat, angle, object : IResult<RoadInfo> {
override fun result(code: Int, result: RoadInfo?) {
call.result(code,result?.speed?:0)
}
})
}
/**
* 获取道路角度
* @param lon 经度
* @param lat 纬度
* @param angle 角度
* @param call 回调
*/
fun getRoadAngle(lon: Double, lat: Double, angle: Float,call : IResult<Double>) {
MapDataApi.getRoadRectInfo(lon, lat, angle, object : IResult<RoadRectInfos> {
override fun result(code: Int, result: RoadRectInfos?) {
call.result(code,result?.angle?:0.0)
}
})
}
/**
* 按距离获取道路数据
* @param lon 经度
* @param lat 纬度
* @param angle 角度
* @param call 回调
*/
fun getCenterLineRangeInfo(
lon: Double,
lat: Double,
angle: Float,
distance: Float,
call:IResult<com.mogo.map.center.CenterLine>
) {
try {
MapDataApi.getCenterLineRangeInfo(
lon,
lat,
angle,
distance,
object : IResult<com.zhidaoauto.map.sdk.open.road.CenterLine> {
override fun result(
code: Int,
info: com.zhidaoauto.map.sdk.open.road.CenterLine?
) {
var ret: com.mogo.map.center.CenterLine? = null
if (info != null) {
ret = com.mogo.map.center.CenterLine(
info.id,
info.tile_id,
info.road_id,
info.lane_id,
convert(info.points),
info.angle?:0.0
)
}
call.result(code,ret)
}
})
} catch (t: Throwable) {
t.printStackTrace()
}
}
private fun convert(points: List<LonLatPoint>?): List<Pair<Double, Double>> {
if (points == null || points.isEmpty()) {
return emptyList()
}
val ret: MutableList<Pair<Double, Double>> = ArrayList(points.size)
for (p in points) {
ret.add(Pair.create(p.longitude, p.latitude))
}
return ret
}
}

View File

@@ -4,9 +4,10 @@ import com.mogo.map.overlay.line.Polyline.Options
import com.mogo.map.overlay.proxy.line.*
import com.mogo.map.utils.ObjectUtils
import com.zhidaoauto.map.sdk.open.poyline.*
import com.zhidaoauto.map.sdk.open.view.MapAutoView
import java.util.concurrent.atomic.*
class AMapPolylineWrapper(private val id: String, private val delegate: Polyline): IMapPolylineOverlay {
class AMapPolylineWrapper(private val id: String, private val delegate: Polyline,private val mMapAutoView: MapAutoView): IMapPolylineOverlay {
private val isDestroyed by lazy { AtomicBoolean(false) }
@@ -63,7 +64,7 @@ class AMapPolylineWrapper(private val id: String, private val delegate: Polyline
return
}
delegate.also {
val option = ObjectUtils.fromMogo(options)
val option = ObjectUtils.fromMogo(options,mMapAutoView)
if (option != null) {
it.setOption(option)
}

View File

@@ -6,9 +6,10 @@ import com.mogo.map.overlay.proxy.point.*
import com.mogo.map.utils.ObjectUtils
import com.zhidaoauto.map.sdk.open.marker.*
import com.zhidaoauto.map.sdk.open.query.LonLatPoint
import com.zhidaoauto.map.sdk.open.view.MapAutoView
import java.util.concurrent.atomic.AtomicBoolean
class AMapPointWrapper(private val id: String, private val delegate: Marker): IMapPointOverlay {
class AMapPointWrapper(private val id: String, private val delegate: Marker, private val mMapAutoView: MapAutoView): IMapPointOverlay {
private val isDestroyed by lazy { AtomicBoolean(false) }
@@ -71,7 +72,7 @@ class AMapPointWrapper(private val id: String, private val delegate: Marker): IM
if (isDestroyed.get() || isRemoved.get()) {
return
}
delegate.setMarkerOptions(ObjectUtils.fromMogo(opt))
delegate.setMarkerOptions(ObjectUtils.fromMogo(opt,mMapAutoView))
}
override fun addDynamicAnchorPosition(point: MogoLatLng, angle: Float, duration: Long) {

View File

@@ -17,6 +17,7 @@ import com.zhidaoauto.map.sdk.open.marker.MarkerOptions;
import com.zhidaoauto.map.sdk.open.marker.MarkerSimpleData;
import com.zhidaoauto.map.sdk.open.poyline.PolylineOptions;
import com.zhidaoauto.map.sdk.open.query.LonLatPoint;
import com.zhidaoauto.map.sdk.open.view.MapAutoView;
import java.util.ArrayList;
import java.util.List;
@@ -32,7 +33,7 @@ import mogo.yycp.api.proto.SocketDownData;
*/
public class ObjectUtils {
public static MarkerOptions fromMogo(Point.Options opt) {
public static MarkerOptions fromMogo(Point.Options opt, MapAutoView mapAutoView) {
if (opt == null) {
return null;
@@ -49,15 +50,15 @@ public class ObjectUtils {
}
MarkerOptions markerOptions;
if(TextUtils.isEmpty(opt.getId())){
markerOptions = new MarkerOptions();
markerOptions = new MarkerOptions(mapAutoView.getMapController());
}else{
markerOptions = new MarkerOptions(opt.getId());
markerOptions = new MarkerOptions(opt.getId(),mapAutoView.getMapController());
}
markerOptions.setGps(opt.isGps())
.position(new LonLatPoint(opt.getLongitude(), opt.getLatitude()))
.anchor(opt.getU(), opt.getV())
.icons(descriptors)
.icons(descriptors,mapAutoView.getMapController())
.period(opt.getPeriod())
.controlAngle(opt.isControlAngle())
.rotateAngle(opt.getRotate())
@@ -84,10 +85,10 @@ public class ObjectUtils {
} else {
BitmapDescriptor descriptor = getBitmapDescriptorFromMogo(opt.getIcon(), opt.getIconView());
if (descriptor != null) {
markerOptions.markerIcon(descriptor);
markerOptions.markerIcon(descriptor,mapAutoView.getMapController());
}
if (opt.getIcon3DRes() != 0) {
markerOptions.marker3DIcon(opt.getIcon3DRes());
markerOptions.marker3DIcon(opt.getIcon3DRes(),mapAutoView.getMapController());
}
}
String title = opt.getTitle();
@@ -170,11 +171,11 @@ public class ObjectUtils {
return new MogoLatLng(point.getLatitude(), point.getLongitude());
}
public static PolylineOptions fromMogo(Polyline.Options options) {
public static PolylineOptions fromMogo(Polyline.Options options,MapAutoView mapAutoView) {
if (options == null) {
return null;
}
PolylineOptions target = new PolylineOptions();
PolylineOptions target = new PolylineOptions(mapAutoView.getMapController());
target.setGps(options.isUseGps());
if (options.getPoints() != null) {
List<LonLatPoint> points = new ArrayList<>();
@@ -193,15 +194,15 @@ public class ObjectUtils {
target.useFacade(options.getUseFacade());
target.setVisible(options.isVisible());
if (options.getMaxIndex() >= 0f) {
target.maxIndex = options.getMaxIndex();
target.maxIndex(options.getMaxIndex());
}
if (options.getColors() != null) {
target.colorValues(options.getColors());
}
if (options.isLightOn()) {
target.isBright = true;
target.brightColor = options.getLightColor();
target.brightSpeed = options.getLightSpeed();
target.setIsBright(true);
target.setBrightColor(options.getLightColor());
target.setBrightSpeed(options.getLightSpeed());
}
return target;
}
@@ -223,23 +224,23 @@ public class ObjectUtils {
CenterLine resultCenterLine = null;
if (centerLine != null) {
resultCenterLine = new CenterLine();
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);
resultCenterLine.setId(centerLine.getId());
resultCenterLine.setLane_id(centerLine.getLane_id());
resultCenterLine.setAngle(centerLine.getAngle());
resultCenterLine.setRoad_id(centerLine.getRoad_id());
resultCenterLine.setTile_id(centerLine.getTile_id());
ArrayList<com.mogo.eagle.core.data.map.LonLatPoint> arrayList = new ArrayList<>();
if (centerLine.points != null) {
for (com.zhidaoauto.map.sdk.open.query.LonLatPoint point : centerLine.points) {
if (centerLine.getPoints() != null) {
for (com.zhidaoauto.map.sdk.open.query.LonLatPoint point : centerLine.getPoints()) {
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);
lonLatPoint.setAltitude(point.getAltitude());
lonLatPoint.setAngle(point.getAngle());
lonLatPoint.setDistance(point.getDistance());
lonLatPoint.setLatitude(point.getLatitude());
lonLatPoint.setLongitude(point.getLongitude());
lonLatPoint.setProvider(point.getProvider());
lonLatPoint.setSpeed(point.getSpeed());
lonLatPoint.setDuration(point.getDuration());
arrayList.add(lonLatPoint);
}
resultCenterLine.setPoints(arrayList);