lmw
2025-04-14 0361f47762f9958f2ec91fdb62bfc98de4e162a6
app/src/main/java/com/xianning/driver/base/gaode/AMapKit.kt
@@ -41,11 +41,12 @@
        //设置是否在stop的时候杀死这个进程,默认(建议)不杀死,即setIgnoreKillProcess(true)
        option.SetIgnoreCacheException(false);
        option.setIsNeedAddress(true)
        //可选,默认gcj02,设置返回的定位结果坐标系,如果配合百度地图使用,建议设置为bd09ll;
        option.setCoorType("bd09ll")
        //可选,设置是否收集Crash信息,默认收集,即参数为false
        mLocationClient?.setLocOption(option)
        mLocationClient?.registerLocationListener(lisener)
        mLocationClient?.start()
        return mLocationClient
    }
@@ -79,7 +80,7 @@
    }
    fun drawLine(context: Context, aMap: BaiduMap, points: List<LatLng>?): Overlay {
    fun drawLine(context: Context, aMap: BaiduMap, points: List<LatLng>?): Overlay? {
        val latLngs: MutableList<LatLng> = ArrayList()
        latLngs.addAll(points?: arrayListOf())
        //设置折线的属性
@@ -89,12 +90,14 @@
            .points(latLngs)
        //在地图上绘制折线
        //mPloyline 折线对象
        return aMap.addOverlay(mOverlayOptions)
        if (aMap!=null)
            return aMap.addOverlay(mOverlayOptions)
        return null
    }
    fun moveCamera(aMap: BaiduMap, latlng: LatLng) {
        val mapStatusUpdate = MapStatusUpdateFactory.newLatLng(latlng)
        aMap.animateMapStatus(mapStatusUpdate,16)
        aMap.animateMapStatus(mapStatusUpdate,8)
    }
    fun moveCamera(aMap: BaiduMap, start: LatLng?, end: LatLng?) {