I'm not sure this that this have not been reported yet, but I haven't been able to find it though.
I've made map views for my location nodes, one view for page view and another view for a block view.
I've set up some custom markers per content type, in GMap Location settings.
These custom markers work fine in my page view, but in my block view they are being ignored.
The problem seems to be in the gmap_views_query_alter hook in gmap_views.module, right at the bottom.
/**
* Implementation of hook_views_query_alter().
* We need to add in the node type so we can determine markers.
*/
function gmap_views_query_alter(&$query, &$view, $summary, $level) {
if ($view->page && $view->page_type == 'gmap') {
$query->add_field('type', 'node', 'gmap_node_type');
}
}
As I understand this adds the node type, if the view is a page view.
So my solution is to add some code to add the node type, if i'ts either a page or block view of the gmap type.
if ($view->page && $view->page_type == 'gmap' || $view->block && $view->block_type == 'gmap') {
You may need to clear your views cache, as this hook is only called when the query is actually generated.
Please confirm.
Comments
Comment #1
marcoBauli commentedmortenq, your code fixed it, thanks for that!
posted your comment and code in the previous issue opened at http://drupal.org/node/157304#comment-883780