本文整理汇总了PHP中Location::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::setData方法的具体用法?PHP Location::setData怎么用?PHP Location::setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Location
的用法示例。
在下文中一共展示了Location::setData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: populateMapData
public function populateMapData($item, $spot)
{
if ($spot->lat != null and $spot->lng != null) {
$loc = new Location();
$pt = array();
$pt[0] = $spot->lng;
$pt[1] = $spot->lat;
$loc->addPoint($pt);
$loc->setData($this->populateItemTemplate($item));
return $loc;
} else {
return null;
}
}
示例2: populateMapData
public function populateMapData(&$item)
{
if (!$this->getgeodata) {
return null;
}
$id = $item['id'] . "";
$geo = $this->photogeodata[$id];
if ($geo->err["code"] != null) {
return null;
}
$loc = new Location();
$pt = array();
$pt[0] = $geo->photo->location["longitude"];
$pt[1] = $geo->photo->location["latitude"];
$loc->addPoint($pt);
$loc->setData($this->populateItemTemplate($item));
return $loc;
}
示例3: searchByFbPlacesId
/**
* @param string $fb_places_id
* @param int $distance
* @return mixed|\Psr\Http\Message\ResponseInterface
*/
public function searchByFbPlacesId($fb_places_id = '', $distance = 500)
{
$res = $this->instagram->get(Location::API_SEGMENT . 'search', ['facebook_places_id' => $fb_places_id, 'distance' => $distance]);
$arr = [];
foreach ($res->data as $item) {
$tag = new Location($this->instagram, $item->id);
$tag->setData($item);
array_push($arr, $tag);
}
return $arr;
}
示例4: populateMapData
public function populateMapData(&$item)
{
if ($item->coordinates) {
$loc = new Location();
$loc->addPoint($item->coordinates->coordinates);
} else {
if ($item->place) {
$loc = new Location();
$loc->setPoints($item->place->bounding_box->coordinates[0]);
// it's possible that this is a multi region polygon, but I don't care too much ;)
} else {
return null;
}
}
$loc->setData($this->populateItemTemplate($item));
return $loc;
}