Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder Attributes Not Correctly Set #159

Open
riastrad opened this issue Sep 18, 2018 · 0 comments
Open

Placeholder Attributes Not Correctly Set #159

riastrad opened this issue Sep 18, 2018 · 0 comments
Labels

Comments

@riastrad
Copy link

Description

When making a forward Geocoding request, all the placemarks in the response should have their usual attributes (i.e. the attributes included in a vanilla cURL request to the Geocoding API). However, for some reason there are placemark attributes that are not being set.

Here's an example request:

        let options = ForwardGeocodeOptions(query: "Hong Kong")
        options.allowedScopes = [.place, .locality]
        options.maximumResultCount = 5
        geocodingDataTask = geocoder.geocode(options) { [unowned self] (placemarks, attribution, error) in
            if let error = error {
                NSLog("%@", error)
            } else if let placemarks = placemarks, !placemarks.isEmpty {
                for placemark in placemarks {
                    print(placemark.name)
                    print(placemark.code)
                    print(placemark.country?.code)
                    print(placemark.administrativeRegion?.address)
                }
            } else {
                self.resultsLabel.text = "No results"
            }
        }

Expected

In the Geocoding API playground, the result of a query with the same parameters includes "short_code" which should be the placemark.code value that is printed in the above code block.

screen shot 2018-09-18 at 2 40 42 pm

Actual

When the above code block is run, all but placemark.name return nil values:

Hong Kong
nil
nil
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant