【发布时间】:2014-02-23 15:24:15
【问题描述】:
是否有允许为MapFragment的不同边缘指定默认填充值的函数,即类似于
CameraUpdateFactory.newLatLngBounds(LatLngBounds bounds, int padding)
已经存在,但是类似于
CameraUpdateFactory.newLatLngBounds(LatLngBounds bounds, int paddingTop, int paddingLeft, int paddingBottom, int paddingRight)?
为什么我需要这个:在我的 MapFragment 顶部有一个半透明层。因此,我需要在顶部比底部更宽的填充。
我发现了类似的问题:Offseting the center of the MapFragment for an animation moving both the target lat/lng and the zoom level。但是,在我的情况下,获得 X 像素的投影和滚动是不够的,因为我不仅想滚动(平移)。我使用带有 newLatLngBounds(bounds, padding) 的 CameraUpdate,它应该 both 缩放 和 平移。所以在相机更新之前我有一个不同的投影。
希望我把问题说清楚了!
【问题讨论】:
-
您是否尝试过使用
GoogleMap.setPadding? -
就是这样,谢谢!!我应该更仔细地阅读文档;)请作为答案发布,以便我接受...
标签: android google-maps google-maps-android-api-2