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).
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | gmap_plugin_style_gmap.inc_.patch | 1.25 KB | izmeez |
| #22 | 352553_gmap_plugin_style.patch | 12.36 KB | greggles |
| #8 | gmap-352553-8.patch | 9.46 KB | davidhk |
| #5 | use_default_marker_and_tooltip.patch | 6.81 KB | rootwork |
| use_default_marker_action_in_view.diff | 1.35 KB | lonelyrobot |
Comments
Comment #1
Anonymous (not verified) commentedI tested it and seems to be working properly for both options, do nothing and open link.
Comment #2
dan.crouthamel commentedWorks for me as well. Thanks!
Comment #3
rootworkGreat 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.
Comment #4
davidhk commentedThanks, that works for me. You might also be interested in http://drupal.org/node/364413 as a related fix.
Comment #5
rootworkThat'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!
Comment #6
sComm commentedHow do I install this patch? Is it related to Drupal Core or Gmap Module?
Comment #7
rootworkgmap.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. :)
Comment #8
davidhk commented#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.
Comment #9
Anonymous (not verified) commentedThanks mrb. This should be implemented to the module ASAP.
Very important feature.
Comment #10
Ashford commentedReferencing comments# 5 & 8, do we run both patches or just the last one?
Ashford
Comment #11
davidhk commentedJust use #8 - it includes the changes in #5.
Comment #12
halver commentedI 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.
Comment #13
davidhk commentedhalver, 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.
Comment #14
halver commentedOK, thanks. I've posted my issue here: http://drupal.org/node/316982
Comment #15
jdelaune commentedAny 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
Comment #16
sagannotcarl commentedThis 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?
Comment #17
lonelyrobot commentedComment #18
jonas28 commentedsubscribe
Comment #19
ChrisRut commented:subscribe:
Comment #20
Anonymous (not verified) commentedsubscribe
Comment #21
mikesir87 commentedi is a-subscribing
Comment #22
gregglesHere'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.
Comment #23
wuwei23 commentedHey 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.
Comment #24
gregglesWell, 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.
Comment #25
Wolfgang Reszel commentedDoes the patch work with the latest DEV?
Comment #26
izmeez commentedPlease 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
Comment #27
izmeez commentedWow, 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
Comment #28
rootworkI'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.
Comment #29
marcushenningsen commentedI 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
Comment #30
izmeez commentedbump
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
Comment #31
cbrody commentedI 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.
Comment #32
izmeez commentedoh, 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:-(
Comment #33
gazzur commentedOne 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 :-)
Comment #34
izmeez commented@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.
Comment #35
gazzur commented@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!
Comment #36
izmeez commentedThanks 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.
Comment #37
rooby commentedThanks 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
Comment #38
rooby commentedOh, and it wasn't required for d5 as it already works for that version.