Using gmap_geo 6.x-1.x from 2009-07-29. I have a geo CCK field set to POINT, with 'GMap' set in the CCK Display Fields. On node view, when the gmap renders, the map appears to render at the default position, not at the specific lat/lon of the node.

The issue appears to be in theme_gmap_geo_formatter(). The node has the correct location (I can manually extract the WKT). In

foreach (element_children($element) as $i) {
    $item = $element[$i]['#item'];
    gmap_geo_map_feature($item['array_for_gmap'], $item['gis type'], $map);
  }

The item is being correctly selected but it has no 'array_for_gmap' so the marker array is returned empty.

I've altered the code as follows:

   foreach (element_children($element) as $i) {
     $item = $element[$i]['#item'];
+    $geo_array = geo_wkb_get_data($item['wkb'], 'array_for_gmap');
+    $item['array_for_gmap'] = $geo_array;
     gmap_geo_map_feature($item['array_for_gmap'], $item['gis type'], $map);
   }

This works for me.

CommentFileSizeAuthor
#2 gmap_geo__553450.patch653 bytesroball
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Drupal Berlin’s picture

Thanx a lot. It works for me too.

roball’s picture

Priority: Normal » Critical
Status: Active » Reviewed & tested by the community
FileSize
653 bytes

Yeah! This also solves #547080: Map displays only blue background for me, using the latest dev version of the Geo module - 6.x-1.x-dev (2009-Aug-08).

I have attached this solution as a patch. Should really get committed into GMap + Geo's HEAD asap. Thank you jonathan_hunt!

becw’s picture

Status: Reviewed & tested by the community » Fixed
roball’s picture

Thank you bec for the commit. GMap + Geo 6.x-1.x-dev (2009-Sep-02) now again works with the latest dev version of Geo.

The only major problem I am still having is #537342: Input gets lost on preview. Did you have a chance to look into that?

Status: Fixed » Closed (fixed)

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