[3.4.0-map-sdk] wait to finish
This commit is contained in:
@@ -9,7 +9,6 @@ import com.autonavi.nge.map.MapView
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IEventController
|
||||
import com.zhidaoauto.map.sdk.inner.abs.IMarkerController
|
||||
import com.zhidaoauto.map.sdk.inner.common.CommonHelper
|
||||
import com.zhidaoauto.map.sdk.inner.common.ConstantExt
|
||||
import com.zhidaoauto.map.sdk.inner.common.MapHelper
|
||||
@@ -25,16 +24,15 @@ import com.zhidaoauto.map.sdk.inner.utils.MathUtils
|
||||
import com.zhidaoauto.map.sdk.inner.utils.Recorder
|
||||
import com.zhidaoauto.map.sdk.inner.utils.TransformUtils
|
||||
import com.zhidaoauto.map.sdk.open.abs.log.ILog
|
||||
import com.zhidaoauto.map.sdk.open.abs.marker.InfoWindowAdapter
|
||||
import com.zhidaoauto.map.sdk.open.abs.navi.INaviResult
|
||||
import com.zhidaoauto.map.sdk.open.data.MapDataApi
|
||||
import com.zhidaoauto.map.sdk.open.location.MyLocationStyle
|
||||
import com.zhidaoauto.map.sdk.open.navi.NaviModel
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import io.netty.buffer.Unpooled
|
||||
import java.math.BigDecimal
|
||||
import java.nio.charset.Charset
|
||||
import kotlin.math.pow
|
||||
|
||||
|
||||
object MapAutoApi {
|
||||
@@ -180,8 +178,7 @@ object MapAutoApi {
|
||||
// Convert the longitude and latitude to Morton code
|
||||
val code = toMortonCode(lon, lat)
|
||||
// Calculate the tile ID based on the Morton code and the tile level
|
||||
val tileId = getTileIdByMortonCode(code, level)
|
||||
return tileId
|
||||
return getTileIdByMortonCode(code, level)
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +293,7 @@ object MapAutoApi {
|
||||
|
||||
private fun getTileIdByMortonCode(mortonCode:Long, level:Int):Long {
|
||||
val left = ((mortonCode shr (2 * (31 - level))) and 0xffffffff)
|
||||
val right = (Math.pow(2.0,(16.0 + level)).toLong())
|
||||
val right = (2.0.pow((16.0 + level)).toLong())
|
||||
// println("tile:$left,$right")
|
||||
return (left +right)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zhidaoauto.map.sdk.open.view
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
@@ -10,7 +11,6 @@ import android.widget.FrameLayout
|
||||
import com.autonavi.nge.map.*
|
||||
import com.zhidao.map.net.api.Result
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
import com.zhidaoauto.map.sdk.BuildConfig
|
||||
import com.zhidaoauto.map.sdk.R
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig
|
||||
import com.zhidaoauto.map.sdk.inner.abs.*
|
||||
@@ -124,7 +124,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
private val weatherRepository by lazy { WeatherRepository() }
|
||||
private var isFirstInit = true
|
||||
|
||||
constructor(context: Context) : super(context) {
|
||||
constructor(context: Context) : super(context) {
|
||||
initView()
|
||||
}
|
||||
|
||||
@@ -151,8 +151,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
init(context)
|
||||
}
|
||||
|
||||
|
||||
fun obtainMapStyleParams(context: Context, attrs: AttributeSet?){
|
||||
private fun obtainMapStyleParams(context: Context, attrs: AttributeSet?){
|
||||
// 获取自定义属性值
|
||||
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.MapAutoView)
|
||||
var zoom = typedArray.getInt(R.styleable.MapAutoView_zoom, 20)
|
||||
@@ -412,7 +411,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
mHandler.sendMessage(msg)
|
||||
}
|
||||
} else {
|
||||
var lonLat = LonLat(lonLatPoint.longitude, lonLatPoint.latitude)
|
||||
val lonLat = LonLat(lonLatPoint.longitude, lonLatPoint.latitude)
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "autoop---locationop-lockop-centerop--elseop-setLonLat:${lonLat},${lonLatPoint.angle}")
|
||||
}
|
||||
@@ -474,7 +473,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
}
|
||||
|
||||
|
||||
private val mHandler = object : Handler() {
|
||||
private val mHandler = @SuppressLint("HandlerLeak")
|
||||
object : Handler() {
|
||||
override fun handleMessage(msg: Message) {
|
||||
when (msg.what) {
|
||||
MSG_MAP_INIT -> {
|
||||
@@ -549,7 +549,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
mLocationLon = lonLatPoint.longitude
|
||||
mLocationAlt = lonLatPoint.altitude.toFloat()
|
||||
mLocationHeading = lonLatPoint.angle
|
||||
var heading = lonLatPoint.angle
|
||||
val heading = lonLatPoint.angle
|
||||
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.i(TAG, "autoop--centerop--lockcarop:-start:${lonLatPoint}")
|
||||
@@ -882,15 +882,15 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
if(mEventController == null){
|
||||
mEventController = MapEventController()
|
||||
}
|
||||
onRoadInfoListener?.let {
|
||||
onRoadInfoListener.let {
|
||||
mEventController?.addRoadInfoListener(it)
|
||||
}
|
||||
if(intervalTime == 0L){
|
||||
mIntervalTimeRoadInfo = if(intervalTime == 0L){
|
||||
return
|
||||
}else if(intervalTime < 1000){
|
||||
mIntervalTimeRoadInfo = 1000
|
||||
1000
|
||||
}else {
|
||||
mIntervalTimeRoadInfo = intervalTime
|
||||
intervalTime
|
||||
}
|
||||
|
||||
}
|
||||
@@ -978,9 +978,8 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
}
|
||||
}
|
||||
|
||||
override fun getCurrentLonLatPoint(): LonLatPoint{
|
||||
var lonLatPoint = LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
|
||||
return lonLatPoint
|
||||
override fun getCurrentLonLatPoint(): LonLatPoint {
|
||||
return LonLatPoint(mLocationLon, mLocationLat, mLocationAlt.toDouble(), mLocationHeading)
|
||||
}
|
||||
|
||||
fun setWeatherEnable(isEnable: Boolean){
|
||||
@@ -1003,7 +1002,7 @@ open class MapAutoView : FrameLayout, LonLatPointListener, ITraffic,ILockLocatio
|
||||
if (MapDataApi.isRightLonLat(mLocationLon, mLocationLat)) {
|
||||
val result = weatherRepository.getInfo(mLocationLon, mLocationLat)
|
||||
if (CompileConfig.DEBUG) {
|
||||
Log.d(TAG, "getWeatherInfo--result: ${result}")
|
||||
Log.d(TAG, "getWeatherInfo--result: $result")
|
||||
}
|
||||
|
||||
if (result is Result.Success) {
|
||||
|
||||
Reference in New Issue
Block a user