Change geopoint to location

This commit is contained in:
Evan Prodromou 2013-06-04 17:22:51 -04:00
parent a2dd5dfef3
commit 759754555d

View File

@ -778,12 +778,29 @@ class ActivityObject
if (!empty($this->geopoint)) { if (!empty($this->geopoint)) {
list($lat, $long) = explode(' ', $this->geopoint); list($lat, $lon) = explode(' ', $this->geopoint);
$object['geopoint'] = array( $object['location'] = array(
'type' => 'Point', 'objectType' => 'place',
'coordinates' => array($lat, $long) 'position' => sprintf("%+02.5F%+03.5F/", $lat, $lon),
'lat' => $lat,
'lon' => $lon
); );
$loc = Location::fromLatLon($lat, $lon);
if ($loc) {
$name = $loc->getName();
if ($name) {
$object['location']['displayName'] = $name;
}
$url = $loc->getURL();
if ($url) {
$object['location']['url'] = $url;
}
}
} }
if (!empty($this->poco)) { if (!empty($this->poco)) {