Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#2 | gmap_geo__553450.patch | 653 bytes | roball |
Comments
Comment #1
Drupal Berlin CreditAttribution: Drupal Berlin commentedThanx a lot. It works for me too.
Comment #2
roball CreditAttribution: 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 CreditAttribution: becw commentedfixed in http://drupal.org/cvs?commit=258438
Comment #4
roball CreditAttribution: 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?