如何在Google地图中显示离我所在位置最近的地方?

我试图创建一个iOS应用程序,我现在还不能完全确定一些快速的东西,但我仍然每天都在学习!

我的问题是……

如何在谷歌地图中显示我所在位置最近的地方?! 我从具有纬度和经度的mysql DB获取数组,但我不能(我不知道)如何将这些选定的记录放在我的地图中! (我的意思是从我的位置确定半径)有人会帮我吗?!

iOS #MySQL #JSON #GoogleMapsSDK#Swift3

我正在使用AlamoFireSwifty POD来处理arrays

func getDatos(){ let key = "654321" let postString = "buscar=\(self.searchtext)&key=\(key)" //-----------------data send post ///-------- SEARCH let url = URL(string: "http://myWeb.com/myFile.php")! ///-------- SEARCH print(url) var request = URLRequest(url: url) request.httpMethod = "POST" //-----------sending -> post method request.httpBody = postString.data(using: .utf8) //---------------concatenate my variables with utf8 coding let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data else { //---------------if error do exist finish the func print("failed request \(String(describing: error))") //---------------mannage the error return //------------- break code block } do {//----------- create son object if let json = try JSONSerialization.jsonObject(with: data) as? [NSDictionary] { DispatchQueue.main.async { //-----------------main process for result in json { let id = result["id"] as! String let country = result["country"] as! String let lati = result["lati"] as! String let long = result["long"] as! String self.idCountry.append(id) //--------------------push elements into array self.ctryCountry.append(country) self.latiCountry.append(lati) self.longCountry.append(long) } self.tableView.reloadData() //-------------------reload table again } } } catch let parseError { //------------------mannage error print("parsing error: \(parseError)") let responseString = String(data: data, encoding: .utf8) print("response : \(String(describing: responseString))") } } task.resume() } 

有我的func接收一个包含数据字段的数组我放入变量,之后我可以将它放在tableViewController中或用GoogleMapsSDK显示标记。 问题是我有一些X行,但我只想展示附近的人!