0
私はこのコードを使用してGoogle API から現在の位置情報(国 - 都市など)を取得しています。質問はどのようにアラビア語やその他の言語で結果の国名を取得できますか?ReverGeoCodeLocationの結果が他の言語
ここGoogle Maps APIs
の公式文書で言及したよう
//
// ViewController.swift
// Geocoding
//
// Created by Moaaz Nash on 5/29/17.
// Copyright © 2017 Moaaz Nash. All rights reserved.
//
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let camera = GMSCameraPosition.camera(withLatitude: -33.86, longitude: 151.20, zoom: 6.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
view = mapView
mapView.delegate = self
mapView.isMyLocationEnabled = true
if let mylocation = mapView.myLocation {
print("User's location: \(mylocation)")
} else {
print("User's location is unknown")
}
var longitude :CLLocationDegrees = 46.736228
var latitude :CLLocationDegrees = 24.756455
var location = CLLocation(latitude: latitude, longitude: longitude) //changed!!!
print(location)
CLGeocoder().reverseGeocodeLocation(location, completionHandler: {(placemarks, error) -> Void in
print(location)
if error != nil {
print("Reverse geocoder failed with error" + (error?.localizedDescription)!)
return
}