Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let searchRadius: CLLocationDistance = 10000
- let region = MKCoordinateRegionMakeWithDistance(location.coordinate, searchRadius * 2.0, searchRadius * 2.0)
- map.setRegion(region, animated: true)
- let request = MKLocalSearchRequest()
- request.naturalLanguageQuery = getRandomPlace()
- request.region = map.region
- let search = MKLocalSearch(request: request)
- search.start { response, error in
- guard let response = response else {
- print("There was an error searching for: ")
- return
- }
- for item in response.mapItems {
- self.dropPinZoomIn(item.placemark)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement