谷歌地图动态嵌入

时间:2014-11-15 01:44:57

标签: php google-maps iframe google-maps-embed

我想问一下是否有人可以帮我识别我的代码问题。

我正在尝试显示动态谷歌地图,只是在我的网站上显示每个事件的位置。

我做了一些研究,谷歌从here

中提供了这段代码
<iframe width="450" height="250" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/search?key=API_KEY&q=record+stores+in+Seattle">

然后根据我的需要进行修改。

<iframe width="700" height="350" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/**MODE**?key=**API_KEY**&q=<?php echo $row['location'];"></iframe>

现在我将模式设置为搜索并将开发人员的API密钥也放入其中。我假设q =“location”

但最后,当我点击页面时,它只显示显示整个世界的地图:

Image of Error

如你所见,我有位置:123 Clarance Street,Sydney,New South Wales,Australia

我基本上做的是:

Location: <?php echo $row['location']?>

我也试过了:

<iframe width="450" height="250" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/search?key=API_KEY&q=123+Clarence+Street,+Sydney,+New+South+Wales,+Australia">

只是为了测试PHP代码是否有问题。所以目前我很难过,不知道在哪里看人们在网上问什么,他们的解决方案对我解决方案没有帮助。

我确信这可能是次要的,但希望有人可以帮助我。提前谢谢。

0 个答案:

没有答案
相关问题