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.
Comments
Comment #1
Drupal Berlin commentedThanx a lot. It works for me too.
Comment #2
roball commentedYeah! 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!
Comment #3
becw commentedfixed in http://drupal.org/cvs?commit=258438
Comment #4
roball commentedThank 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?