Example #1
0
 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;
     }
 }
Example #2
0
 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;
 }
Example #3
0
 /**
  * @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;
 }
Example #4
0
 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;
 }