脚本宝典收集整理的这篇文章主要介绍了php – Routeboxer服务器端,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
... $From = "(Startup point for example: "Turku,Finland")"; $to = "(Destination point fro example: "Porvoo,Finland")"; $json_string = file_get_contents("http://maps.googleapis.COM/maps/api/directions/json?origin=$from&destination=$to&sensor=false"); $parsed_JSON = json_decode($json_string,true); $polyline = $parsed_json['routes'][0]['overview_polyline']['points']; $routepoints = decodePolylinetoArray($polyline); $collection = new LatLngCollection($routepoints); $Boxer = new RouteBoxer(); //calculate Boxes wITh 10km distance from the line between points $Boxes = $Boxer->Box($collection,$distance = 10); foreach($Boxes as $row){ $southWestLtd = $row->southWest->latitude; $southWestLng = $row->southWest->longitude; $northEastLtd = $row->northEast->latitude; $northEastLng = $row->northEast->longitude; $query = "SELECT * FROM markers WHERE Latitude > $southWestLtd AND Latitude < $northEastLtd AND Longitude > $southEastLng AND Longitude < $norhtEastLng"; }
运行该查询,它将只为您提供这些框内的标记(或您正在查询的内容).如果您需要更详细的说明,请发表评论.我非常乐意提供帮助,因为我花了很多个夜晚试图找到一个合理的解决方案.
以上是脚本宝典为你收集整理的php – Routeboxer服务器端全部内容,希望文章能够帮你解决php – Routeboxer服务器端所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。