English 中文(简体)
如何使用基于行驶距离的谷歌位置api访问附近的酒店
原标题:How to nearby hotels using google places api based on driving distance

我知道我可以通过使用googleplacesAPI给出中心节点的圆半径来搜索节点附近的酒店(例如)。但这会返回其他城市的地方。原因是这个地方在地理上位于给定的半径内。但行驶距离不同。有什么办法绕过这个吗?

问题回答

地点搜索API将返回指定区域内按突出程度(受欢迎程度;“rankby=突出程度”)排序的地点,或按独立于区域的距离(“rankby=距离”)排序。没有按行驶距离排序的选项。

要获得基于驾驶距离的排名,您可能需要考虑将API与API距离矩阵结合使用。

https://developers.google.com/maps/documentation/distancematrix/一

距离矩阵API将根据一个或多个出发地和一个或更多个目的地返回驾驶、步行或骑自行车的距离。





相关问题
Why do I get "map.set_center is not a function"?

This code have been working until I updated last night. The code works perfectly on my localhost, but I get an error on my test server. The error message (from Firebug) is "map.set_center is not a ...

The state of GMaps v3

I m about to start a Google map based project and am wondering if the release version of GMaps v3 has most of the features that are available in v2, or if it would be best to stick with v2 for now. Is ...

Bouncy marker in Google Maps v3

In Google Maps API v2 we can set to marker an option bouncy:true. It adds to marker eye-candy ability - after dragging this marker, it is bouncing. Is it possible to do in API v3 ?

GUnload() a single Google Map

I ve got some Javascript/HTML code which displays a variable number of maps dependent on what the user selects. I ve worked how to dynamically create multiple maps on a page - that s well documented. ...

How to change Gmap markers color?

I ve a custom google map with different points: Markers[0] = new Array(new GMarker(new GLatLng(45.0, 9.0)), "Location1", "<strong>Address Line</strong><br/>Some information"); ...

热门标签