信息窗口(谷歌地图)捕捉关闭窗口的事件
当被关闭信息窗口什么是你的触发操作方式?
我找不到任何监听器。我在想运行一些背景的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的Android,还有对应于标记的信息窗口的关闭没有直接的监听器。但是你可以通过检查下面的事件将作为理由关闭信息窗口实现您的应用程序所需要的功能,
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,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,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.