In the D5 version, if you hold your mouse over a marker on a GMap view, you get a tooltip showing the related node's title. In the D6 version, there is no tooltip.

After making the patch to gmap_plugin_style_gmap.inc from http://drupal.org/node/352553, I also added these lines

// Set marker's title so that it will be displayed as tooltip for this marker
$node = node_load($row->nid);
$marker['opts']['title'] = $node->title;		  

above this line from the linked patch

if ($defaults['markermode'] == 1) { // popup

Hopefully someone with more views experience can point out an easier way to get the row/node's title if it's already available to the code.

Comments

rootwork’s picture

Awesome! I rolled a new patch with these changes included over at #352553: Gmap styled views ignore "Marker action" setting to keep things all in one place.

artatac’s picture

Will this be rolled into the dev release if not could I request a copy of the gmap_plugin_style_gmap.inc file

dadderley’s picture

I too really miss this functionality in the d6 version.

srobert72’s picture

Issue tags: +gmap, +views, +tooltip

Subscribing

My modules :
gmap 6.x-1.x-dev
views 6.x-2.x-dev

In this system page, when rollover on marker, tooltip appear
http://www.mydrupal.com/map/node

But not in my own Views with GMap style.
When I click on markers, my popup with clickable fields appears.
But when I rollover on markers, tooltips don't appear.

chezwel’s picture

having the same problem with gmap views. A solution to this will be very helpful.

dadderley’s picture

Interestingly enough, when using Martin Pearman's ClusterMarker, the tool tips work for the pin representing the cluster.

srobert72’s picture

Yes I've just tested it with last version 1.3.2 downloaded here :
http://googlemapsapi.martinpearman.co.uk/downloads.php?cat_id=1

Tooltip for cluster pin appears.
But no tooltip for nodes pins.

In my opinion that confirms that Gmap and JavaScript aren't in fault.
The problem must be in Drupal Gmap Views that don't export required text for tooltip.

Is there a chance to see it resolved ?

Thx a lot for your help.

izmeez’s picture

subscribe

srobert72’s picture

Version: 6.x-1.0 » 6.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new2.63 KB

Here is a patch for tooltip in GMap Views.

GMap views expose new parameter "Tooltip field".
You can specify which field will be used to write text tooltip. So it could be other one than Node:Title.

Thx if you could make reviews and hope it could be commited.

ArthurC’s picture

@srobert72: exactly what I was looking for. So I implemented the changes in my code, and ... unfortunately, nothing has changed. No tooltip. No "Tooltip field:" in GMap views.

I'm using gmap-6.x-1.1-rc1, for which the download is dated 2009-Mar-04.

This is the top line in the file I changed:
// $Id: gmap_plugin_style_gmap.inc,v 1.7 2009/02/05 21:51:53 bdragon Exp $

Is there something I missed that you didn't state here, perhaps because you thought it was obvious? Do other files need changing?

Any help would be greatly appreciated. Thanks.

srobert72’s picture

@ArthurC : You need to apply all changes in patch file
See http://drupal.org/patch/apply

ArthurC’s picture

I definitely did apply all the changes in the patch file, but no tooltip popped up with my map markers, and no "Tooltip field" parameter appeared in GMap views.

So I am wondering what are the complete set of changes or patches that I need to make.

Reading through this thread, it appears that I may need to apply srobert72's patch #9, AND mrb's patch #8 from http://drupal.org/node/352553.

Patch #8 in 353553 is, if I understand correctly, the merged patch of the changes originally provided at the top of 352553 and at the top of this thread, http://drupal.org/node/364413.

However, I looked at the patch from drupal.org/node/352553, and I think that bdragon changed gmap_plugin_style_gmap.inc after 352553 was written. In its current version 1.7, dated 2009/02/05, gmap_plugin_style_gmap.inc appears to include some of the changes from the 352553 patch.

The authors of the code - bdragon, mdb, and srobert - are certainly in a better position than I am to advise on the correct way to proceed.

Thank-you, all.

ChrisRut’s picture

:subscribe:

robbertnl’s picture

Subscribing

Anonymous’s picture

Subscribing

danieldd’s picture

Subscribing.
I have also tried to apply the changes in #9 on 6.x-1.1-rc1 but did not seem to do anything. Perhaps I have not understood all the changes required, or the version to be modified etc as per comment #12.

srobert72’s picture

StatusFileSize
new14.23 KB
new30.89 KB

Here are 2 screenshots to explain what patch #9 should provide.

It works only with Views which have "GMap" style (see GmapViews.gif).
In "GMap" style options you have a new field "Tooltip field" (see GmapViewsOptions.gif).
You can fill it with one of your fields available in your view.

Could you confirm me if it works like this or not ?

danieldd’s picture

Hi, thanks for responding and for the patch. I can confirm that I did try this with GMap style Veiws.

I did not see the new "Tooltip field" as per the attached image. However, I chose "Location.Module" as my data source, rather than "choose longitude and latitude fields". Would this explain why the option was not visible and, if so, do you know how to adapt the patch to this option?

In addition I see that your form contains other options - "center on node argument" & "highlight marker for node argument" that are not present in my version. Are these options the result of other patches applied to Gmap, or of using a version other than 6.x-1.1-rc1?

Thanks again

srobert72’s picture

danieldd’s picture

Thanks - do you think it is neccessary to apply these to get #9 to work, and have you made any other modifications that may be needed? Did you begin with 6.x-1.1-rc1?
These all look like great extensions to the module, hope you can get them committed.

ressa’s picture

Thanks for the patch Stéphane, I hope it makes it into the next release.
Mouseover and tooltips are much needed for the Gmap module.

srobert72’s picture

Sorry all for my late reply.

In fact I've just apply and test my patch (see #9) on GMap 6.x-1.x-dev (2009-Jun-09).
I don't know if it works or not on GMap 6.x-1.1-rc1.

Nevertheless this patch works on its own and you don't have to install my other ones.
Each of my patches work independently and can also be installed together to have all the features applied.

izmeez’s picture

Status: Needs review » Reviewed & tested by the community

@srobert72 - Thanks.

The patch in #9 also works for me with the latest gmap-6.x-1.x-dev 2009-12-12.

It would be great to see this committed. I must admit I thought it might already be as it is such a useful item.
I will change the status in the hope to facilitate it being committed.

I am using it with views-6.x-2.x-dev 2009-12-08 and will probably work just fine with views 6.x-2.8

[EDIT] Even though the gmap style shows the default tooltip as node title I still had to manually click update and save on existing views. I guess this is to be expected but wonder if there is a way to include it as part of the update process.

Thanks,

Izzy

srobert72’s picture

Thanks izmeez,

Maybe you could test others patches i've posted.
In my opinion they are also missing options in GMap.
I needed them and then try to wrote them.
It works for me but i'm not sure for others installations.
See them here :
#568976: Highlight marker on mouse rollover event #1
#334846: Center Gmap on Node passed as argument in view #13

srobert72’s picture

Patch from #9 has been reposted in new issue in all-in-one patch.
It is now compatible with last DEV version 6.x-1.x-dev (2009-Dec-16)
See #679804: Patch for 4 new features in GMap

tobedeleted’s picture

The tooltip patch sounds like just what I need. Is it compatible with 6.x-1.1rc1, or should I move to the dev version (currently dated Jan 24 2010)? assuming that this is solid enough for production use?
Or has it yet been rolled in to the dev version?

rooby’s picture

Status: Reviewed & tested by the community » Closed (duplicate)