重新绘制定位
mBaiDuMap = map_order_selection.map
mBaiDuMap!!.isTrafficEnabled = false
mBaiDuMap!!.isMyLocationEnabled = true
val mLocationConifg = MyLocationConfiguration(
MyLocationConfiguration.LocationMode.FOLLOWING,
true,
BitmapDescriptorFactory.fromResource(R.drawable.gm_blue_30)
)
mBaiDuMap!!.setMyLocationConfiguration(mLocationConifg)
var cenpt: LatLng? = null
if (DataMessageVo.mDataLatlng == null) {
cenpt = LatLng(34.797049, 114.341447)
} else
DataMessageVo.mDataLatlng?.let {
if (it.latitude == 0.0 || it.longitude == 0.0) {
cenpt = LatLng(34.797049, 114.341447)
} else {
cenpt = LatLng(it.latitude, it.longitude)
}
}
val mapStatus = MapStatus.Builder()
.target(cenpt)
.zoom(18f)
.build()
val newMapStatus = MapStatusUpdateFactory.newMapStatus(mapStatus)
// mBaiDuMap!!.setMapStatus(MapStatusUpdateFactory.zoomTo(19f))
mBaiDuMap!!.setMapStatus(newMapStatus)
val u = MapStatusUpdateFactory.newLatLng(LatLng(mLat, mLng))
baiud.setMapStatus(u)
网友评论