将 Google 地图添加到 Drupal 中的联系信息页面
我正在尝试在 drupal 页面内显示 Google 地图。地图上只会有商家位置标记,无需用户提交自己的标记。
到目前为止,我已经加载了 Gmap、Location 和 CCK 模块。我尝试为页面内容类型启用位置字段,这允许我输入地址,但这不会显示实际的地图。
我确信我在这里遗漏了一些简单的东西。有什么帮助吗?
编辑:
我最终采用的解决方案是使用 php 命令 drupal_set_html_head() 将 JS 文件添加到 drupal 标头,该命令是通过 此链接由 Nikit 提供。我无法得到其他任何东西来正常工作。
I'm trying to display a Google Map inside a drupal page. The map will only have the business location marker on it, with no need for a user to submitted their own markers.
So far I've loaded the Gmap, Location, and CCK modules. I've attempted to enable a location field for Page content types, which allows me to input an address, but this doesn't display the actual map.
I'm sure I'm missing something simple here. Any help?
Edit:
The solution I went with finally was adding the JS files to the drupal header using the php command drupal_set_html_head() which was found through this link provided by Nikit. I could get nothing else to work properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
仅适用于联系页面?手动嵌入可能更简单吗? http://code.google.com/intl/en/apis/maps/< /a>
Only for Contact page? May be simpler to embed manually? http://code.google.com/intl/en/apis/maps/
我认为您可以使用 gmap 块 模块创建一个块,然后将此块设置为仅显示在联系页面。
I think you could create a block with the gmap blocks module and then set this block to display only on the contact page.
这是手动将地图添加到任何内容的简单方法。本教程向您展示如何获取地图“链接”,然后将其复制到内容中。
http://maps.google.com/help/maps/getmaps/plot -one.html
确保将“文本格式”设置为完整 HTML - 允许使用 iframe 标记。
Here is a simple way to add a map to any content manually. This tutorial shows you how to get the map "Link", which you then copy into you content.
http://maps.google.com/help/maps/getmaps/plot-one.html
Make sure that you set the "Text Format" to Full HTML - the allows the iframe tag to be used.