在Google Maps iOS API中创建虚线折线时无法解析的标识符

Mar*_*s K 3 xcode google-maps ios swift

我正在尝试Polyline根据我在此处找到的代码(第三个答案)创建一个点。我想出了这个:

        // route
        let path = GMSMutablePath()
        // populate path with coordinates here 
        // ...
        let route = GMSPolyline(path: path)
        route.strokeWidth = 3.0
        let styles = [GMSStrokeStyle.solidColor(UIColor(red: 0.945, green: 0.392, blue: 0.278, alpha: 1.0)), GMSStrokeStyle.solidColor(UIColor.clearColor())]
        let lengths = [10,10]
        route.spans = GMSStyleSpans(route.path!, styles, lengths, kGMSLengthRhumb);
        route.map = m_map_view
Run Code Online (Sandbox Code Playgroud)

unresolved identifier但是,我得到一个错误,因为kGMSLengthRhumb在我的系统中没有将其标识为某个有效常量。我正在使用Swift 2.0。

kGMSLengthRhumb我在哪里或应该放在哪里?

小智 5

kGMSLengthRhumb 应该替换为 GMSLengthKind.rhumb