Hi all,

I rewrote a new patch for 4 old issues :
#334846: Center Gmap on Node passed as argument in view
#364413: GMap style views: missing tooltip
#568724: Add Google Bar to search on map
#568976: Highlight marker on mouse rollover event

For each issue i've posted a patch. But some are incompatible with last DEV version.
So I reposted a new patch including those 4 old patches together.
It is compatible with last DEV version : 6.x-1.x-dev (2009-Dec-16 )

Application procedures :

* copy patch file in GMap module directory (/drupal/sites/all/modules/gmap)
* cd /drupal/sites/all/modules/gmap
* patch < gmap_4features.patch

I have problem with new JS file "highlight.js" that isn't created in gmap/js directory but in GMap module root directory
I you have salme problem just move it :

* mv highlight.js js/

I post here patch file

gmap_4features.patch.
I also post <code>highlight.js

file alone, if you need it. Just change extension TXT in JS.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

srobert72’s picture

Status: Active » Needs review

Sorry for bad formatting. I wanted to write :

I post here patch file gmap_4features.patch.
I also post highlight.js file alone, if you need it. Just change extension TXT in JS.

izmeez’s picture

subscribing

ahkiam’s picture

subscribe

bdragon’s picture

Status: Needs review » Needs work

Unified diff format, please. (diff -up)
It makes it much less likely to break.

g.k’s picture

Are these patches included in latest dev release 6.x-1.x-dev (2010-Jan-09)?

Thanks,

srobert72’s picture

Status: Needs work » Needs review
FileSize
10.53 KB

@bdragon:
Here is patch file in Unified diff format.
I regenerated it after CVS update 6.x-1.x-dev (2010-Jan-10). So it is compatible with last DEV release.

@gkap:
No it isn't included in DEV release you must patch it for the moment.

falkendk’s picture

Im maybe asking dum but how do i use highlight (and center the gmap)
I think i have applied the patch but can't see any changes, i cant see any highlight on my makers.

srobert72’s picture

Highlight appears on rollover mouse event.
To test you must place your mouse on marker same as to show tooltip.

srobert72’s picture

I post you some screen captures to explain changes you should see.

Capture 1 /admin/settings/gmap
See 4features-gmap_1.PNG

Capture 2 and 3 while editing your Views.
See 4features-gmap_2.PNG
* you must add Global:null argument
* when editing GMap style you should see new options
See 4features-gmap_3.PNG
* choose which field to use for tooltip
* activate centre map on node ID passed as argument if you want

jdlind38’s picture

subscribing

falkendk’s picture

@srobert72 Thank you very much! :)

But the Center on node argument and Highlight marker for node argument don't appear under Gmap's settings in views

falkendk’s picture

I found out :) had to add -p0
patch -p0 < gmap_4features-up.patch

Thank you so much!!!

ayalon’s picture

good patch thanks a lot!

Sinan Erdem’s picture

Very nice options indeed.

Just one thing: Is it possible to put more than one field to the tooltip area? It would be really nice...

Anonymous’s picture

I tried to run the patch against the latest dev version of gmap and got the errors below. Could it be that some of these patches have already been commited?

(Stripping trailing CRs from patch.)
patching file gmap.module
Hunk #1 FAILED at 119.
Hunk #3 FAILED at 292.
2 out of 3 hunks FAILED -- saving rejects to file gmap.module.rej
(Stripping trailing CRs from patch.)
patching file gmap_plugin_style_gmap.inc
(Stripping trailing CRs from patch.)
patching file js/marker.js
(Stripping trailing CRs from patch.)
patching file js/gmap.js
(Stripping trailing CRs from patch.)
patching file js/highlight.js

Anonymous’s picture

I applied the patch (but with the errors mentioned above) but I am not getting any tooltips.

I am using:

- Views 2.8
- latest dev gmap
- latest dev location

Sinan Erdem’s picture

I also get some errors trying to patch the latest version, so I made the necessary changes by hand with the code differences from the patch. So now, I have tooltips displaying...

Anonymous’s picture

Which changes did you make, specifically:

1- What version of the gmap module are you using, dev?
2- Which files did you edit/fix?
3- Which part of the patch for those files did you apply?

srobert72’s picture

OK I'll see to update patch to last DEV version.
But you know first release of these 4 patches is 5 month old.
And they have never been commited in CVS.
So each new DEV release I must update them.
It doesn't encourage to participate in development.

Anonymous’s picture

I *totally* agree. I just wanted to point it out for future readers so they know what to expect.

Luckily patch will try it's best to apply what's missing and not what's already committed.

That being said ... I ran patch, and I think it did the right thing, but still no tooltip for me. So maybe patch didn't quite get it right ... or maybe the bug has come back somehow.

BTW any idea why this is not being committed to CVS and the latest dev release. Who do we need to ping to get this committed?

srobert72’s picture

No file from this patch has been commited.
Like etcetera9 in #17 you can open patch file in text editor and update manually your gmap module.

I think last DEV release update same block of code and now my patch is in conflict.
But I wrote few lines of code and I think I could be simple to resolve conflict manually.

Sinan Erdem’s picture

Status: Needs review » Reviewed & tested by the community

It totally works as expected for me. I am using 6.x-1.x-dev (2010-Jan-10). Tooltips work for me.

So I am marking this as reviewed & tested by the community if no one objects...

srobert72’s picture

Yes patch is compatible with 6.x-1.x-dev (2010-Jan-10).
I haven't test it on 6.x-1.x-dev (2010-Jan-24).

To apply patch try KasperChristensen's procedure in #12
patch -p0 < gmap_4features-up.patch

Anonymous’s picture

I did the code change by hand and can confirm that everything works.

Thanks!

hutch’s picture

Here is a patch on Jan 24 dev version. Used unix diff to build it.
rename highlight.js_.txt to highlight.js and put in js directory

Please test
Hope this helps

hutch’s picture

FileSize
7.48 KB

oops forgot gmap_plugin_style_gmap.inc
Use this one instead of gmap_4features-up2.patch

Anonymous’s picture

FileSize
57.76 KB
53.88 KB

Just a note to anyone trying to get this to work with a CCK location field, it won't. The data needed must be pulled from a Location (not a CCK location) so you need to make sure you include a Location.latitude and a Location.longitude field in your field selection (see s1.png).

You must also assign these the Location relationship.

Then in the GMap settings, you set the latitude and longitude to come from those two fields (see s2.png)

mrgoltra’s picture

+1

bohz’s picture

#25 working as expected against latest dev (jan 24).
Thanks!
[edit: noticed that if you set the autozoom feature in gmap settings AND center the map on node argument in your view with single marker, the argument Global:null returns all the nids therefore printing all the markers you have available according to view settings. adding Node:nid argument restores the printing of the single marker relative to the nid you're viewing.
please note: I am not sure if this is the cause b/c I have added several - unrelated - modules and upgraded to 6.16 in the meantime ]

GiorgosK’s picture

tooltip works as expected
did not have a need for the rest of the features so I did not test them

bendiy’s picture

FileSize
10.55 KB

Is this module abandoned?

I've rerolled this patch for the latest dev version as of March 24 2010.

It includes the new "highlight.js" in the patch.

Enjoy!

srobert72’s picture

@bendiy #31:
See my comment #19 and historic of this 4 patches:
#334846: Center Gmap on Node passed as argument in view
#364413: GMap style views: missing tooltip
#568724: Add Google Bar to search on map
#568976: Highlight marker on mouse rollover event
I started to write them in Sept 2009. I delivered patch with Unified diff format as requested.
But they still are not commited, no more in DEV version !
So I abandonned to deliver patch for this module due to lack of reactivity.

To acquire all features I need, I've just changed map module.
Now I use GMaps : http://drupal.org/project/gmaps
High reactivity and many many more features.

Sinan Erdem’s picture

I must say that I agree with srobert72.

In my opinion, the maintainer of the GMaps module, xmarket, is the new "MerlinofChaos" :))

bendiy’s picture

Thanks for the feedback.

I actually just installed Gmap yesterday for the first time to do some mapping that I needed. I have been debating as to which module to use Gmap or Gmaps. I picked Gmap because it's been around for years and has over 17,000 downloads. Gmaps is pretty new and only sports a few hundred. However, I was afraid when I saw that Gmap hasn't had a official release since December 2008.

Since I'm just starting with mapping in Drupal, I'll be sure to give Gmaps a spin and see how it fits.

The new "MerlinofChaos"... is that possible?

izmeez’s picture

@srobert72
Wow, until I read #32, I did not even realize there were two different modules "/project/gmap" and "/project/gmaps". This could be very confusing for the Drupal community. Now, I too will have to decide which to choose.

Thanks for the heads up,

Izzy

AdrianB’s picture

I second #35, thanks to this issue I found the other Google Maps module. I was worried by the lack of releases of this one, so I'll start with the other one instead.

mrgoltra’s picture

I started to use Google Maps and it looks very promising. A few issues with the cck field but once that is fixed.

rooby’s picture

Thanks for the patch, they are useful additions.

Marked these issues as duplicates of this issue:
#334846: Center Gmap on Node passed as argument in view
#364413: GMap style views: missing tooltip
#568724: Add Google Bar to search on map
#568976: Highlight marker on mouse rollover event

I have tested the tooltips, highlight on hover and google toolbar parts of the patch and made a few amendments.
I still have to test the centre on argument part but I don't have time right now. I'll get back to it in the next day or two.

When I commit it I will give a list of my amendments too.

izmeez’s picture

@rooby Looking forward to the commit.

I wonder if anyone has done a comparison of the two modules http://drupal.org/project/gmap and http://drupal.org/project/gmaps ?

Thanks,

Izzy

rooby’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
17.87 KB

Committed to D6.

Here is a patch with the changes that were committed.
I will commit the changes to D7 at some stage too.

The changes I made were:
* A little css fix to make the google toolbar display correctly.
* Changed mouseover highlight so that it un-highlights on mouseout. This is how I would expect it to work. If anyone has major objections let me know.
* Added a colour option to the gmap settings page for the highlight marker on mouseover behaviour.
* Changed tooltip option so that it doesn't depend on datasource option.
* Made the highlight marker for node argument work.
* Added a colour option for the highlight marker for node argument option.
* Changed the settings for the center on & highlight on node argument options so that you can select an argument to use based on the views arguments. This means you can use different arguments for each option and use any argument that contains a node id.
* A couple of bug fixes
* A couple of coding standard fixes

Boletus’s picture

Is this patch applied to the 6.x-1.x-dev version? I can't run patch.

rooby’s picture

Yes. The patch in #40 is what was committed.
You don't need to apply anything if you are using the most recent dev.
I posted it for the original patcher's to see what changes I made to their patch.

izmeez’s picture

Thanks, dev version seems to be working fine.

Boletus’s picture

Thanks! Will give it a go! :)

Boletus’s picture

Seems to work ok. But in maps created in views, the highlights are activated at all times. In GMaps created with the gmaps module the are hoverable.

Another thing, how do I make markers link to nodes in GMaps created in views instead of showing a bubble?

izmeez’s picture

@boletus, re: #45 - I am not having the problem you are. I have gmap in views and the highlights are only showing on hover. I am using gmap and location cck. I am confused by your line "in Gmaps created with the gmaps module" - are you comparing the behaviour in the Gmap and Gmaps module? or are you creating the maps through another content type?

Thanks,

Izzy

Boletus’s picture

Hm ... I use the two default maps from the Location module, GMap Location, User Location and Node Location to show a map over nodes and users. In this maps, the profile Location map, there is no semi-highlights shown before I hover the cursor over the marker.

But in Views Gmap display type, the color (a.e. green) I set in the Views Gmap highlight setting, is snow as semi-transparent prior to hovering, and the highlight color setting I have entered in the GMap setting (a.e. red) in Site Configuration, is overlayed the green.

I can send you the URL:s if you are interested in a PM. The site is not online yet. Thanks for answering! :)

izmeez’s picture

I am just a user of the module, not the module maintainer and I am just exploring some of this myself.

In my Views Style Gmap I only saw the item "Highlight marker for node argument" and left that unchecked. I did not see anything else that had to do with highlight on hover. In the Gmap settings I checked the highlight on rollover. I also didn't like the green color so I entered #FF0000 for the highlight color. So I assume that highlight on mouseover is a site wide setting not one you can apply to specific views only, unless there's an option I am not seeing.

Izzy

rooby’s picture

@Boletus:
There are two new highlighting options.
There is the highlight marker on rollover setting on the gmap settings page, which enables on all gmaps highlighting when the mouse hovers over a marker.
The second option is the gmap views option Highlight marker for node argument, which allows you to select one of your view's arguments. If this argument is a number that matches a node ID of a node in your view's results then all markers for that node are highlighted.

If you are using both those options and you hover over one of the already highlighted markers the highlight colours will merge into a different colour.

You say in your view your markers are already highlighted.
If the highlighted markers are not related to the argument you selected to use for highlight or you have not selected an argument or something then there is possibly a bug.
If you are seeing strange behaviour can you post en export of your view in a txt file or something? It will be easier to see what is going on.

Another thing, how do I make markers link to nodes in GMaps created in views instead of showing a bubble?

This question is not related to this issue.
Please open a new issue for new questions/bugs (if someone hasn't already posted the same issue), otherwise it is too hard to follow.

Status: Fixed » Closed (fixed)

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

rooby’s picture

I have committed this to HEAD also.

rares’s picture

I also have the issue described by boletus in #45.
The problem has been reported as issue #769652: 'Highlight marker for node argument' unchecked, highlight still visible., and has a patch submitted too.

heacu’s picture

useful

donquixote’s picture

Assigned: Unassigned » srobert72
Status: Closed (fixed) » Active

The $tooltip_field solution does not do what (I think) it's supposed to do. It uses the raw field data from the database, instead of the rendered field with all rewrite options applied.

In the patch it says

<?php
+      $tooltip_field_obj = $this->view->display_handler->get_handler('field', $this->options['tooltipfield']);
+      $tooltip_field = $tooltip_field_obj->field_alias;
...
+            $tooltip = $row->$tooltip_field;
?>

Correct would be:

<?php
      $tooltip_field = $this->options['tooltipfield'];
...
            $tooltip = $this->rendered_fields[$row_index][$tooltip_field];
?>

(with a few sanity checks here and there)

-----

There is still one problem with this:
It can happen that I want to use html in the field for the clusterer output (Jef Poskanzer's Clusterer, in my case). Such as, the link tags from "output this field as a link".
However, in a html title attribute this will show up as explicit html tags - not nice.

The ideal solution would be to treat the field for the clusterer independently from the title attribute.

Until then, the above fix is a decent solution.

EDIT: Discussion moved to
#914108: Tooltip and Marker should use rendered field, not raw field from the database.

donquixote’s picture

Status: Closed (fixed) » Active

The same for the $marker_field, but with a strip_tags(), as marker names don't contain html.
Otherwise, marker fields defined with views_customfield will not work.

donquixote’s picture

My current use case is to give past events a gray marker, ongoing events an orange marker, and future events a green marker.
I patched the code as explained in #53 and #54, and this does the job.

There is still one thing missing: The cluster icons (Poskanzer) look all the same, no matter what markers they represent.
It would be great if the colors of the cluster icon would give a hint on the contained markers, so that clusters that contain future events would stick out.

rooby’s picture

Status: Active » Fixed

@donquixote,

Can you please open new issue(s) for these things.
This issue as it was has already been fixed.

Status: Fixed » Closed (fixed)

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

branana’s picture

Assigned: srobert72 » Unassigned
Status: Closed (fixed) » Needs review
FileSize
1.52 KB

It wasn't immediately clear to me that the Center on Argument NID only would center on the provided NID if the NID was part of the returned rows from the query. I needed to center on the Node Location coordinate provided by an arbitrary node that will not be part of the result. Here are the changes I made:

rooby’s picture

Status: Needs review » Fixed

@branana:
This is definitely a new feature request, so can you please open a new issue with your patch. It makes it easier to keep track of everything.

Also, a couple of notes:

+++ gmap_plugin_style_gmap.inc	(working copy)
@@ -132,7 +132,7 @@
-      if ($this->options['center_on_nodearg'] && $nodehandler = $this->view->display_handler->get_handler('argument', $this->options['center_on_nodearg_arg'])) {
+      if ($this->options['center_on_nodearg'] && $nodehandler = $this->view->display_handler->get_handler('argument', $this->options['center_on_nodearg_arg'])) { ¶
         $center_nid = $nodehandler->get_value();
       }

This should not be here as it just adds whitespace to the end of the line.

+++ gmap_plugin_style_gmap.inc	(working copy)
@@ -205,6 +205,18 @@
+      // the specified centering nid must not be arbitrary and not part of the rows
+      if(!$center_lon && !$center_lat && $center_nid){
+        $arbitrary_centering_node = node_load($center_nid);
+        if($arbitrary_centering_node){
+          if(!empty($arbitrary_centering_node->locations)){
+            $center_lat = $arbitrary_centering_node->locations[0]['latitude'];
+            $center_lon = $arbitrary_centering_node->locations[0]['longitude'];
+          }
+        }
+      }
+      ¶

Notes on coding standards - see http://drupal.org/coding-standards
* Comment sentences should be capitalized and use punctuation like a period on the end.
* There should be a space between 'if' and the opening parenthesis.
* If statements should have a space between the closing parenthesis and the opening curly brace.
* Lines should not have trailing whitespace.
* Blank lines should not contain any whitespace.

Powered by Dreditor.

eiland’s picture

Im not sure how the module development chain goes, but can #284481: GMap Views - show distinct markers or links for places with same lat/long be still included in the dev?

Status: Fixed » Closed (fixed)

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

donquixote’s picture

Assigned: srobert72 » Unassigned
Status: Active » Closed (fixed)

@donquixote (#54): "solution does not do what (I think) it's supposed to do."
@rooby (#57): "Can you please open new issue(s) for these things."
New issue at
#914108: Tooltip and Marker should use rendered field, not raw field from the database.

rooby’s picture

@eiland,
Yes, that issue is still active so can still make it into the dev version.

@donquixote,
Thanks.

pacome’s picture

[edit]
Ooops, I should have openned my eyes before to write this comment... :)

Regards
-P