Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我使用谷歌地图地理编码器来查找地址点 - 我通常会在建筑物中间(屋顶)找到一个点
例子:
https://maps.google.com/maps?q=350+Alabama+Street,+San+Francisco,+CA,+United+States&hl=en&ll=37.764842,-122.412077&spn=0.001497,0.002661&sll=37.794661,-122.425718 &sspn=0.001496,0.002661&oq=350%2BAlabama%2BStreet&hnear=350+Alabama+St,+San+Francisco,+California+94110&t=m&z=19
地理编码器请求:
http://maps.googleapis.com/maps/api/geocode/json?address=350+Alabama+Street+San+Francisco&sensor=false
所以重点实际上是在哈里森和阿拉巴马街道的中间
但我需要得到一个位于阿拉巴马州街道线上的点
有没有办法做到这一点?
您可以请求方向服务而不是地理编码,这应该返回放置在街道上的位置,当与google.maps.TravelMode.DRIVING
google.maps.TravelMode.DRIVING
https://maps.google.com/maps?saddr=350+Alabama+Street,+San+Francisco,+CA,+United+States&daddr=Alabama+St&hl=en&sll=37.764829,-122.412369&sspn=0.001043,0.002411&geocode= Fco-QAIdXiG0-ClZY3r_L36PgDG0YXVKn8-9fQ%3BFe4-QAIdrCK0-A&oq=350+Alabama+Street,+San+Francisco,+CA,+United+States&mra=dme&mrsp=1&sz=19&t=m&z=19