代码之家  ›  专栏  ›  技术社区  ›  Lukasz

Drupal位置gmap节点映射没有显示在节点页面上

  •  1
  • Lukasz  · 技术社区  · 16 年前

    我使用gmap和位置模块来支持我的内容类型的位置。 我还可以写地址等。。

    为什么这么混乱?

    我已经检查显示字段设置在管理/内容/类型设置页和所有字段设置为可见。 我错过了什么?为什么地图不只是像在节点编辑页面中一样可见?

    2 回复  |  直到 16 年前
        1
  •  5
  •   googletorp    16 年前

    标准的主题不包括实际的地图,但它很容易做到。创建地图所需的就是 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');
        }
      }
    ?>
    
        2
  •  0
  •   Zero Piraeus    13 年前

    请查看此链接: GMap, Location Module and Views

    以下是您需要采取的步骤:

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