Android的 - 谷歌地图API第2版 - 禁用变焦控制变焦、地图、Android、API

2023-09-05 05:22:16 作者:如初

我如何禁用放大按钮上的谷歌地图?

How do I disable the Zoom In button on the Google Map?

我试图寻找这样的命令: map.getUiSettings()。setZoomControlsEnabled(真)... SOMETHING ,但什么都不存在。

I tried looking for commands like: map.getUiSettings().setZoomControlsEnabled(true)...SOMETHING but nothing exists.

我要离开创造我自己的按钮放大作为最后的手段。

I want to leave creating my own buttons for zooming as a last resort.

更新:我要澄清,我只是想要停止的放大按钮,而不是整个变焦控制

UPDATE: I should clarify, I only want to disable the Zoom In button, not the whole Zoom Control.

推荐答案

的设置,您使用的是正确的,但要禁用它,应该是假的。

the setting you used is right, but to disable it, it should be false.

map.getUiSettings().setZoomControlsEnabled(false);

希望我把你的问题的权利。

hope I got your question right..

修改

不幸的是,你不能隐藏一个变焦按钮,你可以做的就是隐藏这两个按钮,并创建自己的自定义缩放控制,并将其放置在你的地图上。

Unfortunately, you can't hide one zoom buttons, what you can do is hide both buttons and create your own custom zoom control and place them on the your map.