我使用gmap类型设置了一个视图。如果我将其更改为网格,则所有字段值都输出正常。当我切换到gmap时,坐标会显示在地图上,但我无法获得有关坐标/标记的任何信息。
我非常困难。我已经走了几个不同的方式。您可以在此处查看示例:http://speakitnow.com/immersionschools
<div class="views-field-title">
<label class="views-label-title">
Title:
</label>
<span class="field-content"></span>
</div>
答案 0 :(得分:0)
您使用的是哪些版本的模块?
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);
答案 1 :(得分:0)
即使使用6.x-1.1-rc1也遇到同样的问题后,看起来这里的版本修复了这个问题:http://drupal.org/node/95786