为什么谷歌地图iframe不起作用并显示位置

why is google map iframe not working and showing the location?

本文关键字:显示 位置 不起作用 谷歌地图 iframe 为什么      更新时间:2023-09-26

此谷歌地图iframe不显示
地方为什么?

<iframe src="https://www.google.com/maps/place/18%C2%B045'14.7%22N+98%C2%B059'44.0%22E/@18.7540995,98.9933669,17z/data=!3m1!4b1!4m5!3m4!1s0x0:0x0!8m2!3d18.7540944!4d98.9955556&hl=es;z=14&output=embed" frameborder="0" class="frame-p" allowfullscreen></iframe>

Google地图需要API键才能显示嵌入地图。

<iframe>
  width="600"
  height="450"
  frameborder="0" style="border:0"
  src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY
    &q=Space+Needle,Seattle+WA" allowfullscreen>
</iframe>

https://developers.google.com/maps/documentation/embed/guide

你也可以使用生成器创建一个并复制它

https://jsfiddle.net/q10s7ysv/

我试图查看他的地图的位置并绘制地图。当你复制iframe他的时可能会有错误

<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3777.987407558813!2d98.9933669!3d18.7540995!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zMTjCsDQ1JzE0LjciTiA5OMKwNTknNDQuMCJF!5e0!3m2!1sid!2s!4v1469346687955" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>

演示:https://jsfiddle.net/yz4r8jzc/