How to show a Info window in iOS Google maps without tapping on Marker?

前端 未结 8 562
故里飘歌
故里飘歌 2020-12-05 07:14

I am new to iOS development. This is regarding Marker info window in Google Maps iOS SDK.

I understand, we can create a marker with info window using GMSMarkerOption

相关标签:
8条回答
  • 2020-12-05 07:56

    mMapView.selectedMarker = marker

    0 讨论(0)
  • 2020-12-05 07:57

    Swift 3.0

    func addMarker(_ location:CLLocation){
            var locationMarker: GMSMarker!
            if locationMarker != nil {
                locationMarker.map = nil
            }
            locationMarker = GMSMarker(position: location.coordinate)
            locationMarker.map = mapView
            locationMarker.appearAnimation = kGMSMarkerAnimationPop
            locationMarker.icon = GMSMarker.markerImage(with: UIColor.green)
            locationMarker.opacity = 0.85
            locationMarker.isFlat = true
            locationMarker.snippet = "My Location"
            mapView.selectedMarker=locationMarker
    
        }
    

    below line is the answer

    mapView.selectedMarker=locationMarker
    
    0 讨论(0)
提交回复
热议问题