Android 谷歌地图气球覆盖覆盖项目

发布于 2024-08-31 09:18:36 字数 775 浏览 1 评论 0原文

我正在使用谷歌地图,在谷歌地图上显示覆盖项目。

为了创建气球效果,我使用自定义视图并使用地理点和 MapView.LayoutParams 将其显示在特定位置。

overrideitem 的图标和气球都具有相同的地理点,这就是为什么它们都相互覆盖的原因。

我想在覆盖项目图标上显示气球,看起来应该指向该图标。

以下是我的代码

MapView.LayoutParams mapParams = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT, mapEvent.getGeoPoint(), MapView.LayoutParams.BOTTOM_CENTER);

“替代文本”

我想像下面一样显示气球,请告诉我我应该减少经纬度以使其位于顶部吗?或者我应该更改布局 param.Bottom 或我尝试的不同变体无法像以下那样工作

替代文字

I am using google map, displaying overlayitems on the google map.

To create balloon effect, i am using customize view and using geopoints with MapView.LayoutParams to display it at particular location.

overlayitem's icon and baloon both having same geopoint thats why they both are overriding eatch other.

I want to display baloon over the overlayitem icon look like it should point to the icon.

Follwing is my code

MapView.LayoutParams mapParams = new MapView.LayoutParams(MapView.LayoutParams.WRAP_CONTENT, MapView.LayoutParams.WRAP_CONTENT, mapEvent.getGeoPoint(), MapView.LayoutParams.BOTTOM_CENTER);

alt text

I want to display baloon like following please tell me should i decrease lat long to make it top ? or should i change the layout param.Bottom or what i tried different variation not working like following

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文