I have created a view with GMap and have all the data in location and CCK fields, including latitude and longitude info. But, when I create the view using Gmap view, it gives me a list view instead. I am not able to use the template.php code snippet in the support section of Drupal. What could I be doing wrong? Zacker of Civicspace seems to have created a Google mashup view quite easily. I followed his instructions but I've had no success.

Comments

pbarnett’s picture

Working here at http://www.charityrallies.org/en/rallies/map
Here's an export of the view; you might want to drop the taxonomy bits...

  $view = new stdClass();
  $view->name = 'rallies_map';
  $view->description = '';
  $view->access = array (
);
  $view->view_args_php = '$view->gmap_macro = "[gmap |width=100% |height=480px]";';
  $view->page = TRUE;
  $view->page_title = 'Charity Rallies - where we go';
  $view->page_header = 'Charity Rallies go right across the world. Click on the marker to learn about the charity rallies we\'ve got planned. Got a new idea for a new country? <a href="/gohelp">Go Help</a> can you help you to "<a href="/createyourown">create your own rally</a>" or if you are already organising your own rally you can add your rally to our <a href="/rallies">rallies directory</a>.';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'gmap';
  $view->url = 'rallies/map';
  $view->use_pager = FALSE;
  $view->nodes_per_page = '0';
  $view->sort = array (
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'location',
      'field' => 'latitude',
      'label' => '',
    ),
    array (
      'tablename' => 'location',
      'field' => 'longitude',
      'label' => '',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'rally',
),
    ),
    array (
      'tablename' => 'term_node_12',
      'field' => 'tid',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
),
    ),
    array (
      'tablename' => 'term_node_16',
      'field' => 'tid',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
),
    ),
  );
  $view->exposed_filter = array (
    array (
      'tablename' => 'term_node_12',
      'field' => 'tid',
      'label' => 'Countries on the route',
      'optional' => '1',
      'is_default' => '0',
      'operator' => '0',
      'single' => '0',
    ),
    array (
      'tablename' => 'term_node_16',
      'field' => 'tid',
      'label' => 'Tags',
      'optional' => '1',
      'is_default' => '0',
      'operator' => '0',
      'single' => '0',
    ),
  );
  $view->requires = array(location, node, term_node_12, term_node_16);
  $views[$view->name] = $view;

Pete.

rooby’s picture

Priority: Critical » Normal
Status: Active » Closed (won't fix)

Drupal 5 is no longer supported.

Also,
Support and feature requests are not critical. For more information see http://drupal.org/node/45111