Setting: I have enabled the Gmap Location block on individual node pages of Event content type so that a map of the location of each event is show on the full node page. In the gmap module, "show info bubble" is turned on for when markers are clicked.

Behavior: On clicking the marker within the block, an empty bubble appears.

Expected behavior: Some node content would be shown in the info bubble like with the node map visible at site/map/node.

Question: How can this be customized? I would like atleast some Node data to show in that bubble. For example: Event start time or Location name.

Comments

Daryljames’s picture

I'm seeing the same behavior

hessebar’s picture

I am having the same issue. I tried to use a views block that dispaly on a location node, but the block shows all the nodes. I tried filter by nid to display only the location node I am on. also I tried arguments. Still have no luck.

ajzz’s picture

Should we promote this topic from support request to bug report?

pixelenvy’s picture

Try setting the row style to 'fields' in your view and see if that returns some content in the info window? There's also an issue with using the latest releases of views and gmap together.

I'm using views 6.x-2.6 with gmap 6.x-1.x-dev and got it working like this.

ajzz’s picture

@pixelenvy: thanks for the tip. I am using and want the functionality of the location map block that comes with the gmap location module, which will allow the block to be shown only on nodes where location information exists. I tried creating a views block but the only the field labels show up, while the field data do not. Also, there is no easy way to control showing the block only on pages with location info.

I'd like to be able to customize the bubble info in the block that comes with the module, because it already provides the functionality I seek.

dan.crouthamel’s picture

I'm seeing the same thing and I think it started happening after updating to the latest version of views. I noticed that $fields['field']->content is empty, where before it actually had info. I'll try using the latest dev version of gmap to see if that solves the issue.

OK - updating to the latest dev version solved the problem for me.

ajzz’s picture

Version: 6.x-1.x-dev » 6.x-1.1-rc1

Here's the behavior of the Marker in the default "Location Map" block that ships with the module, when enabled in node content.

CVS TAG: Behavior (note the settings are "Open Info Bubble" in GMap Location for all cases below)

DRUPAL-6--1-0: No bubble on click
DRUPAL-6--1-1-RC1: Bubble opens, but no information inside it.
HEAD: No bubble on click (note there is a db update in node_location between RC1 and HEAD)

Changing the version of this issue to RC1 release

greggles’s picture

I think this is probably a duplicate or at least very similar to #623234: Views 2.7 - breaks field output - GMap marker info window (bubble) doesn't display fields correctly though the "node location" map is served up slightly differently than nodes (I think).

ajzz’s picture

@greggles: this thread is independent of Views module. the context here is the stock "Location Map" block that comes with the module. You're right that the solution may be similar, but I need help figuring out what that may be.

ajzz’s picture

Title: Info Bubble Empty in Gmap Location Block for Node Location » Info Bubble Empty in Module-Created "Location Map" Block for Individual Nodes with Locations

Clarified title to prevent confusion with similar Views related issues noted in #8.

ctalley5’s picture

Same. Subscribe...

ajzz’s picture

Category: support » bug

Promoting to bug report since this issue ships with current code and is not "by design".

KrisG’s picture

Subscribe

mathieu’s picture

subscribe

weblance’s picture

subscribe

franksweb’s picture

subscribe

bailsbails’s picture

Version: 6.x-1.1-rc1 » 6.x-1.0

Hi i've faced this issue and rolling back to views-6.x-2.6 Fixes my missing bubble info.

edg’s picture

subscribe

ajzz’s picture

Version: 6.x-1.0 » 6.x-1.1-rc1

@bailsbails: if you read the thread above, you'll realize this thread is not a views (block) related issue. this is for the block that ships with module which does not require views module.

Ela’s picture

+1

eliosh’s picture

I think i found the problem:


/**
 * Gmap element theme hook
 */
function theme_gmap($element) {

[...CUT...]

  // Add a class around map bubble contents.
  // @@@ Bdragon sez: Becw, this doesn't belong here. Theming needs to get fixed instead..
  if (isset($map['markers'])) {
    foreach ($map['markers'] as $i => $marker) {
      $map['markers'][$i]['text'] = '<div class="gmap-popup">' . $marker['text'] . '</div>';
    }
  }

[...CUT...]

}

As you can see, it tries to print $marker['text'] as info bubble content.

But if we take a look at the block view function:


function gmap_location_block_view($nid) {
[...CUT...]
        $markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
        );
[...CUT...]
}

we can see that we don't have the "text" attribute....

I'll try to fix that with a patch. Stay tuned :-D

eliosh’s picture

As i said before, i found a solution adding this line:

'text' => theme('gmap_location_infowindow_node', $node),

to the $markers array item.

It works.

Ela’s picture

Could you point me out in the direction exactly where to add this code?

eliosh’s picture

Status: Active » Needs review

file is gmap_location.module

function name is

function gmap_location_block_view($nid) {

region in function is :

        $markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'text' => theme('gmap_location_infowindow_node', $node),
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
        );
jim22’s picture

This didn't work for me. It doesn't work in a "page" View, or a "block" View. I still get empty info windows (balloons) in Gmap. When I turn on the labels for any fields in my View, I am getting the labels correctly in info window, but not the field data.

Any ideas?

Thanks.

I'm using:
Drupal 6.15
Views 6.x-2.x-dev (downloaded Jan 18th, 2010) (I tried multiple versions of Views, with no luck.)
Gmap 6.x-1.0 ( I tried to install Gmap's latest dev version, but it's still showing up 1.0 )

Ela’s picture

Status: Needs review » Active

Works great, but once clicked the whole node loads into the info bubble..
How would one set it up to only show location, like city, state, or location name?

Ela’s picture

adding
'text' => $markertitle,
instead adds the title of the node.. so that's better for me for now..
Does anyone know how to put the location detailed info there instead?

pawel.traczynski’s picture

Tha best way to pass anything to be displayed inside the bubble is to use the gmap_simple_map() function.

You can add this function inside your theme's node.tpl.php file or node-[nodetype].tpl.php file of the node type that you want to display the map for, like so:

<?php

// We create bubble contents - use any data you need, like node title or location details, or some cck field value
$bubbleText = "<strong>". $title ."</strong><br />".
			  $location['street'] ."<br />". 
			  $location['postal_code'] ."<br />". 
			  $location['city'] ."<br />".
			  $field_some_cck_field[0]['view'];

// We check the latitude and longitude stored in the node			  
$latitude = $location['latitude'];
$longitude = $location['longitude'];

// now we'll display the map using gmap_simple_map
//PARAMETERS: latitude, longitude, marker_name, what to show in a bubble, default zoom, width, height, autoshow marker bubble
print gmap_simple_map($latitude, $longitude, 'default', $bubbleText, 14, '100%', '400px', TRUE, '');

?>

This method works very well and allows to easily insert anything inside the bubble.

Hope it helps.
Cheers.

Ela’s picture

Hi there..
This might be a silly question, but is gmap_simple_map part of the gmap module?

bstrange’s picture

Tried all the suggestions above and #28 and no love for my bubbles... at this point I would just be overjoyed with the gmap macro code to disable the bubble all together as the "location map" block ignores the fact that I have marker action "do nothing" chosen in gmap settings.

At least that way it would look intentional rather than looking broken :P

pawel.traczynski’s picture

Hey. Of course it is. You can check it out if you wan't - open the gmap.module file and navigate to the line 1124 to see its implementation.

aJob’s picture

Gmap 6.x-1.x-dev made me happy again!

Ela’s picture

hi Pawel :)
Map shows, with no marker and I get an error: "Request for invalid marker set default!"
Any tips?

greggles’s picture

Status: Active » Fixed

given aJob's comment marking this fixed.

hinanui’s picture

If it can help anyone, to get directions from the bubble, I have used the solution #24 and some other code found somewhere else:

$markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
          'text' => '<form action="http://maps.google.com/maps" method="get" target="_blank"><b>Get Directions</b><br /><span class="descriptor">Start address:</span><br /><input type="text" SIZE=40 MAXLENGTH=40 name="saddr" id="saddr" value="Street, City" class=descriptor  onFocus="this.value=\'\';" /><br><INPUT value="Get Directions" TYPE="SUBMIT" class=descriptor><input type="hidden" name="daddr" value="'.$loc['street'].', '.$loc['city'].', '.$loc['country_name'].'"/></form>',
        );
bstrange’s picture

at #34:

The Dev version worked great for preventing an 'empty' info bubble, however, as I had it set as "Do Nothing" in GMap and GMap Location in attempt to 'fix' the empty info bubble, now no matter what I choose in the settings, the marker 'does nothing'.

While this is better than 'empty' I would love it to display the location info in the marker. I have cleared site cache, regenerated the marker cache, nothing seems to work... it appears that whatever option you had selected when applying the Dev version is what you are 'stuck' with, but maybe I am missing something.

Any help would be greatly appreciated!

Weka’s picture

Subscribe

likewhoa’s picture

Subscribe

Ela’s picture

Status: Fixed » Active

should not be marked fixed if people are still having questions and are unable to get this to work for them :)

yogo2000’s picture

It works for me too !!!

just desactivate gmap module,
then uninstall gmap module and gmap taxonomy marker,
and remove the gmap directory

decompress the gmap-dev...tar.gz in /modules,
activate the module and
redo the gmap setup (google api key, default setup) and save

Thanks a lot, aJob !

bstrange’s picture

OK so I had a site that never had Gmap or Location installed. I installed the dev version, made sure all settings in gmap and gmap location were set to "open info window", enabled the location map block and then created a location based node. The marker does not display an empty info bubble, because it does not display an info bubble at all.

I like I said before, this is better than an empty info bubble as it looks intentional at least, but having the location information in the bubble would be better :P

It also appears that since updating to Dev, my node locations page no longer has any markers. The individual nodes all have a working location map block and marker; however the node locations page does not...

ad4m’s picture

Status: Active » Needs review
StatusFileSize
new471 bytes

Hi,

I've had the same issue and I think I found a solution. Attaching a patch.

benstallings’s picture

Bless you, ad4m. That solved my problem.

marshallexcavating’s picture

@ad4m, Dose your Patch #42 fix the problem of no information displayed in the map pins when clicked or just make it possible to deactivate the map pins? I am having both problems(title but no content in pins when clicked, and can not disable click on pins to open). Both where working before I upgraded the module.

Thank you

marshallexcavating’s picture

Please what problem dose patch from #42 ad4m fix?

Thank you.

freddy33r’s picture

Instructions found on #40 helped me. It works. Now the data in the infoWindow is not empty. I still need to style it though

ashley.maher@didymodesigns.com.au’s picture

ad4m,

#42,

Solved my missing information in the bubble problem.

Thanks.

Regards,

Ashley Maher (didymo)

wolfram’s picture

solved it for me too 1000 thx #42

sethhavens’s picture

subscribing... gonna try patch

4aficiona2’s picture

... for #33

This error appears because the default value for markername is an empty '' instead of 'default' as it was mentioned above ...
Have a look at the function call below (third param).

Additionaly the location properties were read directly from $node->location instead of $location ... works for me, and no more empty infowindows ...

    <?php
    // We create bubble contents - use any data you need, like node title or location details, or some cck field value
    $bubbleText = "<strong>". $title ."</strong><br />".
                  $node->location['street'] ."<br />".
                  $node->location['postal_code'] ."<br />".
                  $node->location['city'] ."<br />";
    
    // We check the latitude and longitude stored in the node             
    $latitude = $node->location['latitude'];
    $longitude = $node->location['longitude'];
    
    // now we'll display the map using gmap_simple_map
    //PARAMETERS: latitude, longitude, marker_name, what to show in a bubble, default zoom, width, height, autoshow marker bubble
    print gmap_simple_map($latitude, $longitude, '', $bubbleText, 'default', 'default', 'default', TRUE, '');
    ?>
sethhavens’s picture

no joy with patch :-( have now tried to change click marker behaviour, set to "open link" and still getting empty info bubbles... hmmm!

trying dev version next

sethhavens’s picture

tried dev version... now clicking marker simply does nothing, regardless of settings - better than an empty bubble though!

everything else seems fine, including the "See map: Google Maps" link which I'm going to utilise instead

ctalley5’s picture

Dev. Fixed it for me as well.

jrchew’s picture

#42 worked perfectly! Thanks a million!

m.sant’s picture

#42 works against GMap Module 6.x-1.1-rc1 using Drupal 6.16, Location 6.x-3.x-dev and Views 6.x-2.8

Many thanks to ad4m

baal32’s picture

Version: 6.x-1.1 » 6.x-1.1-rc1
Status: Patch (to be ported) » Needs review

I'm a newbie so take with a grain of salt, but patch #42 appears to solve the issue wherein info bubbles are empty *in the context of gmap views* - it does not appear to change the behavior of the 'Location Block' delivered by gmap_location.module. It appears these are separate issues.

As noted above (#24), the lack of a 'text' key appears to be causing the problem. For a quick sanity check I added the 'text' key below:

(line 678 in modules/gmap/gmap_location.module)
$markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
          'text' => 'test' <------- added this

and sure enough my bubbles for the location block all say 'test'. My gmap views, however, still work fine (thanks to the patch in #42).

One workaround might be to forgo the location block altogether and instead create a gmap view that takes an argument (the nid) and create a block display from it. Doesn't seem like an optimal solution however....

rbayliss’s picture

Likewise, #42 fixed the problem instantly. Thank you!

grendzy’s picture

Status: Needs review » Fixed

As mentioned in #34, this has been fixed in the latest dev.
http://drupalcode.org/viewvc/drupal/contributions/modules/gmap/gmap_plug...

If after upgrading to the latest -dev version you are still having issues, I think it would be better to open a new issue.

Status: Fixed » Closed (fixed)

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

brentratliff’s picture

subscribing

bstrange’s picture

Status: Closed (fixed) » Active

Ok so I have tried 6.x-1.x-dev on a 3rd, fresh site, Dev does not fix the problem. It removes the empty info bubble. It does NOT fix it so there is information IN the bubble.

6.x-1.1-rc1 had empty bubble. Tied patch in #42 with no luck.

Will try patch in #42 against dev version, but this error is still everpresent.

I'd also like to try #50, but I'm not sure where he applied that code.

It is important to note that this is a problem with Location Map block, NOT with gmap block and views... not sure if #32 and 58 are aware of this but all the Dev version does is remove the ability for you to have an info bubble.

I suppose I could use views and arguments to produce a node specific map but this way is sooooooo much easier... if it worked.

I'd also like to add that as stated above, no bubble is better than an empty bubble, but there is still an error that needs to be resolved.

I have mentioned this in #36 and 41, and personally find it irresponsible for the status to be set to 'fixed' when it is not. Regardless of whether #42 fixes this once I patch it against Dev, it still doesn't qualify the issue as fixed, just 'patched by user'.

Edit to add:

42 does NOT work against dev. Dev already contains the code from #42 on lines 142-145

foreach ($records as $row_index => $row) {
        $this->view->row_index = $row_index;
        $lat = (float)$row->{$lat_field};
        $lon = (float)$row->{$lon_field};

maybe the fix from #50 would work if I had any idea where to apply it...

organicwire’s picture

I assume that it's better to have no bubble at all if there's no text for the bubble than having a buggy bubble. Therefore in sites/all/modules/gmap/gmap.module i changed the following:

Old code

<?php
function theme_gmap($element) {
...
  if (isset($map['markers'])) {
    foreach ($map['markers'] as $i => $marker) {
      $map['markers'][$i]['text'] = '<div class="gmap-popup">' . $marker['text'] . '</div>';
    }
  }
...
?>

Here HTML code is created as the markers text attribute even in the case that the marker's text is not set. This causes an empty bubble to be created.

New code (with an IF-clause checking for the text attribute)

<?php
function theme_gmap($element) {
...
  if (isset($map['markers'])) {
    foreach ($map['markers'] as $i => $marker) {
      if ($marker['text'])
        $map['markers'][$i]['text'] = '<div class="gmap-popup">' . $marker['text'] . '</div>';
    }
  }
...
?>
Durrok’s picture

Appears to be fixed in 6.x-1.1.

andrewtf’s picture

Just updated my GMap module to 6.x-1.1 (from 6.x-1.1-rc1) and still experiencing the problem.

pawel.traczynski’s picture

Answer to #29 - It sure is :-)

kappaluppa’s picture

HALLELUJAH!!!!! #50 WORKED!! thank you @pawel.traczynski for pasting the code and @zoorock for helping to clear up the error!!

AndreyN’s picture

Version: 6.x-1.1-rc1 » 6.x-1.1

I use Gmap module 6x-1.1 and get emtpy bubble.

Make patch for gmap_location.module:

        $markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
          // This string fill bubble  
          'text' => '<h3>'.$loc['name'].'</h3><p>'. $loc['street'].'<br />'. $loc['additional'].'</p>', 
        );

It's work for me.

jeffschuler’s picture

StatusFileSize
new988 bytes

AndreyN's suggestion in #67 worked for me.

Here's a patch doing the same thing, with a little more formatting, (though US-address centric.)

This would, ideally, pull in the location module's default address formatting, -- is there a theme function to use? -- or create our own theme function to allow easy overriding.

This patch works for 6.x-1.1, though not 6.x-1.x-dev, though it applies.

pedroportella’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new534 bytes

This is the patch for the comment #24.

<?php
        $markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'text' => theme('gmap_location_infowindow_node', $node),
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
        );
?>

Now on my template.php I can have something like:

<?php
function mytheme_gmap_location_infowindow_node($node) {
  return '<div class="gmapnodelabel gmapnodelabel-'. form_clean_id($node->type) .
    '">'. 'Whatever I want' .'</div>'; // make sure it all goes on one line.
}
?>
amstel’s picture

Version: 6.x-1.1-rc1 » 6.x-1.1
Status: Needs review » Patch (to be ported)

#67 also worked for me, plus I added some extra information to the bubble. I wanted to have an URL for each location, so I used the location fax module and changed it's name for website.

        $markers[] = array(
          'latitude' => $loc['latitude'],
          'longitude' => $loc['longitude'],
          'markername' => $markername,
          'text' => '<h3>'.$loc['name'].'</h3><p>'. $loc['street'].'<br />'. $loc['additional'] . $loc['city'].'<br />'. $loc['phone'].'<br />'. l($loc['fax'], $loc['fax']) .'<br />'.'</p>', // added bubble info
          'offset' => $count-1,
          'opts' => array('title' => $markertitle),
        );

For those who could not apply the patch of #69 like me, just edit gmap_location.module and add the 'text ' line.

podarok’s picture

Version: 6.x-1.1 » 7.x-2.x-dev
Status: Patch (to be ported) » Postponed (maintainer needs more info)

can You provide a patch against latest dev?

6.x minimally supported after porting this for latest release

summit’s picture

Issue summary: View changes

Hi, Yes please a patch for info bubble on 7.dev!
Greetings, Martijn

navi85sin’s picture

I was able to get info in bubble on url /locationmap

But i was not able to get anything in bubble in location map block.

I have changed the following code in locationmap.js

     var infowindow = new google.maps.InfoWindow({
        content: Drupal.settings.locationmap.info
      });

Change the above code with :

     if(typeof Drupal.settings.locationmap.info.value != 'undefined') {
        var mark_info = Drupal.settings.locationmap.info.value
      } else {
        var mark_info = Drupal.settings.locationmap.info
      }

      var infowindow = new google.maps.InfoWindow({
        content: mark_info
      });
benstallings’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.