Remove overlay window from the ballon in android

612 Views Asked by At

I want to hide the overlay item window popup after click on the mapview. Currently when i click on the balloon then popup window comes. if i tap on other ballon then previous ballon pop up window hide and new pop up window comes on that ballon. this is correct. But I have a problem to hide that pop up on the mapview click/Touch. Please share the solution.

1

There are 1 best solutions below

0
On BEST ANSWER

To resolve this firstly you have to take static variable in the MapActivity.

e.g public static isMapRefreshed = false;

Then goto BalloonItemizedOverlay class there is a draw method there. write following code there to resolve this.

private BalloonOverlayView balloonView;

if(UsersNearMe.isMapRefreshed){ hideBalloon(); }

private void hideBalloon() { if (balloonView != null) { balloonView.setVisibility(View.GONE); } }

on mapview clicklistener change the static value for the isMapRefreshed to true. and on tap change the static value for the isMapRefreshed to false