mapbox / mapbox/MapboxGeocoder.swift

Placeholder Attributes Not Correctly Set

Offen
#159 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug
Vorherrschende Sprache
Swift
Sterne
133
Forks
46
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Beispiel für ForwardGeocodeOptions und geocoder.geocode für „Hong Kong,“ zu reproduzieren, und vergleiche dann die zurückgegebenen Ortsmarkierungen mit der Antwort des Geocoding API playground. Verfolge, wie die Forward-Geocoding-Antwort placemark.name, placemark.code, country.code und administrativeRegion.address befüllt; fertig ist die Aufgabe, wenn diese erwarteten Attribute nicht mehr nil sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
swift
Bereich
api, mobile-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.