Android版谷歌地图上的弹出式菜单按钮 [英] android google maps button on popup

查看:320
本文介绍了Android版谷歌地图上的弹出式菜单按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧。我至今是一个Android应用程序与谷歌地图上,我已经放在了一堆图标,点击时,创建一个与它的一些文本的弹出窗口。有什么办法放置在该弹出按钮?如果这是不可能的,是有一些方法,使当选择在谷歌地图图标的按钮出现?

Okay. What I have so far is an Android app with a Google map on which I've placed a bunch of icons that, when clicked on, create a popup with some text on it. Is there any way to place a button on that popup? If this is not possible, is there some way to make a button appear when an icon on Google Maps is selected?

如果你想知道,在code我用现在看起来是这样。

In case you're wondering, the code I'm using now looks like this.

itemizedOverlay.addOverlay(new OverlayItem(point, title, text));
//actually a whole bunch of OverlayItems, each with their own location and text
//but this is the general shape of it.
mapOverlays.add(itemizedOverlay);


编辑:

有不同种类的应用程序的GoogleMaps的不同版本(检查自己在模拟器版本)使用弹出窗口。第一弹起简单显示位置的标题(Android的2.3.3)。

There are different kinds of popups used with different versions (check yourself in the emulator versions) of the GoogleMaps app. The first popup simple displays the title of the location (Android 2.3.3).

第二个弹出窗口显示的标题和箭头指示。 (Android版4.0.3)

The second popup shows the title and arrow indicator. (Android 4.0.3)

足够有趣:我注意到,无论是弹出窗口的点击并启动另一项活动,显示有关位置的详细信息。

Interesting enough: I noticed that both popups are clickable and start another activity that shows details about the location.

推荐答案

mapviewballon 项目的 https://github.com/jgilfelt/android-mapviewballoons/ 允许您使用自己的自定义布局这些弹出。

The mapviewballon project https://github.com/jgilfelt/android-mapviewballoons/ allows you to use your own custom layout for these popup.

我没有上的按钮进行测试,但我不明白为什么我是行不通的。

I did not test with buttons on it but I do not see why I would not work.

该示例项目显示了以下类型的弹出气球。

The example projects shows the following types of popup balloons.

这篇关于Android版谷歌地图上的弹出式菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆