0
votes

I have a custom info window with a favorites button, When clicked I would want the button to display a different favorites image indicating to the user that the waypoint is now on the users favorites. I dont know how to refresh the info window, everywhere I look on the internet they say to use marker.showInfoWindow(); however this does not work when running the app on my phone and plus documentation for google maps says:

Note about refreshing an info window: The onInfoWindowClose() event fires if the user refreshes an info window by tapping a marker that already has an open info window. But if you programmatically call Marker.showInfoWindow() on an open info window, the onInfoWindowClose() event does not fire. The latter behavior is based on the assumption that you are aware that the info window will close and re-open.

I see other apps having content that updates in their apps so I know its possible I just don't know what sort of work around they are doing to get around this. Does anyone have a way to work around this? And im very new to all of this so please dumb down your answer. Thanks in advance for your efforts.

1
huh no one knows how to do this? - rapid3642

1 Answers

1
votes

When you tap on marker pass that marker object to your favorite web service method and when you get success from web-service response just write below lines of code:

if (marker != null && marker.isInfoWindowShown()) {
                                marker.hideInfoWindow();
                                marker.showInfoWindow();
                            }