从android中的气球中删除覆盖窗口
我想在单击地图视图后隐藏叠加项目窗口弹出窗口。目前,当我单击气球时,会弹出窗口。如果我点击其他气球,则先前的气球弹出窗口会隐藏,并且新的弹出窗口会出现在该气球上。这是正确的。但我有一个问题来隐藏地图视图点击/触摸上的弹出窗口。请分享解决方案。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要解决这个问题,首先您必须在 MapActivity 中获取静态变量。
例如 public static isMapRefreshed = false;
然后转到 BalloonItemizedOverlay 类,那里有一个绘制方法。
在那里编写以下代码来解决这个问题。
私人 BalloonOverlayView 气球视图;
如果(UsersNearMe.isMapRefreshed){
隐藏气球();
}
私人无效 hideBalloon() {
if (balloonView!= null) {
bubbleView.setVisibility(View.GONE);
}
在 MapView ClickListener 上,
将 isMapRefreshed 的静态值更改为 true。然后点击将 isMapRefreshed 的静态值更改为 false
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