mapbox / mapbox/MapboxGeocoder.swift
Expected fields do not always appear in the MBGeocodedPlacemark
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Swift
- Star
- 133
- Fork
- 46
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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";
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với flow geocodeWithOptions:completionHandler: của MBGeocoder và addressDictionary của MBGeocodedPlacemark được hiển thị trong báo cáo. So sánh tọa độ của San Francisco Bay và khu trung tâm, sau đó xác minh rằng thông tin administrativeRegion/state dự kiến được cung cấp nhất quán cho các placemark được geocode ngược.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- objective-c, swift
- Lĩnh vực
- api, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100