I have created a Gmap view, showing one type of node.
The map works really well
See
www.runireland.com/events_map
but it doesn't respect the Map marker settings per node.
It just uses the default marker, rather than the specific marker for the node type
set at
admin/settings/gmap_location
[This setting works fine for the node itself].

Regards
Alan

Comments

pisco23’s picture

Just wish to second the flagging of this bug - it will quickly become important on my site as the number of content-types increases - thanks for your attention .

janosch’s picture

I'm also having the same issue trying to find a solution, but with no luck.. Anyone?

ray007’s picture

You need to configure the view to also select the "Node: type" field.
A pity that doesn't happen by default, but if you do select this field the markers show as expected.

I'll eventually try to come up with a fix for this if I can manage to do it without too bad a performance impact, but that will have to wait some time - unless somebody else comes up with a patch.

marcoBauli’s picture

Title: Gmap views doesn't respect Marker settings » Gmap Views don't respect Markers types settings
Status: Active » Needs review

Follows a patch from mortenq that fixes the issue:

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.

marcoBauli’s picture

confirming that the fix above works also in beta2

bdragon’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

varuntaliyan’s picture

Version: 5.x-1.x-dev » 6.x-1.1-rc1
Status: Closed (fixed) » Needs review

hi frns !!
I m facing the similar problem. I m using drupal-6x. I used Gmap,location,location cck modules. I created a view to show gmap on my site and used different markers to show different content type on my map. It worked well on my local system, But when i uploaded the site on my server only Drupal Default markers are shown on map. The option to select marker at /admin/settings/gmap_location shows only default, i tried giving permissions to gmap and everything i can but with no luck.

Help Appreciated.

joancatala’s picture

Same problem: Drupal 6.16 + CCK + Gmap.

When I click on a marker it don't open the node... but the info window :-(
Here you are: http://bebes.kreanto.com/distribuidores

Help appreciated.

morticcino’s picture

Hi Marco,
where I have to apply this patch? There is not gmap_views.module in my gmap module...
I have installed the last stable release, not the dev.
Can you help me to fix this problem?
Thanks in advance.
Regards,
Michele

PatrickTarzan’s picture

Hey,

i had the same problem, and i did it the bad way. I just deleted drupal.png in /sites/all/modules/gmap/markers/ and changed the name of a existing marker in the same folder to drupal.png. Dont forget to empty your cache.

jorgensa’s picture

I had the same problem, but I was able to change the marker color/size through the views gmap page style settings. Drupal markers were set as the marker / fallback marker to use there. I just set all of my markers to be one symbol, but it looks as though you can select more intricate settings there as well...

johnv’s picture

It is not enough to add your marker to the directory. Have you also created an ini-file? The markers-directory als contains ini-files by default. See the advanced help: help/gmap/extending.
or, if you haven't installed Advanced help, this post: http://groups.drupal.org/node/19614

nancydru’s picture

The only way I could get this to work was to go and edit misc.ini.

nancydru’s picture

Version: 6.x-1.1-rc1 » 6.x-1.1
podarok’s picture

Version: 6.x-1.1 » 7.x-2.x-dev
Status: Needs review » Needs work

please, provide patch against latest dev