Hello, I have set up a map with lots of locations and originally had it set up so that clicking on a marker linked straight to the node. Now I want to have it bring up an info window with the node title and first image from the cck imagefield. Most of this is set up perfectly with a clickable link and clickable image. However the container for the info window doesn't expand to include the image (see attached). The image in the view field is an imagecache thumbnail.

You can view the map here if you like:
http://www.phanaeinionline.co.uk/species_map

Some markers won't bring up images as not all nodes have images yet.

Is it possible to get rid of the latitude and longitude? Presumably they need to be included in the view fields so that it can actually map the markers, but I don't really want them showing in the info window.

Many thanks
Matt

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BWPanda’s picture

Title: Info window isn't expanding to include image thumbnail » Info window isn't expanding to include images
Version: 5.x-1.0-rc2 » 6.x-1.x-dev
Issue tags: +image, +info window, +expand

Marked http://drupal.org/node/371326 as a duplicate of this issue. Also changed version to 6.x-1.x-dev as it still happens there.

I'm having the same problem, and I think it's because the height of the windows are calculated before the image loads (hence my request for preloading content).
This can be tested by clearing your browser cache, then viewing an info window with an image (it will appear as per your screenshot). If you then close the info window and open that same one again, because the image is now in your browser's cache, the window should expand to include the whole image.
Just need someone to work out how to preload info window content, or not calculate window dimensions before images have fully loaded...

As for getting rid of the Lat/Long values, you simply choose not to display them (even though they're included in the view, they don't have to actually appear...)
However, as you're using Views 1, I'm not sure if this is possible. You may need to create a custom .tpl.php file and hide the fields using that. Failing all else, you can just use CSS to display: none; the Lat/Long fields.
Hope that helps!

chaloalvarezj’s picture

subscribe

matthew_ellis24’s picture

all of my images are the same height so I tried to enforce a height on the window using CSS using the class gmap-popup. However this gives each of the elements within it that height rather than the applying it to the window itself. Further attempts to do anything with CSS seem to be thwarted by me not knowing what I'm doing as the classes field_images_fid and title and latitude/longitude seem to be ignored.

chaloalvarezj’s picture

Title: Info window isn't expanding to include images » Info window isn't expanding to info window content
Category: support » bug

Changed the title as this issue is not only for images but for the entire info window content.
The latest 6.x.1.1-rc1 has the same bug.

Any workaround?

chaloalvarezj’s picture

Title: Info window isn't expanding to info window content » Info window isn't expanding to contain info window content
greg.harvey’s picture

+1 on this!

Also seeing this issue, "bubbles" are not expanding to take all the CCK fields exposed in a GMap view. They always seem to be about 20px too short. Had a look at the code, but it's complicated and I don't have time right now to try and work out how/where the dimensions are being generated. =(

greg.harvey’s picture

FileSize
67.08 KB

See attached screenshot for reference. As I add more fields, it does grow but is always a little too small. The bottom is not being drawn in the right place.

chaloalvarezj’s picture

Hi there,
I found a temporary solution when displaying the teaser inside the info window.
I added a div tag of about 50 px height after all the fields (adding two p tags also worked). This workaround was good for firefox and ie but not for safari.
Still waiting for a definitive solution...

Cheers

greg.harvey’s picture

Thanks! Neat temporary workaround - didn't think of that. =)

joostvdl’s picture

+1

cm983’s picture

hey guys where do you put the div or the p tag exactly - im having the same issue also . not all the fields entered are showing up . especially the title field which is th e most important for me

daytripscanada’s picture

daytripscanada’s picture

Has there been any progress made on this issue?

pbarnett’s picture

Not as far as I'm aware; I was sure that the 'adding a div/break/whatever' route looked like a workaround until I realised that the images were cached by my browser when I changed the code, and the uncached page still had popups that looked like cr@p - I worked around the issue with images in a D5.x Views 1 page by overriding theme_views_view_gmap with phptemplate_views_view_gmap in my theme's template.php file, and adding the images wrapped in a div styled like this

.cr-map-cached-image {
 position: absolute;
 top: 0;
 left: 0;
 width: 1px;
 height: 1px;
 overflow: hidden;
}

to the output before returning theme('gmap', $thismap)

It's a bodge, not a fix, but it works - see http://mongolia.charityrallies.org/teams/members/map/gb

Surprisingly, there didn't seem to be too much of a performance hit, even with an empty cache, but I'm still playing with this...

Image of original broken behavior at http://mongolia.charityrallies.org/sites/all/files/Screenshot-33.jpg

Pete.

Carlos Miranda Levy’s picture

subscribe

thedrupaluser’s picture

subscribe
Also, has there been any further progress, or any suitable workarounds? I.e., any that actually work, no matter how temporary? Thanks

pbarnett’s picture

My technique of effectively preloading the images works; I've not seen anything else...

Pete.

GiorgosK’s picture

No need for pre caching the imagecache images

if you know the size of the image to be displayed use something like this in your css

.gmap-popup .views-field-field-thumbnail-fid{
  height:200px;
  width:300px;
}

where thumbnail is the name of the imagecache field to be displayed

using drupal 6 version of module

bramley’s picture

This is a problem for me with node teaser content. The Content is consistently the same amount larger than the info window.