I'm attempting to create the usual sort of map in which makers appear, and when the user clicks on them it displays a bubble with the title of the marked node, an image, and maybe a short description.

Unfortunately when I click on a maker it doesn't do anything (not even produce a JavaScript error). Am I missing something?

My locations are coming from fields. I've tried using a "Row Style" of both Fields and Node, but that doesn't affect anything...

Comments

pollegie’s picture

I found myself in the same situation. Got a nice created view. The markers are show, but no balloon/bubble is showing when clicking.

on example.com/map/node/ the balloons/bubbles are showing correctly. Only not in views.

ookami.kb’s picture

subscribing

jhm’s picture

Under admin/config/services/gmap, what have you selected for Marker Action?

ankur’s picture

Category: support » bug
Status: Active » Closed (fixed)
StatusFileSize
new4.02 KB

I've committed the attached patch.

It makes an addition to the settings form of the gmap format, when you're using the gmap format for a view display.

It allows you to enable bubbles and to select the field you want rendered in the bubble. If you want to render contents from more than one field in the bubble, my suggestion would be to select all your fields and to "exclude from display" all but the last field. Then, in the last field, rewrite the output of the field to use placeholders for outputting the value of the (now excluded) previous fields.

For example, I have a view where I've selected an image field ("field_image"), the aliased content-path of the node result, and the node title. My placeholders are [field_image], [path], and [title]. I've excluded field_image and path. I've configured [field_image] to render as a link to the node. I've configured the settings for my gmap format to display title in the bubble. Finally, I've configured my title so that I rewrite the output to be (using these placeholders):

  [field_image]<br/>
  <a href="[path]">[title]</a>

If you have a git checkout of the 7.x-1.x branch, a pull should get you up to date. Otherwise, wait until the 7.x-1.x-dev snapshot release date on the project home page is updated to the date of this comment.

rjacobs’s picture

Status: Closed (fixed) » Needs work

The comment in #4 is great advice, and I too have been playing with the idea of rewriting the output of a single field in order to include several other fields within it (and thus satisfy the single field requirement for the bubble content). However I am seeing some strange results when I do this.

What I've noticed is that as long as I assign a single, normal (non-re-written), field to the bubble content, everything works fine, but as soon as I start assigning a rewritten field to the bubble content, views seems to loose the ability to differentiate between each node it's plotting. In other words, if I use a re-written field for my bubble content, all of my mapped notes contain the same bubble content (it appears that they all default to displaying the bubble content from - and linking to - the node with the earliest create date in the view).

Despite this, the location markers still appear in the right places.

I've tried various combinations of fields in my rewrite definition, and I've tried defining the location from a cck field and from a standard node location, always with the same results.

I'm happy to share more about this as needed. Is anyone else experiencing this?

Currently I'm using:
gmap 7.x-1.x-dev (2011-Sep-24) - I've confirmed that the patch from #4 is included
location 7.x-3.x-dev (2011-Sep-10)

rjacobs’s picture

Ok, after a bit more investigation, I think I can get a bit more specific (and hopefully provide more details about how to reproduce the problem noted in #5).

Let's say we have 3 fields in our gmap view:

Content: Location (excluded from display)
Content: Nid (excluded from display)
Content: Title

And we have re-written the output of "Content: Title" to be something like:

<strong>[title]</strong><br/>
[field_location]
[nid]

And our "Bubble pop-up field" is set to "Content: Title".

What happens is that each bubble will contain the correct title (Content: Title) but will not contain the correct Location (Content: Location) or nid (Content: Nid). In fact, the location and nid will show the values taken from what appears to be the earliest created node in the view set. It's as if the tokens (replacement patters) in the re-written field are not getting generated/injected correctly.

Perhaps these is another required step, or a configuration option that needs to be checked, in order to get the approach outlined in #4 working?

pollegie’s picture

Same issues here. All bubbles have the same content. Would love to see a solution to show the bubbles correct.

Liam_Mc’s picture

I'm having exactly the same problem as described in #5 - rewritten field [title], which is selected for the pop up, shows the title correctly but then the same fields for the rest of the content for all markers. The markers are in the right place though.
Any help, advice would be most appreciated.
(Drupal 7.8, GMap 7.x-1.x-dev, Location 7.x-3.x-dev)

ankur’s picture

Status: Needs work » Closed (fixed)
StatusFileSize
new1.16 KB

I've committed the attached path to the 7.x-1.x branch. If the dev release on the project homepage is updated to around the time of this comment, it should contain the fix.

pollegie’s picture

Works like a charm! Got myself a nice map here: http://www.topliftstaja.nl/dealers

Thanx

summit’s picture

Issue summary: View changes

Latest dev version no bubble on views marker with Gmap regular...
greetings, Martijn

bmunslow’s picture

@Summit This issue is fixed in the gmap 7.x-2.11-beta1 release.

summit’s picture

Great, THANKS, Martijn