信息窗口(谷歌地图)捕捉关闭窗口的事件 [英] infoWindow (Google Maps) catching an event of closing the window

查看:1853
本文介绍了信息窗口(谷歌地图)捕捉关闭窗口的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当被关闭信息窗口什么是你的触发操作方式?
我找不到任何监听器。我在想运行一些背景的Runnable
检查是否marker.isInfoWindowShown()。

What's your ways of triggering action when infowindow is being closed? I can't find any listeners for that. I was thinking about running some background Runnable checking if marker.isInfoWindowShown().

我希望做什么 - 显示按钮在我的地图,当用户点击点(信息窗口出现),但也对屏幕的底部此按钮。当信息窗口自败,​​按钮也不再可见。

What I wish to do - display button over my map, when user clicks point (infoWindow appears), there's also this button on the bottom of the screen. When infoWindow dissapears, the button is also no longer visible.

任何提示我应该读哪些听众?

Any hints which listeners I should read about?

推荐答案

目前在谷歌地图API的Andr​​oid,还有对应于标记的信息窗口的关闭没有直接的监听器。但是你可以通过检查下面的事件将作为理由关闭信息窗口实现您的应用程序所需要的功能,

Currently in google maps android api, there is no direct listener corresponding to the closing of a marker's infowindow. But you can achieve the required functionality in your app, by checking for the below events that would act as the reasons for closing an infowindow:

1,<一href=\"https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/GoogleMap.OnMapClickListener\">GoogleMap.OnMapClickListener :当用户点击地图上的任何当前可见的信息窗口将被关闭。所以,你可以在这个监听器添加一个逻辑,当信息窗口被关闭执行所需的功能。

1, GoogleMap.OnMapClickListener : When a user taps on the map, any currently visible infowindow will be closed. So you can add a logic in this listener for executing the functionality required when infowindow is closed

2,<一href=\"https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Marker#hideInfoWindow%28%29\">marker.hideInfoWindow ():另一个原因是信息窗口将被关闭,如果你调用一个标记的方法hideinfowindow会。如果调用此方法,那么你应该调用此方法后立即补充信息窗口时关闭,所需的功能。

2, marker.hideInfoWindow () : Another reason why an infowindow will be closed will be if you call the hideinfowindow method on a marker. If you call this method, then you should add the functionality required when infowindow is closed, immediately after calling this method.

这篇关于信息窗口(谷歌地图)捕捉关闭窗口的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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