func configure(location: String){
let geoCoder = CLGeocoder()
print(location)
geoCoder.geocodeAddressString(location, completionHandler: {
placemarks, error in
if let error = error{
print(error.localizedDescription)
return
}
if let placemarks = placemarks{
let placemark = placemarks[0]
let annotation = MKPointAnnotation()
if let location = placemark.location{
annotation.coordinate = location.coordinate
self.mapView.addAnnotation(annotation)
let region = MKCoordinateRegion(center:annotation.coordinate, latitudinalMeters: 250, longitudinalMeters: 250)
self.mapView.setRegion(region, animated: false)
}
}
})
}
Latest posts by SHXJ (see all)
- 受保護的內容: NAS 版 Mathbot 管理網站與 Linebot 啟動方法 - 2024 年 11 月 15 日
- Realtime 啥鬼的 - 2021 年 6 月 15 日
- nodejs 數學遊戲 - 2021 年 6 月 8 日