| | |
| | | //设置是否在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 |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | 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()) |
| | | //设置折线的属性 |
| | |
| | | .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?) { |