【发布时间】:2017-05-02 08:43:56
【问题描述】:
在我的应用中,我使用 GoogleMap (play-services-maps:10.2.1)。我已将地图的位置固定在特定位置,并且我不希望我的用户能够移动地图。我只希望他能够放大它。
这是我尝试过的:
// Set position
LatLng requestedPosition = new LatLng(lat, lon);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(requestedPosition, zoom));
// Disable all Ui interaction except for zoom
map.getUiSettings().setAllGesturesEnabled(false);
map.getUiSettings().setZoomGesturesEnabled(true);
乍一看它似乎可以工作,但实际上在缩放和取消缩放时,相机位置在每次缩放移动时都会发生一些变化。
我不知道该怎么办。
感谢您的帮助
【问题讨论】:
标签: android google-maps google-maps-android-api-2