mapbox / mapbox/MapboxGeocoder.swift
Expected fields do not always appear in the MBGeocodedPlacemark
Nessuno ha ancora preso questa issue.
- Lingua principale
- Swift
- Stelle
- 133
- Fork
- 46
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Using v0.10.0.
If I reverse geocode a point in the water of the San Francisco Bay, "California" does not appear as an administrativeRegion on the MBGeocodedPlacemark. If I print the addressDictionary of the placemark, I see that the name is California, but it is not placed under the state key.
Sample code:
CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37.763778227711242, -122.32790567148118);
MBGeocoder *geocoder = [[MBGeocoder alloc] initWithAccessToken:<token>];
MBReverseGeocodeOptions *options = [[MBReverseGeocodeOptions alloc] initWithCoordinate:coordinate];
[geocoder geocodeWithOptions:options completionHandler:^(NSArray<MBGeocodedPlacemark *> * _Nullable placemarks, NSString * _Nullable attribution, NSError * _Nullable error) {
NSLog(@"%@", [placemarks[0] addressDictionary]);
}];
Output:
{
ISOCountryCode = US;
country = "United States";
formattedAddressLines = (
"United States"
);
name = California;
}
This makes it challenging to properly format and display reverse geocode data that is powered by a dynamic location at run time. If I reverse geocode a location that has a street address, it likely has a state field.
Below is the addressDictionary of a reverse geocode coordinate in downtown San Francisco. The state is now there. (37.794291209161685, -122.412848997168)
{
ISOCountryCode = US;
city = "San Francisco";
country = "United States";
formattedAddressLines = (
"1187 Washington Street",
"San Francisco",
"California 94108",
"United States"
);
name = "Washington Street";
postalCode = 94108;
state = California;
street = "Washington Street";
subAdministrativeArea = "San Francisco";
subLocality = "Nob Hill";
subThoroughfare = 1187;
thoroughfare = "Washington Street";
}
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con il flusso geocodeWithOptions:completionHandler: di MBGeocoder e con l'addressDictionary di MBGeocodedPlacemark mostrato nel report. Confronta le coordinate di San Francisco Bay e del centro città, quindi verifica che le informazioni previste di administrativeRegion/state siano esposte in modo coerente per i placemarks geocodificati inversamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- objective-c, swift
- Ambito
- api, mobile-dev
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100