【问题标题】:GMAP & Location - Coordinates show but cannot show node informationGMAP & Location - 坐标显示但不能显示节点信息
【发布时间】:2010-02-11 16:03:36
【问题描述】:

我设置了一个 gmap 类型的视图。如果我将其更改为网格,则所有字段值都可以正常输出。当我切换到 gmap 时,坐标会显示在地图上,但我无法获得有关坐标/标记的任何信息。

我非常非常卡住。我已经采取了几种不同的方式。您可以在此处查看示例:http://speakitnow.com/immersionschools

<div class="views-field-title">
      <label class="views-label-title">
        Title:
      </label>
      <span class="field-content"></span>
</div>

【问题讨论】:

    标签: drupal google-maps drupal-6 drupal-views


    【解决方案1】:

    即使使用 6.x-1.1-rc1 也遇到了同样的问题,看起来这里的版本修复了这个问题:http://drupal.org/node/95786

    【讨论】:

      【解决方案2】:

      您使用的是哪个版本的模块?

      the issue queue for gmap 有一个补丁修复了一些问题

      如果有帮助,这是我导出的与您要实现的目标类似的视图: http://www.thegalleryguide.co.uk/galleries

      这是在 Drupal 6.15 上,视图 6.x-2.8,GMap 6.x-1.1-rc1,GMap 位置 6.x-1.1-rc1

      $view = new view;
      $view->name = 'galleries_map';
      $view->description = 'Galleries - Map';
      $view->tag = '';
      $view->view_php = '';
      $view->base_table = 'node';
      $view->is_cacheable = FALSE;
      $view->api_version = 2;
      $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
      $handler = $view->new_display('default', 'Defaults', 'default');
      $handler->override_option('relationships', array(
        'nid' => array(
          'id' => 'nid',
          'table' => 'location_instance',
          'field' => 'nid',
        ),
      ));
      $handler->override_option('fields', array(
        'field_images_fid' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'target' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'empty' => '',
          'hide_empty' => 0,
          'empty_zero' => 0,
          'link_to_node' => 0,
          'label_type' => 'none',
          'format' => 'thumb_linked',
          'multiple' => array(
            'group' => 1,
            'multiple_number' => '1',
            'multiple_from' => '',
            'multiple_reversed' => 0,
          ),
          'exclude' => 0,
          'id' => 'field_images_fid',
          'table' => 'node_data_field_images',
          'field' => 'field_images_fid',
          'override' => array(
            'button' => 'Override',
          ),
          'relationship' => 'none',
        ),
        'title' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'link_to_node' => 1,
          'exclude' => 0,
          'id' => 'title',
          'table' => 'node',
          'field' => 'title',
          'relationship' => 'none',
        ),
        'street' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'style' => 'both',
          'exclude' => 0,
          'id' => 'street',
          'table' => 'location',
          'field' => 'street',
          'relationship' => 'none',
        ),
        'postal_code' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'exclude' => 0,
          'id' => 'postal_code',
          'table' => 'location',
          'field' => 'postal_code',
          'relationship' => 'none',
        ),
        'teaser' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'target' => '',
            'help' => '',
            'trim' => 1,
            'max_length' => '100',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'empty' => '',
          'hide_empty' => 0,
          'empty_zero' => 0,
          'exclude' => 0,
          'id' => 'teaser',
          'table' => 'node_revisions',
          'field' => 'teaser',
          'relationship' => 'none',
          'override' => array(
            'button' => 'Override',
          ),
        ),
        'tid' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'type' => 'separator',
          'separator' => ', ',
          'empty' => '',
          'link_to_taxonomy' => 0,
          'limit' => 1,
          'vids' => array(
            '3' => 3,
            '2' => 0,
            '4' => 0,
            '5' => 0,
          ),
          'exclude' => 0,
          'id' => 'tid',
          'table' => 'term_node',
          'field' => 'tid',
          'relationship' => 'none',
        ),
        'view_node' => array(
          'label' => '',
          'alter' => array(
            'alter_text' => 0,
            'text' => '',
            'make_link' => 0,
            'path' => '',
            'link_class' => '',
            'alt' => '',
            'prefix' => '',
            'suffix' => '',
            'target' => '',
            'help' => '',
            'trim' => 0,
            'max_length' => '',
            'word_boundary' => 1,
            'ellipsis' => 1,
            'strip_tags' => 0,
            'html' => 0,
          ),
          'empty' => '',
          'hide_empty' => 0,
          'empty_zero' => 0,
          'text' => 'More...',
          'exclude' => 0,
          'id' => 'view_node',
          'table' => 'node',
          'field' => 'view_node',
          'override' => array(
            'button' => 'Override',
          ),
          'relationship' => 'none',
        ),
      ));
      $handler->override_option('sorts', array(
        'distance' => array(
          'order' => 'ASC',
          'origin' => 'user',
          'units' => 'km',
          'latitude' => '',
          'longitude' => '',
          'id' => 'distance',
          'table' => 'location',
          'field' => 'distance',
        ),
      ));
      $handler->override_option('filters', array(
        'type' => array(
          'operator' => 'in',
          'value' => array(
            'gallery' => 'gallery',
          ),
          'group' => '0',
          'exposed' => FALSE,
          'expose' => array(
            'operator' => FALSE,
            'label' => '',
          ),
          'id' => 'type',
          'table' => 'node',
          'field' => 'type',
          'relationship' => 'none',
        ),
      ));
      $handler->override_option('access', array(
        'type' => 'none',
      ));
      $handler->override_option('cache', array(
        'type' => 'none',
      ));
      $handler->override_option('title', 'Galleries');
      $handler->override_option('items_per_page', 0);
      $handler->override_option('style_plugin', 'gmap');
      $handler->override_option('style_options', array(
        'grouping' => '',
        'macro' => '[gmap ]',
        'datasource' => 'location',
        'latfield' => 'field_images_fid',
        'lonfield' => 'field_images_fid',
        'markers' => 'static',
        'markerfield' => 'field_images_fid',
        'markertype' => 'small blue',
      ));
      $handler->override_option('row_options', array(
        'inline' => array(),
        'separator' => '',
        'hide_empty' => 0,
      ));
      $handler = $view->new_display('page', 'Page', 'page_1');
      $handler->override_option('path', 'galleries');
      $handler->override_option('menu', array(
        'type' => 'normal',
        'title' => 'Galleries',
        'description' => '',
        'weight' => '1',
        'name' => 'primary-links',
      ));
      $handler->override_option('tab_options', array(
        'type' => 'none',
        'title' => '',
        'description' => '',
        'weight' => 0,
      ));
      $handler = $view->new_display('block', 'Nearest galleries', 'block_1');
      $handler->override_option('relationships', array(
        'nid' => array(
          'label' => 'Location: Node',
          'required' => 1,
          'id' => 'nid',
          'table' => 'location_instance',
          'field' => 'nid',
          'override' => array(
            'button' => 'Use default',
          ),
          'relationship' => 'none',
        ),
      ));
      $handler->override_option('sorts', array(
        'distance' => array(
          'order' => 'ASC',
          'origin' => 'user',
          'units' => 'km',
          'latitude' => '',
          'longitude' => '',
          'id' => 'distance',
          'table' => 'location',
          'field' => 'distance',
          'override' => array(
            'button' => 'Use default',
          ),
          'relationship' => 'nid',
        ),
      ));
      $handler->override_option('arguments', array(
        'nid' => array(
          'default_action' => 'default',
          'style_plugin' => 'default_summary',
          'style_options' => array(),
          'wildcard' => 'all',
          'wildcard_substitution' => 'All',
          'title' => '',
          'breadcrumb' => '',
          'default_argument_type' => 'node',
          'default_argument' => '',
          'validate_type' => 'none',
          'validate_fail' => 'not found',
          'break_phrase' => 0,
          'not' => 0,
          'id' => 'nid',
          'table' => 'node',
          'field' => 'nid',
          'validate_user_argument_type' => 'uid',
          'validate_user_roles' => array(
            '2' => 0,
            '4' => 0,
            '3' => 0,
          ),
          'override' => array(
            'button' => 'Use default',
          ),
          'relationship' => 'nid',
          'default_options_div_prefix' => '',
          'default_argument_user' => 0,
          'default_argument_fixed' => '',
          'default_argument_php' => '',
          'validate_argument_node_type' => array(
            'webform' => 0,
            'poll' => 0,
            'image' => 0,
            'artist' => 0,
            'exhibition' => 0,
            'faqs' => 0,
            'gallery' => 0,
            'link' => 0,
            'page' => 0,
            'story' => 0,
          ),
          'validate_argument_node_access' => 0,
          'validate_argument_nid_type' => 'nid',
          'validate_argument_vocabulary' => array(
            '2' => 0,
            '4' => 0,
            '5' => 0,
            '3' => 0,
          ),
          'validate_argument_type' => 'tid',
          'validate_argument_transform' => 0,
          'validate_user_restrict_roles' => 0,
          'image_size' => array(
            '_original' => '_original',
            'thumbnail' => 'thumbnail',
            'preview' => 'preview',
          ),
          'validate_argument_php' => '',
        ),
      ));
      $handler->override_option('filters', array(
        'type' => array(
          'operator' => 'in',
          'value' => array(
            'gallery' => 'gallery',
          ),
          'group' => '0',
          'exposed' => FALSE,
          'expose' => array(
            'operator' => FALSE,
            'label' => '',
          ),
          'id' => 'type',
          'table' => 'node',
          'field' => 'type',
          'relationship' => 'none',
        ),
        'distance' => array(
          'operator' => 'dist',
          'value' => array(
            'latitude' => '',
            'longitude' => '',
            'postal_code' => '',
            'country' => '',
            'search_distance' => '100',
            'search_units' => 'mile',
          ),
          'group' => '0',
          'exposed' => FALSE,
          'expose' => array(
            'operator' => FALSE,
            'label' => '',
          ),
          'type' => 'latlon',
          'identifier' => 'dist',
          'id' => 'distance',
          'table' => 'location',
          'field' => 'distance',
          'override' => array(
            'button' => 'Use default',
          ),
          'relationship' => 'nid',
        ),
      ));
      $handler->override_option('items_per_page', 5);
      $handler->override_option('style_plugin', 'default');
      $handler->override_option('style_options', array(
        'grouping' => '',
      ));
      $handler->override_option('row_options', array());
      $handler->override_option('block_description', '');
      $handler->override_option('block_caching', -1);
      

      【讨论】:

      • 最后是我的 gmap 版本有问题。我不得不将版本更新为 GMap Location 6.x-1.1-rc1。我不明白的是,他们似乎甚至没有链接到 drupal 网站上的这个文件。我花了大约 2 周的时间才弄清楚这一点。我是否遗漏了有关流程以及如何知道使用该版本的信息?
      • 主要的drupal搜索功能不是很好,但是如果您尝试搜索每个相关模块的问题队列,您通常可以找到东西。每个模块下载页面都有一个链接drupal.org/project/issues/gmap
      猜你喜欢
      • 1970-01-01
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-22
      • 1970-01-01
      相关资源
      最近更新 更多