When I create a view of type "Gmap View", I have to add the fields for latitude and longitude, but then they appears also on the info window.

As a quick and dirty solution, I added this to gmap.css:

div.gmap-popup.latitude, div.gmap-popup.longitude {
	display: none;
}

In this way, only title and teaser (as specified with the contemplate module) are shown on the infowindow, and for me is enough. I think you should hide by default latitude and longitude on infowindow.

Comments

bfsworks’s picture

I tried exactly that without results. I am using garland theme Drupal 5.x. Is there anything else that needs to be done?

martinst’s picture

I found http://agaricdesign.com/note/theming-google-map-popups-use-imagecache-vi...
and so I added to my theme css

.gmap-popup.latitude,
.gmap-popup.longitude
{
display: none;
}

Works well for me

marcp’s picture

If you don't like the CSS idea and want to completely hide the lat/long from the bubble, override theme_gmap_views_marker_label() by putting this in your theme (or in a module):

/**
 * Theme a marker label without the latitude or longitude.
 */
function phptemplate_gmap_views_marker_label($view, $fields, $entry) {
  $marker_label = '';
  foreach ($view->field as $field) {
    switch ($field['field']) {
      // Don't blast out the latitude or longitude...
      case 'latitude' :
      case 'longitude' :
        break;
      default :
        $marker_label .= '<div class="'. $field['field'] .'">'. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $entry, $view) .'</div>';
        break;
    }
  }
  
  return $marker_label;
}
cbrompton’s picture

Sorry, I dont know much about these scripts you have written here. I did, However, manage to put the info above into my gmap.location.module and it worked!!! One little glitch though... All the fields that I previously entered are appearing as one long string with no breaks in it.. how do I get the breaks back?

marcp’s picture

Replace this line:

 $marker_label .= ''. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $entry, $view) .'';

With this:

 $marker_label .= '&lt;div class="'. $field['field'] .'"&gt;'. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $entry, $view) .'&lt;/div&gt;';
kasiawaka’s picture

Hi,
I added my code snipped here: http://drupal.org/node/176355#comment-1345256
It allows me to take control over the fields that are being displayed in the marker popup label and also how they are displayed (added extra lines, brackets etc.)
Hope that helps,
Kasia

podarok’s picture

Status: Active » Closed (won't fix)

release unsupported
feel free to open issue against latest 7.x dev