简体   繁体   English

如何在Android中的Google Maps上显示InfoWindow for Circle

[英]How to show infoWindow for Circle on Google Maps in android

I want to display circles at specific locations on google maps whose radius will be defined at runtime depending on some value. 我想在Google地图上的特定位置显示圆,其半径将在运行时取决于某些值来定义。

I could add the circle on map using : 我可以使用以下方法在地图上添加圆圈:

Circle circle = map.addCircle(new CircleOptions()
         .center(result)
         .radius(Double.parseDouble(size)*100)
         .strokeColor(Color.RED)
         .fillColor(Color.BLUE)
         );

When i click on this circle, i need to display an infoWindow same as the one that appears in case of Markers (ie setting titles and snippets for each one of them and displaying on clicking it). 当我单击该圆圈时,我需要显示一个与出现Markers相同的信息infoWindow (即titles and snippets为每个Markers设置titles and snippets并在单击时显示)。

How to achieve this? 如何实现呢?

Add a Marker with 0x0 px icon at the same position as Circle. 在与圆形相同的位置添加带有0x0像素图标的标记。

When user clicks close enough to the center, info window will show for you. 当用户单击距离中心足够近的位置时,将显示信息窗口。

You still have to handle case when user clicks far from the center using OnMapClickListener and calling marker.showInfoWindow(). 当用户使用OnMapClickListener并调用marker.showInfoWindow()远离中心单击时,您仍然必须处理情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Maps Android V2:如何平移地图以显示InfoWindow - Google maps android V2: how to pan map to show InfoWindow Google Maps Android-如何访问默认信息窗口? - Google Maps Android — How access default infowindow? Java Android AlertDialogs在Infowindow OnClick for Google Maps v2上显示 - Java Android AlertDialogs Show on infowindow OnClick for google maps v2 Android Maps Utils Clustering 显示 InfoWindow - Android Maps Utils Clustering show InfoWindow 使用Android中的谷歌地图自定义信息窗口上的动画 - Animation on custom infowindow using google maps in Android Android-如何在Google地图上显示imageView? - Android - How to show a imageView on google maps? 如何在Android Apk应用程序上显示Google地图? - How to show the google maps on Android Apk Application? Google Maps Android v2-检测标记InfoWindow关闭 - Google Maps Android v2 - Detecting Marker InfoWindow Close Android Java 谷歌地图 api v2 :: 如何检查标记在谷歌地图上的圆圈内 android api v2 - Android Java google maps api v2:: how check with markers are within a circle on google maps android api v2 如何用图像中的蓝色半透明替换我的Android应用程序谷歌地图半径圆圈? - How do I replace my android app Google maps radius circle with a blue translucent one as in image?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM