簡體   English   中英

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

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

我想在Google地圖上的特定位置顯示圓,其半徑將在運行時取決於某些值來定義。

我可以使用以下方法在地圖上添加圓圈:

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

當我單擊該圓圈時,我需要顯示一個與出現Markers相同的信息infoWindow (即titles and snippets為每個Markers設置titles and snippets並在單擊時顯示)。

如何實現呢?

在與圓形相同的位置添加帶有0x0像素圖標的標記。

當用戶單擊距離中心足夠近的位置時,將顯示信息窗口。

當用戶使用OnMapClickListener並調用marker.showInfoWindow()遠離中心單擊時,您仍然必須處理情況。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM