如何使用GMSGeocoder以英语获取地址

时间:2018-02-07 05:35:47

标签: swift google-maps google-places-api geocoding google-geocoder

我在iOS应用中使用GMSGeocoder。我也使用多种语言(比如英语,阿拉伯语)。 使用阿拉伯语时我会收到阿拉伯语的地址。但我只想用英语获取地址。

为此,我使用了geocoder.accessibilityLanguage = "en-US"。 但它不起作用。你能否就这个问题帮助我

func getAddressForLocation() {
    let geocoder = GMSGeocoder()
    geocoder.accessibilityLanguage = "en-US"
    let coordinate = CLLocationCoordinate2DMake(Double(self.PickupLat),Double(self.PickupLong))
    geocoder.reverseGeocodeCoordinate(coordinate) { response , error in
        if let address = response?.firstResult() {
            print(address)
        }
    }
}

0 个答案:

没有答案
相关问题