mapbox / mapbox/MapboxGeocoder.swift
Placeholder Attributes Not Correctly Set
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ả
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.

Actual
When the above code block is run, all but placemark.name return nil values:
Hong Kong
nil
nil
nil
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 bằng cách tái hiện ví dụ ForwardGeocodeOptions và geocoder.geocode cho “Hong Kong,”, sau đó so sánh các placemark được trả về với phản hồi của Geocoding API playground. Theo dõi cách phản hồi forward-geocoding điền placemark.name, placemark.code, country.code và administrativeRegion.address; hoàn tất khi các thuộc tính mong đợi đó không còn là nil.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- 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