views:

10

answers:

1

Hi! I am using gmap and location modules to support my content type's location. I have configured those modules (Map API key, etc...) so when I edit / add new node I get pretty google map to choose/set lattitude jus by mouse pointing. I can put also address, etc.. But when I view my node map is not showing up. I can only see address fields.

Why it is so confusing?

I have check display fields settings in admin/content/types settings page and all fields are set to be visible. What am I missing here? Why map is not simply visible as the same as in the node edit page?

+1  A: 

The standard theming doesn't include an actual map, but it's pretty easy to do. All you need to use to create the map is the gmap_simple_map function. I've done this in the location.tpl.php in the past as I usually want to override that anything. So I add something like this in the bottom of it to include the map:

<?php
  // "Geo" microformat, see http://microformats.org/wiki/geo
  if ($latitude && $longitude) {
    // Assume that 0, 0 is invalid.
    if ($latitude != 0 || $longitude != 0) {
      $marker = 'Whatever you want the marker to be.';
      print gmap_simple_map($latitude, $longitude, '', $marker, 'default');
    }
  }
?>
googletorp
Easy one! I was just hoping for a solution without having to edit template file (template dependency). But it is OK.
Lukasz