Hide markers info window in android google maps API v2

前端 未结 2 1893
花落未央
花落未央 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:19
    return true;
    

    from onMarkerClick to disable default behavior of showing info window and centering on the marker.

    0 讨论(0)
  • 2021-02-07 04:27

    If you use clusters, write so:

    private var clusterManager: ClusterManager<SomeClusterItem>? = 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.
        }
    }
    
    0 讨论(0)
提交回复
热议问题