ios - Google map GMSMaker iconView - iOS SDK

标签 ios swift xcode google-maps google-maps-api-3

错误:

value of type GMSmarker has no member iconView

如何使用 iconView?

        let marker = GMSMarker()
        marker.position = CLLocationCoordinate2D(latitude: 13.7990609, longitude: 100.5494513)
        marker.title = "Coffee Factory"
        marker.snippet = "Chatuchak"
        marker.iconView = imageView
        marker.map = mapView

Value of type GMSmarker has no member iconView

最佳答案

确保您使用的是最新的 Google Maps SDK v2.3.0 及更高版本。

试试这个:

    marker.icon = UIImage(named: "<Your Image>")

编辑:

或者您可以将UIImageView设置为iconView

    marker.iconView = UIImageView(image: UIImage(named: "<Your Image>"))

输出:

Screen shot

希望有帮助。

关于ios - Google map GMSMaker iconView - iOS SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44361534/

相关文章:

ios - Xamarin 中缺少 ios 选项

ios - Reskit - 在同一个线程而不是 UI 线程上回调

ios - 为什么在页面 View Controller 中使用 KVO 进行观察时应用程序崩溃?以及如何使 KVO 生效?

html - 来自 html 的 NSAttributedstring 没有挂起 UI 线程

ios - Core Motion Swift 关闭问题

file-type - 无法让 "Open in MyApp"在我的 iOS 应用程序中处理 PNG 或 JPG 邮件附件

ios - 在手指下移动 View

ios - Firebase 按日期对数据排序

ios - 请将嵌入式目标的主机目标添加到 Podfile

ios - 从特定时间开始嵌入 youtube 视频