Results 1 to 2 of 2

Thread: [iOS 3.0.3] currentStreetName empty while OSM knows it (didChangeCurrentStreetName)

  1. #1
    Erfahrener skobbler
    Join Date
    11.02.2015
    Posts
    123

    [iOS 3.0.3] currentStreetName empty while OSM knows it (didChangeCurrentStreetName)

    The currentStreetname in the didChangeCurrentStreetName delegate method of SKNavigationDelegate is often empty, while the street is known to OSM (for a long time). This seems to happen a lot with highways for example. I imagine it's because they don't have names but numbers. In that case it would be better to pass the number in stead of an empty string. Attached a screenshot giving some examples.
    image003.jpg

  2. #2
    Erfahrener skobbler
    Join Date
    11.02.2015
    Posts
    123
    As a workaround I now implemented below function, which shows that OSM and the SDK does know the street name, but it's not passing it in the callback. Try it with coordinate: 38.443446, 91.047521. callback return empty.... reverse geo returns US 50.
    Code:
        func getStreetnameReverseGeo() -> String {
            var streetName = "Streetname Unknown"
            if let searchResult = SKReverseGeocoderService.sharedInstance().reverseGeocodeLocation(lastKnownLocation.coordinate) {
                print("search result found")
                if searchResult.type == .street && searchResult.name != nil && searchResult.name!.isNotEmptyOrWhiteSpace() {
                    streetName = searchResult.name!
                }
                else {
                    if let parentSearchResults = searchResult.parentSearchResults as? [SKSearchResult] {
                        for sr in parentSearchResults {
                            print(sr)
                            if sr.type == .street && sr.name != nil && sr.name!.isNotEmptyOrWhiteSpace() {
                                streetName = sr.name!
                                break
                            }
                        }
                    }
                }
            }
            print(streetName)
            return streetName
        }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •