mapbox / mapbox/MapboxGeocoder.swift

Placeholder Attributes Not Correctly Set

Đang mở
#159 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug
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.

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.