Skip to content
Snippets Groups Projects
Commit 64892b84 authored by Jerenus's avatar Jerenus Committed by Andriy Podanenko
Browse files

Issue #1955750 by curiosity26, Jerenus: Gmap View Plugin doesn't recognize...

Issue #1955750 by curiosity26, Jerenus: Gmap View Plugin doesn't recognize Location CCK Field as valid lat/lon/marker source.
parent c1197fbb
No related branches found
No related tags found
No related merge requests found
...@@ -199,6 +199,12 @@ class gmap_plugin_style_gmap extends views_plugin_style { ...@@ -199,6 +199,12 @@ class gmap_plugin_style_gmap extends views_plugin_style {
elseif ($this->options['datasource'] == 'fields') { elseif ($this->options['datasource'] == 'fields') {
$lat = isset($row->{$lat_field}[0]['raw']['value']) ? (float) $row->{$lat_field}[0]['raw']['value'] : NULL; $lat = isset($row->{$lat_field}[0]['raw']['value']) ? (float) $row->{$lat_field}[0]['raw']['value'] : NULL;
$lon = isset($row->{$lon_field}[0]['raw']['value']) ? (float) $row->{$lon_field}[0]['raw']['value'] : NULL; $lon = isset($row->{$lon_field}[0]['raw']['value']) ? (float) $row->{$lon_field}[0]['raw']['value'] : NULL;
// Field is Location CCK
if (!$lat || !$lon) {
$lat = isset($row->{$lat_field}[0]['raw']['latitude']) ? $row->{$lat_field}[0]['raw']['latitude'] : NULL;
$lon = isset($row->{$lon_field}[0]['raw']['longitude']) ? $row->{$lon_field}[0]['raw']['longitude'] : NULL;
}
} }
// $row->nid is present in node views, views without node as the base table must include the nid field, // $row->nid is present in node views, views without node as the base table must include the nid field,
...@@ -237,7 +243,7 @@ class gmap_plugin_style_gmap extends views_plugin_style { ...@@ -237,7 +243,7 @@ class gmap_plugin_style_gmap extends views_plugin_style {
} }
elseif ($this->options['markers'] == 'field') { elseif ($this->options['markers'] == 'field') {
if (!empty($row->{$marker_field})) { if (!empty($row->{$marker_field}) && !empty($row->{$marker_field}[0]['raw']['value'])) {
$markername = $row->{$marker_field}[0]['raw']['value']; $markername = $row->{$marker_field}[0]['raw']['value'];
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment