Hide markers info window in android google maps API v2

前端 未结 2 1892
花落未央
花落未央 2021-02-07 04:07

Currently I was able to view all my markers in Google maps using Android Google maps API v2.

Adding my marker in map:

mapView.addMarker         


        
2条回答
  •  生来不讨喜
    2021-02-07 04:27

    If you use clusters, write so:

    private var clusterManager: ClusterManager? = null
    
    override fun onMapReady(googleMap: GoogleMap) {
        this.googleMap = googleMap
    
        clusterManager = ClusterManager(context!!, googleMap)
        ... // Other clusterManager and clusterRenderer initializations.
    
        clusterManager!!.setOnClusterItemClickListener { item ->
            // selectMarker(item)
            true // false, if you want to show InfoWindow.
        }
    }
    

提交回复
热议问题