How to check if an Google Maps InfoWindow is still displayed before updating it?

前端 未结 2 788
长发绾君心
长发绾君心 2021-02-04 18:16

I started working on an InfoWindowAdapter that is displaying location images inside the InfoWindow. I have a lot of different locations, therefore it is possible that an locatio

2条回答
  •  醉话见心
    2021-02-04 19:00

    Might Marker's boolean isInfoWindowShown() method be what you are looking for?

    Marker#isInfoWindowShown() - Google Maps Android API v2 documentation

    It can't help when the InfoWindow was scrolled away from, though, for that, I think, you'll probably have to convert Marker's LatLng coordinates to screen coordinates or use this to check whether the marker is still on screen:

    How to get Latitude/Longitude span in Google Map V2 for Android

    I'm not sure whether it's possible at all to check if the window itself is still in map view bounds or not.

提交回复
热议问题