3

I'm trying to create a dotted Polyline based on the code I found here - third answer. I came up with this:

        // 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

I get a unresolved identifier error though, as kGMSLengthRhumb is not identified as some valid constant in my system. I am using Swift 2.0.

Where is kGMSLengthRhumb or what should I put instead there?

Community
  • 1
  • 1
Marinos K
  • 1,779
  • 16
  • 39
  • http://stackoverflow.com/questions/23143292/how-to-find-the-length-of-google-maps-path ? – Larme Apr 06 '17 at 21:21
  • Possible duplicate of [How to find the length of Google Maps Path](http://stackoverflow.com/questions/23143292/how-to-find-the-length-of-google-maps-path) – Larme Apr 07 '17 at 09:47

1 Answers1

6

kGMSLengthRhumb should be replaced with GMSLengthKind.rhumb

Josh
  • 103
  • 1
  • 6
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/low-quality-posts/17266240) – blueberryfields Sep 07 '17 at 20:23
  • The question was, "Where is kGMSLengthRhumb or what should I put instead there?". This explicitly answers the questions that does not require clarification from the asker. @blueberryfields – Josh Sep 08 '17 at 20:47
  • Please explain why the replacement is correct - ie., was kGMSLengthRhumb correct at some point but has at some point changed? Also, please future proof this answer - for example, provide a link to the relevant documentation, so, in the future when this might become invalid again, readers will be able to find the corrected/updated version on their own from this answer – blueberryfields Sep 08 '17 at 21:03