hi,
i am trying to access location information (lat/lon) through computed field
because there where various formats in forums i searched
i tried every possible compination in case of wrong syntax
but i still cannot get it
if (!$node->nid) node_save($node);
echo $node->locations[0]['latitude']['value'] . ' , ' .
$node->locations[0]['lat']['value'] . ' , ' .
$node->locations[0]['latitude'] . ' , ' .
$node->locations[0]['lat'] . ' , ' .
$node->locations['latitude'] . ' , ' .
$node->locations['lat'] . ' , ' .
$node->location[0]['latitude']['value'] . ' , ' .
$node->location[0]['lat']['value'] . ' , ' .
$node->location[0]['latitude'] . ' , ' .
$node->location[0]['lat'] . ' , ' .
$node->location['latitude'] . ' , ' .
$node->location['lat'] . ' , ' ;
this returns , , , , , , , ...
is it something that has to do with computed field module or am i doing something wrong?
thanks!
Comments
Comment #1
emlomar1 commentedI think it is a problem of the node_save function. This function deletes latitude and longitude values. I don't know why but it happens...
Comment #2
emlomar1 commentedActually I've discover that has something to do with the (location_geo_logic function in the location.module). This funcion allways sets lat and long to 0. To avoid that just edit the location.module and replace (line 1569 aprox.)
with:
hope this helps.
Comment #3
farald commentedFinally!
I saved the whole $node query to the database, and found out that location values is indeed not saved in $node->location[0][latitude]. BUT, the new latitudes are stored in following:
So, to manipulate the locations from computed field, use these:)
However, I do not know what other location fields are called. To find out, just put
in your custom field.
Let it save to the db as a 'text' type, save a node, then go to phpmyadmin and inspect the array.