function location_feeds_set_georss_point in Location Feeds 6
Same name and namespace in other branches
- 7 location_feeds.module \location_feeds_set_georss_point()
Sets a georss:point value for the node
Parameters
object $object: Either a user or node object depending on where this is called
string $target: The target that invoked this
$value:
Return value
object
1 string reference to 'location_feeds_set_georss_point'
- _location_feeds_fill_targets in ./
location_feeds.module - Helper function to add target fields
File
- ./
location_feeds.module, line 282 - This module provides location mappers to feed importers.
Code
function location_feeds_set_georss_point($object, $target, $value) {
list($field_name, $georss, $point) = explode(':', $target);
if (!is_array($value)) {
$value = array(
$value,
);
}
foreach ($value as $i => $val) {
list($lat, $long) = explode(' ', trim($val));
$object->{$field_name}[$i]['latitude'] = $lat;
$object->{$field_name}[$i]['longitude'] = $long;
}
return $object;
}