Commit 9c0bfa8f authored by fengruiyu's avatar fengruiyu

解决地图抖动的问题

parent c6c482c8
......@@ -133,7 +133,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
val center = LatLng(39.915071, 116.403907)
// 默认 11级
val zoom = 11.0f
builder.target(center).zoom(zoom)
builder.target(center).zoom(zoom)
val mapStatusUpdate = MapStatusUpdateFactory.newMapStatus(builder.build())
// 设置地图状态
......@@ -160,14 +160,14 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
currentLon = status?.target?.longitude?:0.0
mRecommendStopSearch?.requestRecommendStop(
RecommendStopSearchOption().location(
center
LatLng(currentLat,currentLat)
)
)
}
})
mBaiduMap?.setOnMapLoadedCallback {
mRecommendStopSearch?.requestRecommendStop(RecommendStopSearchOption().location(center))
mRecommendStopSearch?.requestRecommendStop(RecommendStopSearchOption().location( LatLng(currentLat,currentLat)))
}
//使地图缩放级别增大一级
binding.imageIn.setOnClickListener {
......@@ -183,7 +183,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding, HomeViewModel>(), SensorE
}
mRecommendStopSearch = RecommendStopSearch.newInstance()
mRecommendStopSearch?.setOnGetRecommendStopResultListener { result ->
result
if (result != null) {
addMarkerToMap(result.recommendStopInfoList)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment