我以前看过这个问题,但是看不到可以帮助解决我问题的答案。
这是地图嵌入代码:
<iframe style="border: 0;" src="https://www.google.com/maps/embed/v1/search?key=AIzaSyD500KZjSof98vSBhKTytpoP3rlJi69WXM=senior+assisted+care+near+me&zoom=9" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
我将此内容嵌入了Wordpress网站上。
有人知道我为什么会收到此错误吗?
错误:Google Maps Platform rejected your request. Invalid request. Missing the 'q' parameter
答案 0 :(得分:1)
您收到错误消息:Google Maps Platform rejected your request. Invalid request. Missing the 'q' parameter
,因为URL中没有q=
参数:
<iframe style="border: 0;" src="https://www.google.com/maps/embed/v1/search?key=AIzaSyD500KZjSof98vSBhKTytpoP3rlJi69WXM=senior+assisted+care+near+me&zoom=9" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
应该是:
<iframe style="border: 0;" src="https://www.google.com/maps/embed/v1/search?key=AIzaSyD500KZjSof98vSBhKTytpoP3rlJi69WXM&q=senior+assisted+care+near+me&zoom=9" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>
((在键之后,&q
符号之前添加了=
)
工作代码段(您可能希望限制密钥...):
<iframe style="border: 0;" src="https://www.google.com/maps/embed/v1/search?key=AIzaSyD500KZjSof98vSBhKTytpoP3rlJi69WXM&q=senior+assisted+care+near+me&zoom=9" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>