2010-02-11 91 views
0

我使用gmap類型設置了一個視圖。如果我將其更改爲網格,則所有字段值均可正常輸出。當我切換到gmap時,座標顯示在地圖上,但我無法獲得關於座標/標記的任何信息。GMAP&Location - 座標顯示但無法顯示節點信息

我很困難。我以幾種不同的方式走了。您可以在此處看到示例:http://speakitnow.com/immersionschools

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

回答

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); 
+0

最後,這是我有gmap版本的問題。我不得不將版本更新到GMap Location 6.x-1.1-rc1。 我不明白的是他們甚至沒有鏈接到drupal網站上的這個文件。我花了大約2個星期才弄明白這一點。 我是否錯過了關於該過程的一些信息,以及如何知道如何使用該版本? – Scott 2010-02-16 14:18:00

+0

主要的drupal搜索功能不是很好,但是如果你嘗試搜索每個相關模塊的問題隊列,你通常可以找到東西。在每個模塊下載頁面上有一個鏈接http://drupal.org/project/issues/gmap – malcomio 2010-02-22 15:03:00