1

I disable zoom controls on Google Maps:

map:uiZoomControls="false"

and now I want to create my own zoom/unzoom buttons. Is this possible? And if it is, how is it done?

I hate to ask a question without showing any research effort but I really can't find a single thing about custom buttons. I read the whole Google Maps API documentation and there is no information on this whatsoever.

Could anyone point me in the right direction? Is this even possible since there's no info on it in official docs? I don't want to change the position of default buttons, I want to disable them and actually make my own buttons.

4

2 回答 2

2

这可能吗?

当然。

如果是,它是如何完成的?

第 1 步:将ButtonImageButton或其他任何内容添加到您的 UI。

步骤#2:单击按钮时,使用CameraUpdate.

我讨厌在没有任何研究努力的情况下提出问题,但我真的找不到关于自定义按钮的任何内容。

关于小部件及其子类的使用有相当多的文档Button

于 2013-11-10T23:15:04.300 回答
1

您应该使用 mapView.getController().zoomIn() 和 mapView.getController().zoomOut()。它为您提供像谷歌地图默认缩放控件一样的动画缩放,而且您不需要自己处理缩放级别。

于 2013-11-11T05:16:28.300 回答