简体   繁体   English

嵌入Google Maps:嵌入式地图上的地址正确-方向上不正确

[英]Google Maps Embed: Address correct on embedded map - incorrect on directions

Test page located at http://hmcc1.com/Contact_TEST.htm 测试页位于http://hmcc1.com/Contact_TEST.htm

I have tried both place_id and the actual address. 我已经尝试了place_id和实际地址。 ll as described in another Q&A ( Google Maps Embed displaying incorrect address on directions ) returned an invalid parameter error. ll如另一问与答( Google Maps Embed在路线上显示不正确的地址 )所述,返回了无效的参数错误。

Whether I use place_id or the address, when I click on Directions, the wrong address appears on the Directions page. 无论我使用place_id还是地址,当我单击“路线”时,“路线”页面上都会显示错误的地址。

Here is the code in the test page: 这是测试页面中的代码:

<iframe width="500" height="640" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?q=3060+N+Kennicott+Ave,+Arlington+Heights,+IL+60004@42.132098,-87.994873&key=AIzaSyA42PChU9T0qV5kw-ikHHUv4yarQhFFo9U" allowfullscreen></iframe>

I would be grateful for any assistance. 我将不胜感激。 Thank you in advance. 先感谢您。

I am going to leave the test page up in case someone comes up with a fix, or as @geocodezip said, maybe the API has a bug and will (someday) be fixed. 我将离开测试页面,以防万一有人提出修复建议,或者如@geocodezip所说,API可能存在错误,并且(有一天)将得到修复。 For the live page , I ended up using the Directions mode instead. 对于实时页面 ,我最终使用了Directions模式。 It is not exactly what I wanted, but at least it does not give the wrong address. 这不是我想要的,但至少没有给出错误的地址。 And it does work nicely for mobile users. 它确实适合移动用户。

I was able to use the code exactly as generated by the Google Maps Embed Quick Start page : 我完全可以使用Google地图嵌入快速入门页生成的代码:

<iframe width="500" height="500" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/directions?origin=Current%20Location&destination=place_id:ChIJJ2uA_ly7D4gRRDjYtPvR62U&mode=driving&key=AIzaSyA42PChU9T0qV5kw-ikHHUv4yarQhFFo9U" allowfullscreen></iframe>

Thanks so much to all who commented! 非常感谢所有发表评论的人!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM