If dwarfs get on the shoulders of giants they can look further, but what happens if is a giant to get on the shoulder of another one?!

Zacker has proposed a hack to show location enabled nodes of a view into a Google map:
have a look here for the 'how-to', and here for a demo.

Still this hack now replaces the default List view, so a proper hook is desirable:

The sample code simply replaces the 'list' display view with a google map. So if you create a view and select 'List nodes' you will see the map instead of a list. In the future, when there is a proper hook in views, this will live as a selectable option inside the views display pulldown provided by the gmap module.

+1

Comments

Zack Rosen’s picture

I need a views hook that will let me create a GMap display view. WIth that I can move that theme snippet directly into GMap module.

merlinofchaos’s picture

I implemented plugins based partly on your suggestion a couple of weeks ago.

/**
 * Default Views style plugins. Implementation of hook_views_style_plugins()
 */
function views_views_style_plugins() {
  return array(
    'list' => array(
      'name' => t('List View'),
      'theme' => 'views_view_list',
    ),
    'table' => array(
      'name' => t('Table View'),
      'theme' => 'views_view_table',
    ),
    'teaser' => array(
      'name' => t('Teaser List'),
      'theme' => 'views_view_teasers',
    ),
    'node' => array(
      'name' => t('Full Nodes'),
      'theme' => 'views_view_nodes',
    ),
  );
}
moshe weitzman’s picture

this is perfect for passing $nodes into event_get_calendar() and yielding a calendar view

Zack Rosen’s picture

Perfect. I'll roll a patch for GMaps module soon.

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Nothing more to do with Views here =)