When I assign a node a location, and enable the gmap block, all the maps look the same. They show Highway 6 and Interstate 80 near Adair. As shown in the attached image.

When I edit the nodes, the map I see in the location form shows the correct location. But all maps in blocks show this.

CommentFileSizeAuthor
#5 centermap.diff862 bytesDave Cohen
gmap_anita.jpg11.41 KBDave Cohen

Comments

Dave Cohen’s picture

Status: Active » Fixed

I believe I was missing a file, through my own careless use of CVS.

Anyway, this problem is not happening any more.

Dave Cohen’s picture

Title: All block maps show Anita and Adair » Location map block does not center
Status: Fixed » Active

I don't know why I thought this was working. It turns out the map that appears in the location block does set a marker, but does not center over it. I noticed there is code in gmap_location_node_page() that does this:

 // Special stuff for single marker
  if ($count == 1) {
    // Center map on only marker.
    $map['latitude'] = $map['markers'][0]['latitude'];
    $map['longitude'] = $map['markers'][0]['longitude'];

But there is no equivalent in gmap_location_block_view().

inozz’s picture

+1

Furayo’s picture

I had the same issue... I did several things... what about starting with gmap_location.module and add the following snippet:

$map[latlong]=(($loc['latitude']).','.($loc['longitude']));

right before the function gmap_location_block_view ends, I mean before:

      $block['subject'] = t('Location');
      $block['content'] = theme('gmap', array('#settings' => $map));

Let me know if that works... you can also go to the gmap.module and in the function theme_gmap insert a

print_r ($map)

to check how the location is encoded in the $map array adequately.

Dave Cohen’s picture

Status: Active » Needs review
StatusFileSize
new862 bytes

Here's what I did. Maybe too simple to be the general solution. But it works for me where my location block shows only one marker at a time.

smitty’s picture

Status: Needs review » Closed (duplicate)

Pleas have a look at: http://drupal.org/node/191223