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

前端 未结 8 594
故里飘歌
故里飘歌 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:34

    --> It shows multiple infoWindows without tapping on marker. You can easily customise it.

    for i in 0..

            let dict = arrNearByPlacesArray.object(at: i) as? NSDictionary ?? [:]
    
            let lat = dict.object(forKey: "latitude") as? String ?? ""
             let long = dict.object(forKey: "longitude") as? String ?? ""
            let company_id = dict.object(forKey: "company_id") as? String ?? ""
            let totaljobs = dict.object(forKey: "totaljobs") as? String ?? ""
    
    
            let location = CLLocationCoordinate2D(latitude: Double(lat) ?? 0.0, longitude: Double(long) ?? 0.0)
            print("location: \(location)")
            let marker = GMSMarker()
            //marker.icon = UIImage(named: "maps")
    
            let viewData = Bundle.main.loadNibNamed("MarkerXibView", owner: self, options: nil)?.first as! MarkerXibView .      //UIView
    
    
            marker.iconView = viewData .      //UIView
    
    
            marker.position = location
            marker.accessibilityLabel  = company_id
            marker.map = vwGoogleMap
    

    }

提交回复
热议问题