I've gone through a huge number of threads discussing this matter but haven't found any that show a solution that works perfectly. I just wanted to see if anyone here could post a response in this thread that would give me what the current best solution available is to this matter. I also wanted to see if the solution is something that is easily implemented or not.
On the project I am working on now, the client has said that if I can't get multiple listings using the same location can't be differentiated and displayed in some way on the map, then we'll have to abandon the events map effort. I'd rather not have to do that because I want to be able to deliver on this.
I tried Martin Pearman's ClusterMarker, but the clustering on that was too aggressive in the wide view, clustering any events that were remotely close to each other on the map. I *only* want clustering if the events are in the identical lat/long coordinates. I don't want or need it otherwise. Plus when I zoomed by clicking on the cluster in Martin Pearman's marker manager, it only showed one event on that location. So that didn't do anything to solve the single problem I'm having unless I just don't know what I'm doing with configuring things (a distinct possibility as this is my first effort trying any marker managers).
The only thing I need is for a selection of ALL events that are on the single location represented by the marker to show up in the popup bubble instead of the information about the one event displayed. We may have 5-10 events marked at the same location at any given time, so only getting to see information about one of them isn't going to work. Then it would be majorly nice if people could click on the event they want to see within what I'd like to see appear in the bubble, and then the information for that single event would appear in the bubble. But that's just a luxury request. The necessity is for all events in the single location to display in some way when people click on the marker. I only want the solution to apply to events in the same precise location.
If this problem has been solved already and I just haven't found the solution, please let me know what I need to do. Also, the simpler the instructions can be on this, the better for novices with GMap like me. Thanks for all your work on this great module.
Comment | File | Size | Author |
---|---|---|---|
#78 | gmap_1139088_78.patch | 1012 bytes | ikeigenwijs |
| |||
#71 | Screen Shot 2017-03-01 at 8.06.28 PM.png | 41.28 KB | cardamomclouds |
#64 | marker.js_.txt | 14.81 KB | keraweb |
#61 | marker-v3.js_.txt | 9.98 KB | keraweb |
#55 | google.inc_.txt | 7.6 KB | webservant316 |
Comments
Comment #1
wildlife CreditAttribution: wildlife commentedCorrection: I'm not seeing an edit option for my post, so I wanted to correct one sentence to read:
On the project I am working on now, the client has said that if multiple listings using the same location can't be differentiated and displayed in some way on the map, then we'll have to abandon the events map effort.
Comment #2
jessia CreditAttribution: jessia commentedHave you found a solution to this yet? I am having the same problem—in my case, I am geotagging photos and blogs using geocoded values, so there are a lot of nodes added from identical lat/long coordinates.
Comment #3
mry4n CreditAttribution: mry4n commentedI'm in a similar position, where I'd like all the nodes in one location to show up in the infowindow.
I've found that all the different clusterers do a piece of what I want, but not all of it.
You may find this patch is useful: http://drupal.org/node/284481
However, that solution does not dump everything into the infowindow.
Jef Poskanzer's Clusterer marker manager puts the nodes that are in the cluster into the infowindow, but there is no setting to only cluster on nodes with the exact same lat/lon. In fact, none of the clusterers have an option to cluster only on identical lat/lon. I'm sure there is a way to alter any of the clusterer javascript files and make that the level of sensitivity for clustering, but I haven't figured out how to do that yet.
Comment #4
wildlife CreditAttribution: wildlife commentedNo solution yet. We're considering putting out a bounty to get this functionality implemented as the events map we want will be useless if there is no way to show multiple events at the same location. But I'm waiting for final approval before posting the bounty and the amount we'll be willing/able to pay.
Comment #5
wildlife CreditAttribution: wildlife commentedWe would like to provide a $300 bounty for anyone that can upgrade the GMap module to have the functionality we need for multiple events at the same location.
What we need is for there to be a single marker on the location as currently shows (not necessarily a clustered marker but a marker that is different from the usual markers in some way where people will know or can be told that the different marker means multiple events at that location), but on occasions where there are multiple events in that one location, the popup that appears when you click on the marker should only show a list of all the event titles for that location. Then when people click on any of those titles, the usual pop-up information for the single events will appear along with a way to get back to the list of event titles for that location.
This is the first time I've posted a bounty on the Drupal site, so please let me know if there's an established protocol for doing so that I need to follow. I thought I would first post it in this issues area to give the module author(s) the first opportunity with it. Please reply here if you are interested in working on this for us and we'll work out whatever details are necessary for payment upon completion of the work. If this gets no response here, should I post it in the paid services forum next? If so, then would the person doing the work know what to do to get the upgrade here for others to be able to use?
If anyone would like to add any amount to our bounty offer to further expedite getting this done, feel free to jump in.
Comment #6
lookatthosemoose CreditAttribution: lookatthosemoose commentedwildlife - There is a version 2 of Martin Pearman's MarkerClusterer. See an example here:
http://developer.martinpearman.co.uk/phpfusion7/infusions/google_my_maps...
(check out the blue + symbols)
That's pretty much the functionality we're looking for.
You can download the code here:
http://developer.martinpearman.co.uk/phpfusion7/downloads.php?cat_id=1
The last entry in the new section of Martin's blog (Jan 2010) says that v2 is still unfinished.
I too am working on integrating this with the GMAPS module. I haven't yet tested this v2 w/ the GMAPS module, but will start experimenting soon. I will PM you with an idea.
Comment #7
wildlife CreditAttribution: wildlife commentedThis is very close. When you hover on the + symbol, where it says the number of locations clustered is great. Then when you click on the + symbol, where it says "Show # links" is fine. I don't really need the "Fit map to location" or "Zoom in" options here. So really the "Show # links" ideally would just go straight to that popup rather than showing these three options. The popup that shows the titles of the locations is perfect. Then when you click on the location link, it brings up the popup for that location. That's perfect. I don't need the info about the location not unclustering that is present in the individual location popups though. But I'm sure that can be modified.
I'm doing the mapping for events. My event popup that comes up is generated through Views and has all the fields that I want showing set up. But what I would like, if possible, is something on the individual event popup that will give people the option to go back to the popup showing all the titles of the events without them having to close out the popup and start over again by clicking on the location.
I'll respond to your other message via e-mail in a bit.
Comment #8
thecodecutter CreditAttribution: thecodecutter commentedHello all,
Did anyone manage to resolve this? I have been asked to prove similar functionality regarding multiple events at a location and my Google search has landed me here.
Comment #9
wildlife CreditAttribution: wildlife commentedWe have a solution for this. One of the people that responded to our bounty has provided a new marker.js file that handles this functionality exactly as we want it. I'll get him to post his work in this thread.
Bounty on this is now closed.
Comment #10
izmeez CreditAttribution: izmeez commentedsubscribing
Comment #11
sukr_s CreditAttribution: sukr_s commentedWith some modification to the solution provided to ensure multi-language support.
Comment #12
lookatthosemoose CreditAttribution: lookatthosemoose commentedsukr_s, wildlife:
Great work on this. I've applied the patch to gmap/js/marker.js and I see the desired behavior. Attached is a screenshot for everyone's reference (screens show behavior at max-zoom level). It makes sense that these changes have to take place one level above the third party marker clusterer.
Also, for everyone's reference, I am using this in conjunction with Martin Pearman's ClusterMarker for some other desired behavior.
Comment #13
sukr_s CreditAttribution: sukr_s commented@lookatthosemoose: you can confirm that this is working by changing the status to "reviewed and tested by community", only after which the module maintainers can push this into the module.
Comment #14
rickyd1 CreditAttribution: rickyd1 commentedI am testing this patch out. However, there is no list below the text.
Is there a required field?
I have the title field in my list of fields, but it still doesn't show up in the list.
I have included the HTML and a screen shot.
Comment #15
rickyd1 CreditAttribution: rickyd1 commentedOops wrong image..
Comment #16
ikeigenwijs CreditAttribution: ikeigenwijs commentedIt sounds greet, but i cant get it to work.
I applied the patch, so far so good.
Witch settings are to be set in gmap setting spage to get this enabled?
I tried all combinations.
pleas advice.
thx a lot.
Comment #17
sukr_s CreditAttribution: sukr_s commented@rickyd1 & ikeigenwijs:
The tooltips needs to be set for the gmap row style.
View -> edit -> row style -> gmap -> settings (small gear icon once you have chosen the gmap row style) -> select "Display a tooltip when hovering over markers" -> choose the node title (assuming that your fields has Node: Title selected).
Comment #18
ikeigenwijs CreditAttribution: ikeigenwijs commentedhe thx for the help.
But i did all that and i get only 1 title instead of all the ones on that location.
Whitch setting needs to be on admin/settings/gmap ?
No manager (use GMap API directly)
Google's GMarkerManager
GMaps Utility Library MarkerManager
GMaps Utility Library MarkerClusterer
Jef Poskanzer's Clusterer
Martin Pearman's ClusterMarker
I have all of them
thx a lot
Comment #19
sukr_s CreditAttribution: sukr_s commentedI use with No manger option. I have not changed anything after the module was installed.
Comment #20
ikeigenwijs CreditAttribution: ikeigenwijs commentedI tried that option and all the others.
But i have still only 1 tooltip on the vieuw.
When i know there are more than 1 node on the same location.
Can you sent me your version?
thx a lot.
Comment #21
sukr_s CreditAttribution: sukr_s commentedI've attached my view definition. note that i have used the story content type. you'll have to adjust this. also to be very sure you may want to create two nodes with exactly the same lat/log, even a digit less / more / different will not work. if this does not help, attach your view definition and the marker.js
----------------------------------------------
http://www.drupalfx.com
Comment #22
ikeigenwijs CreditAttribution: ikeigenwijs commentedIts the same lat/long
the view en marker .js in attachment
the files
Comment #23
sukr_s CreditAttribution: sukr_s commentedI used your marker.js it works fine. but i cannot import your view since i don't have relevant content type. Thus I cannot help with that info. if you need support, you can contact me via my contact form.
----------------------------------------------
http://www.drupalfx.com
Comment #24
ikeigenwijs CreditAttribution: ikeigenwijs commentedI finally found my problem!!
In the general Gmap settings:
Marker action:
Do nothing
Open info window--> this has to be selected!
Open link -> not this
In the view:
Type ->gmap
Display a tooltip when hovering over markers (Must be cheked)
-> Tooltip field Node: Titel the others did not work
I dont dare tell you how much time i spend on this.
@sukr_s thx for the help, because of you i knew the java script was at least correct.
I m closing this, the fix works.
There is 1 improvement there should be done.
When there is a multiple marker, the hover tooltext is 1 titel instead of the count of the underlying markers.
It gives a wrong impression for the visitors.
Comment #25
ikeigenwijs CreditAttribution: ikeigenwijs commentedComment #26
mcventur CreditAttribution: mcventur commentedDo you think that this solution can be adapted to improve the module, with the petition of the next issue? http://drupal.org/node/414968
Comment #27
grasmash CreditAttribution: grasmash commentedI think this should be committed.
@ikeigenwijs- while this may not be the behavior you'd prefer, it's far better than the default behavior currently offered by the module. I think we should start with this commit and work from there.
Comment #28
grasmash CreditAttribution: grasmash commentedMoving to D7 because problem exists there as well. Patch is working in D7.
Comment #29
grasmash CreditAttribution: grasmash commentedActually, I did find one issue with this-- there's not way to set the maximum number of marker results that can be displayed in an aggregated marker list. I'm going to implement that feature and submit a patch that will address this issue as well as the one mentioned here:
http://drupal.org/node/1208420
Comment #30
bramley CreditAttribution: bramley commentedsubscribing
Comment #31
orenbus CreditAttribution: orenbus commentedsubscribing
Comment #32
ikeigenwijs CreditAttribution: ikeigenwijs commentedComment #33
Frederic wbase CreditAttribution: Frederic wbase commentedHello
I've used the js file from 'ikeigenweis' in this thread. The grouping works, but when clicking on a marker with multiple nodes i get a bubble with the text 'There are multiple items at this location. Click an item title below for more details about the item.' But the generated links don't have content between the a tags.
If i edit the html true firebug i am able to click on the generated links and every thing works fine. Does anyone has an idea?
btw, many thanks to the community for the effort on this issue!
grts
fre
Comment #34
Frederic wbase CreditAttribution: Frederic wbase commentedHello
I've changed the js file a litte bit to work with drupal 7.12, latest views & latest gmap. It just shows the titles of the nodes with a link to the node.
grts
fre
Comment #35
Carlos Miranda Levy CreditAttribution: Carlos Miranda Levy commentedsubscribe
Comment #36
webservant316 CreditAttribution: webservant316 commentedsubscribe - need to fix this asap also, but for gmap 6.x
Comment #37
webservant316 CreditAttribution: webservant316 commented#11 works great for me on gmap 6.x-1.x-dev.
To get it to work...
1. Gmap default marker action needs to be pop-up window.
2. No marker manager is needed
3. View page style of Gmap must specify a 'Tool tip' which is used for the link list pop-up.
However...
4. One problem, the marker 'Tool tip' with multiple nodes picks one node at random for the hover text.
How can I change this hover text to be "Click for a list".
@ikeigenwijs also noted the same problem in #24 above.
Any solutions anyone? I am searching the code and the patch for a place to make this change.
Any help would be greatly appreciated.
Jeff
Comment #38
webservant316 CreditAttribution: webservant316 commentedI've updated the patch in #11 in order to display the tooltips properly for list popups as well. If there is one location at a marker the tooltip specified in Views is used. If there is a list of locations the tooltip says 'Click for item list'. I also tuned up the list popup text a bit as well for a more general use case.
Changes were needed in marker.js and gmap.module.txt. It is truly a hack, so perhaps these features can be properly intregated into the module at some point. Also I do not have the tools to make a git patch, so perhaps someone get help there.
One last note. I also included another hack in gmap.module.txt to NOT display a popup at all when there is only one marker on the map. In my use case the popup was problematic for single marker location maps on a node, because the map was smaller, the popup didn't fit in the space and it wasn't needed anyway because the location vcard was already being displayed.
Here is the css I used to make things nice for me.
Hope that helps someone,
Jeff
Comment #39
DalSegno CreditAttribution: DalSegno commentedThanks for fixing the tooltips, Jeff. To make them translatable, I wrapped the text strings in gmap.module in t(' '). The text strings for the popups in the marker.js I translated in the code for now. I guess the strings could be moved to gmap.module (and then passed to marker.js as variables) to make them translatable as well?
david
Comment #40
webservant316 CreditAttribution: webservant316 commentedprobably. my hope is that someone will take my work in #38 and clean it up into a proper patch that is eventually added to the module. the work I did really was a stretch for me, but it does work great.
Comment #41
flugga CreditAttribution: flugga commentedsubscribe
Comment #42
flugga CreditAttribution: flugga commentedAgreed webservant316. I am looking forwarded to someone picking this up and properly integrating it!
Comment #43
yehmai CreditAttribution: yehmai commentedI have applied #38 on gmap "6.x-1.1" datestamp = "1278426618". The pop up windows is there. Just no node title were listed.
Then I went inside the marker.js to check showMultipleNodes = function(marker). It seems that the Drupal.settings.gmap['markerlist'][marker.latitude][marker.longitude].['opts']['title_list'] was "" (empty string).
However I did turn on the tool_tips and make sure the view has "Display a tooltip when hovering over markers" of Node:title. Any idea why this happened?
Thanks,
Yeh
Comment #44
webservant316 CreditAttribution: webservant316 commentedhmm, not sure. perhaps check the php code where [marker.latitude][marker.longitude].['opts']['title_list'] is assigned.
Comment #45
podarokcan You provide a patch against latest 7.x-2.x, 7.x-1.x ?
Comment #46
podaroktest
Comment #48
podarokproper version
Comment #49
podarok#11: 1139088-muliple-node-markers-9-D6.patch queued for re-testing.
Comment #51
Jason Dean CreditAttribution: Jason Dean commentedThese tweaks to marker.js are useful, but after playing around with it for a day I found OpenLayers to be a cleaner solution.
Using OpenLayers, I could apply grouping to my view (grouping rows with the same lat/long position). When using Gmap, grouping just seems to output a map for each group. OpenLayers has great tooltip and popup list functionality too (with scrolling for long lists etc).
I don't know how advanced OpenLayers is for D6, but definitely the way to go for D7.
Comment #52
designate CreditAttribution: designate commentedThe marker patch was working great for version 6.x-1.1 but since the API change at Google no longer for 6.x.2.0-beta1. Anybody suffering the same and/or found a solutions already?
Comment #53
webservant316 CreditAttribution: webservant316 commentednot sure what problems you are seeing, but the marker patch still works for me. however, I did need to install this 'location' module patch - http://drupal.org/node/1944120
Comment #54
designate CreditAttribution: designate commentedInstalled location module patch you mentioned on latest .dev version as well as marker.js from #38. When I overwrite the [original] marker.js with #38 nog markers are shown on map while - I made an attachment with nearest locations in text output - show some locations upon querry. While using original marker.js which came with module markers are also shown on the map without showing multiple nodes [i.e. 2] on same lat/lon.
Comment #55
webservant316 CreditAttribution: webservant316 commentedHere are all the patched versions of the files I am currently using for my mapping efforts.
location 6.x-3.2
google.inc
gmap 6.x-1.1
gmap.module.txt
gmap.taxonomy.module
marker.hs
These patched files enable me to
1. Display the tooltips properly for list popups.
2. Don't display a popup at all when there is only one marker on the map.
I also use this CSS
.gmap-popup {
width: 300px ! important;
margin: 0 0 10px 0 ! important;
font-size: 90% ! important;
}
And at https://code.google.com/apis/console I have turned on both Google Maps API v2 and Google Maps API v3.
Comment #56
podarokhttp://drupal.org/patch
This is not patches
Comment #57
webservant316 CreditAttribution: webservant316 commentedSorry, I don't have the tools to make patches. Maybe else someone can help.
Comment #58
designate CreditAttribution: designate commented@webservant316, thanks for the files but I'm still not getting markers on the map with markers.js patched.
Comment #59
webservant316 CreditAttribution: webservant316 commentedAre you creating a view with style type 'gmap'? Is it configured properly? You will need to add the field type node:marker. You also need to create a relationship with the Location table and add that field as well. My code also assume a few additional CCK fields for my use case only. There are also tons of settings for the location, gmap, and gmap_location module. Too much to get into here. Sounds like something is not configured properly. Also check your php error log to see if that gives you a clue.
Comment #60
keraweb CreditAttribution: keraweb commentedIs there a version for the GM API v3 aswell?? I really need this functionality!
Comment #61
keraweb CreditAttribution: keraweb commentedI started a API v3 version myself since i'm kinda in a hurry.
I will upload a version with this post where I've tried to implement these functions. It doesn't work completely.
I can't figure out how I can get the link to open the detailed popup from the combined one.
Maybe someone else can finish this.
I found a solution for what I needed, In my own version (not the one I upload here) I've created a custom function where the popup of a combined marker directly includes the complete text of all the markers it combined.
If anyone is interested in that function, please let me know.
Comment #62
drupalfmm CreditAttribution: drupalfmm commentedI use 'GMaps Utility Library MarkerClusterer'.
"MarkerManager improved is the open source version of GMarkerManager. To use, you must download it from here and place it in the thirdparty folder."
Menu: admin / config / services / gmap
Comment #63
nvl.sateesh CreditAttribution: nvl.sateesh commentedhi,
thanks for the v3 marker.js. can you please provide the function you used to get the data.
when i use the marker3, i get the text that says there are multiple listings, but it does not show any items below.
also, when i use this with block view it seems to ignore the contextual filters and shows all the locations
thanks.
Comment #64
keraweb CreditAttribution: keraweb commentedSorry for my extremely late responce.
I've uploaded the complete marker.js that I use now. I've added some custom functions to the script that do what I need them to do.
For a working example (it's in dutch): http://www.druyoga.nl/dru-yoga/vind-een-dru-yoga-docent
Comment #65
johanhaest CreditAttribution: johanhaest commentedI just applied the marker js, and it works like a charm for me. Thanks!
Comment #66
Zsanna CreditAttribution: Zsanna commentedIt says "undefined". How do I set them to show node titles?
Comment #67
devad CreditAttribution: devad commentedI have used "GMap RMT for markers" option to display data from multiple nodes that have the same lat/long coordinates in one info window.
GMap RMT for markers option is nicely described here: #2108919: RMT option
Once, you have the views power in your hand to create info window... it's easy.
Comment #68
Kniekel CreditAttribution: Kniekel commentedThank you Devad for this hint.
How do you "transport" the info from the map to the bubbles?
Until now, I used "nid" as RMT field. This works really fine, but then, I only have ONE node in the bubble. I can't find the trick to get several nodes in one bubble.
Configuring it with Views will be easy then, of course. :-)
Comment #69
devad CreditAttribution: devad commentedYou are welcome Kniekel
I had a usecase where I had needed to display multiple hotel offers in one bubble.
I got several nodes into one bubble using views relationships. It was easy for me since my offers had "Hotel" (node) entityreference field.
Working example: http://relaxino.com/en/offers
If your nodes with same location are not "grouped" by some kind of reference field but locations are "hardcoded" directly into nodes with same location... that's a different usecase from mine.
Comment #70
SeanA CreditAttribution: SeanA commentedComment #71
cardamomclouds CreditAttribution: cardamomclouds commented6 year old thread. I hope i can help someone in the future! or perhaps turn my code into a patch (i don't yet know how)
This is the portion i rewrote into gmap.module:
1.The first loop is part of the original construction.
2. I then add the $new_text variable and set it to the first marker's text.
3.Then I compare all other markers that have the same latitude and longitude and do not contain a line break(see 4)
4. I concatenate $new_text with a line break and the matching marker's text.
5. I then loop back over the whole stack so that all markers with the same coordinates will have ALL the values, equal to a
$new_text
6. The last loop is part of the original construction that adds a div for the pop up bubble text.
Three 2 extra loops seemed unnecessary, but it was the only way I could prevent duplicate texts.
A note on step 3: Since Gmap is limited to one field per bubble text, I didn't think using a line break would be a bad way to differentiate between which $marker['text] or $marker2['text] had been looped over or not. I suppose you could run stripos to see whether or not the first iteration contains the second within it, but this wasn't working for me.
Hope this helps someone!
Comment #72
charlysole CreditAttribution: charlysole commentedHi cardamomclouds
I have tested your code, and it works, but showing duplicates...
3 times for each result.
Any clues?
Thanks!
Comment #73
Saratt CreditAttribution: Saratt commentedHi charlysole,
Were you able to fix the duplicates issue?
Thank you.
Comment #74
fillmorejd CreditAttribution: fillmorejd commentedHere is updated code that will not have the duplicates.
Comment #75
Saratt CreditAttribution: Saratt commentedThank you @fillmorejd. That worked for me.
Comment #76
charlysole CreditAttribution: charlysole commentedThank you @fillmorejd. That worked for me too!
Should be included in dev
Comment #77
podarok@fillmorejd could you please create a patch to be included to dev?
Comment #78
ikeigenwijs CreditAttribution: ikeigenwijs commentedRolled in to a patch. Needs to be tested.
I think i found the right section.
Next time mention the file and the line nr