Drupal 位置 gmap 节点图未显示在节点页面上

发布于 2024-09-08 08:31:20 字数 228 浏览 1 评论 0原文

我正在使用 gmap 和位置模块来支持我的内容类型的位置。 我已经配置了这些模块(地图 API 密钥等...),因此当我编辑/添加新节点时,我可以通过鼠标指向来选择/设置纬度。 我还可以写地址等等。 但是当我查看我的节点图时没有显示。我只能看到地址字段。

为什么这么混乱?

我已检查管理/内容/类型设置页面中的显示字段设置,并且所有字段都设置为可见。 我在这里缺少什么?为什么地图不像节点编辑页面那样简单可见?

I am using gmap and location modules to support my content type's location.
I have configured those modules (Map API key, etc...) so when I edit / add new node I get pretty google map to choose/set lattitude jus by mouse pointing.
I can put also address, etc..
But when I view my node map is not showing up. I can only see address fields.

Why it is so confusing?

I have check display fields settings in admin/content/types settings page and all fields are set to be visible.
What am I missing here? Why map is not simply visible as the same as in the node edit page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

腹黑女流氓 2024-09-15 08:31:20

标准主题不包括实际的地图,但它很容易做到。创建地图所​​需使用的只是 gmap_simple_map 函数。我过去在 location.tpl.php 中这样做过,因为我通常想覆盖任何内容。因此,我在其底部添加类似的内容以包含地图:

<?php
  // "Geo" microformat, see http://microformats.org/wiki/geo
  if ($latitude && $longitude) {
    // Assume that 0, 0 is invalid.
    if ($latitude != 0 || $longitude != 0) {
      $marker = 'Whatever you want the marker to be.';
      print gmap_simple_map($latitude, $longitude, '', $marker, 'default');
    }
  }
?>

The standard theming doesn't include an actual map, but it's pretty easy to do. All you need to use to create the map is the gmap_simple_map function. I've done this in the location.tpl.php in the past as I usually want to override that anything. So I add something like this in the bottom of it to include the map:

<?php
  // "Geo" microformat, see http://microformats.org/wiki/geo
  if ($latitude && $longitude) {
    // Assume that 0, 0 is invalid.
    if ($latitude != 0 || $longitude != 0) {
      $marker = 'Whatever you want the marker to be.';
      print gmap_simple_map($latitude, $longitude, '', $marker, 'default');
    }
  }
?>
是你 2024-09-15 08:31:20

请参阅此链接:GMap、位置模块和视图

以下是您需要执行的步骤:

  1. 安装 view.module
  2. 设置 view.module 配置
  3. 您可以将地图设置为页面或块,并设置块显示在内容区域
  4. 设置块将显示在哪个部分。

Please see this link: GMap, Location Module and Views

Here are the steps you need to take:

  1. Install view.module
  2. Set view.module configuration
  3. You can set the map as a page or block, and set the block show up in content area
  4. Set the block will show up in which section.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文