On the Gmap settings page, you may set the marker action (the action performed when a marker is clicked). This setting has no effect on the rendering of a Gmap view. The view only creates markers whose action is "Open info window."

Steps to repeat:
1) install Gmap, Gmap location and dependent modules.
2) create a Gmap styled view that displays markers.
3) go to Site Configuration -> Gmap and set the "Marker action" to "Open link."
4) go to the page where your Gmap is displayed and click on a marker.

Expected result:
User is directed to that node's page.

Actual result:
An info window opens.

If you set the marker action to "Do nothing" and then click on a marker, it will again open an info window when you click a marker.

The attached patch checks the marker action setting (markermode) and then either adds a "text" value to markers if the default action is "Open window info", adds a "link" value to markers if the action is "Open link" or adds neither if the action should be "Do nothing." It is the presence or absence of these values that determine the what javascript onclick action will be attached to a marker (see gmap/js/marker.js).

Comments

Anonymous’s picture

I tested it and seems to be working properly for both options, do nothing and open link.

dan.crouthamel’s picture

Works for me as well. Thanks!

rootwork’s picture

Great patch, just what I needed!

In future versions, a neat feature would be able to choose the action in the view, overriding the default action, so that different views could have different actions set.

davidhk’s picture

Thanks, that works for me. You might also be interested in http://drupal.org/node/364413 as a related fix.

rootwork’s picture

StatusFileSize
new6.81 KB

That's great mrb! I tested it and it works. I rolled a patch with those changes included below. It would be great to get this committed!

sComm’s picture

How do I install this patch? Is it related to Drupal Core or Gmap Module?

rootwork’s picture

gmap.module. here's an easy guide to applying patches:
http://drupal.org/node/60108

these changes aren't too hard, so if you opened it in a text editor and figured out the syntax, you could probably even do it by hand.

just make sure to make a backup first. :)

davidhk’s picture

StatusFileSize
new9.46 KB

#5 worked ok on simple views, but not when the view used a relationship. Here's another patch that fixes that - it lets you choose which field to use for the tooltip text and the link.

It also lets you override the marker action on a per-view basis, as requested in #3.

Note that the patch also includes the changes from issue http://drupal.org/node/338587, which was the initial gmap-views-relationships issue.

Anonymous’s picture

Thanks mrb. This should be implemented to the module ASAP.

Very important feature.

Ashford’s picture

Referencing comments# 5 & 8, do we run both patches or just the last one?

Ashford

davidhk’s picture

Just use #8 - it includes the changes in #5.

halver’s picture

I was having a similar problem. I am not using Gmap Views, just creating a gmap macro with some markers on it. I wanted the markers to open a link. Instead, they just open a popup info window with the html code example. I tried installing the patch in #8, but something didn't work. I received this info:

[~/public_html/sites/all/modules/gmap]# patch < gmap
-352553-8.patch
(Stripping trailing CRs from patch.)
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- \old\gmap_plugin_style_gmap.inc Thu Feb 05 15:25:23 2009
|+++ \new\gmap_plugin_style_gmap.inc Thu Feb 05 15:08:36 2009
--------------------------
File to patch: gmap_plugin_style_gmap.inc
patching file gmap_plugin_style_gmap.inc
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 12.
Hunk #3 succeeded at 84 with fuzz 1 (offset 22 lines).
Hunk #4 FAILED at 108.
Hunk #5 succeeded at 120 (offset 16 lines).
Hunk #6 FAILED at 197.
Hunk #7 succeeded at 297 (offset 60 lines).
4 out of 7 hunks FAILED -- saving rejects to file gmap_plugin_style_gmap.inc.r
ej

Gmap still seems to be working, but I'm having the same old problem. What did I do wrong? I'm pretty new at all of this. Thanks for your help.

davidhk’s picture

halver, I think all the patches here relate to gmap displayed via Views. So even if you get the patches to apply ok, I don't think they are going to help.

I recommend you open a new issue for the problem you're having.

halver’s picture

OK, thanks. I've posted my issue here: http://drupal.org/node/316982

jdelaune’s picture

Any plans to update this patch for v1.1?

halver that's probably the reasons for your patch error as I got the same. Works fine when I applied it to the v1.0 version however.

Looks like a lot has changed between 1 and 1.1 otherwise I would update it myself.

Cheers

sagannotcarl’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Needs review » Needs work

This patch does not apply cleanly anymore, either to 1.1-rc1 or -dev.

Here is the error trying to patch 6.x-1.x-dev:
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 12.
Hunk #3 succeeded at 88 with fuzz 1 (offset 26 lines).
Hunk #4 FAILED at 112.
Hunk #5 succeeded at 146 (offset 42 lines).
Hunk #6 FAILED at 223.
Hunk #7 succeeded at 316 (offset 79 lines).
4 out of 7 hunks FAILED

Does anyone have this working on rc-1 or -dev and could provide a patch?

lonelyrobot’s picture

Assigned: lonelyrobot » Unassigned
jonas28’s picture

subscribe

ChrisRut’s picture

:subscribe:

Anonymous’s picture

subscribe

mikesir87’s picture

i is a-subscribing

greggles’s picture

StatusFileSize
new12.36 KB

Here's an updated version of the patch. I decided that rather than including the field with the NID we should really be including a field with the URL that we want to use. This makes the system way more flexible so that a GMAP can link to something other than a NID, like another view at "location/[province]" or something. Way more flexible. Unfortunately, that doesn't work just yet ;) But, it's getting closer and hopefully soon I can post a patch that works for all of these use cases.

wuwei23’s picture

Hey everyone,

greggles, I just applied your patch to 6.x-1.1-rc1, it applied fine but the behaviour is persisting. No matter what I set marker behaviour in either the GMap or GMap Location config, clicking on a marker opens an empty info window. This occurs in both the block view and on the full node map.

Should I revert back to an earlier version? Why has this issue hung around for so long?

Cheers.

greggles’s picture

Well, that was my desired behavior so I guess that's why I didn't notice that the selection was broken. I may not have more time to work on this personally, but hopefully that patch helps move it forward.

Wolfgang Reszel’s picture

Does the patch work with the latest DEV?

izmeez’s picture

Please help. This issue thread has four patches.

The patch included with the original post is for the problem "Gmap styled views ignore "Marker action" setting" only.

The other patches also include fixes for the tooltip but that has been committed through other patches and works in the current dev release.

I wonder if the focus of this issue should just be on the first patch. I will try it and report back.

Izzy

izmeez’s picture

StatusFileSize
new1.25 KB

Wow, Thanks @lonelyrobot for the diff file.

I applied it to the 6.x-1.x-dev (2010-Apr-08) and it works like a charm and uses the Gmap settings to link to the node or show an info bubble.

Everything seems to work fine including the tooltips and highlights.

I have rolled a patch against the dev version. This is the first patch I have rolled and look forward to any feedback.

I think it would be even better if the Views Gmap style could include specific settings for link or info bubble rather than using the global gmap setting. This would allow different options to be used for different views.

Thanks,

Izzy

rootwork’s picture

Status: Needs work » Needs review

I'm gonna give your patch a review and report back.

As to your second idea, I think it's a good one but it's a feature request -- let's keep this to addressing the bug, and if you want to start a new thread with your feature request, go ahead and link to it from here.

marcushenningsen’s picture

I can confirm that the patch in #27 works against the latest dev-version in the case of markermode=0 which is the only case I've tested so far.

Marcus

izmeez’s picture

bump

This issue has been open for 18 months and includes a solution that works with the global gmap settings to link to the node or show an info bubble.

I was wondering if someone can mark this RTBC or move this on to a commit?

Thanks,

Izzy

[EDIT] I have created a separate issue for the Gmap Views Style feature request http://drupal.org/node/834688

cbrody’s picture

Status: Needs review » Reviewed & tested by the community

I confirm that the patch in #27 works with gmap 6.x-1.x-dev (2010-Jul-04). It's not possible to override the default settings per view however.

izmeez’s picture

oh, I was so hoping this would get committed into the new gmap 6.x-1.1 because without it the global marker actions are ignored and cannot be set as desired:-(

gazzur’s picture

One issue I've found with the #27 patch on gmap 6.x-1.x-dev, is that the references to $row->nid are incorrect - they should be $row->node_nid
Hope this helps :-)

izmeez’s picture

@gazzur There is only one reference to $row->nid in the patch but also two other references in the file so I hope the module maintainer or someone else can review and determine what to do.

I have not seen any problems with this in several months of use. Can you describe what problems might occur or if this is a Drupal coding practice.

Thanks.

gazzur’s picture

@izmeez I can only speak from my experience of implementing the patch, but I found that $row->nid didn't exist in the $row object and so couldn't be appended to the url and therefore didn't provide a valid link from the pin to the appropriate node. $row->node_nid was what returned the correct node id for me. Despite that, this patch has really helped be out of a hole, so thanks!

izmeez’s picture

Thanks for the solution go to lonelyrobot. I just rolled a patch from the first post in this thread.

Thanks for the details in #35. This may need a review of the other occurrences also.

rooby’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch, and as mentioned in #30 there is a new issue to make the marker action a views style setting.

I recommend looking at greggles' patch in #22 as a starting point for that as he was already implementing that.

Committed the patch in #27 to 6 & HEAD with a couple of minor changes.

The main one being changing from using $row->nid to $row_nid.
$row->nid is present in node views, views without node as the base table (like location views) must include the nid field, which will be in $row->node_nid if present.
$row_nid is a variable created from whichever of those is relevant to the current view.

(Thinking about all this nid stuff now, user location views have been left out in the cold a bit in general with the gmap views style - but that is for another issue now)

http://drupal.org/cvs?commit=430010
http://drupal.org/cvs?commit=430012

rooby’s picture

Oh, and it wasn't required for d5 as it already works for that version.

Status: Fixed » Closed (fixed)

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