Exemplo n.º 1
0
 public function nearbyAllTypesAllPages($queryData)
 {
     for ($i = 0; $i < count($queryData->{'types'}); $i++) {
         // String for request
         $loopQuery = $this->gSearchURL;
         $loopQuery .= $queryData->{'geometry'}->{'location'}->{'lat'} . "," . $queryData->{'geometry'}->{'location'}->{'lng'} . "&radius=1500" . "&types=" . $queryData->{'types'}[$i];
         $loopQuery = ControlFunctions::addAPIkey($loopQuery);
         $info = json_decode(file_get_contents($loopQuery));
         foreach ($info->results as $poi) {
             // $array =  (array) $poi;
             array_push($this->pois, $poi);
         }
         echo ControlFunctions::tagIt("h4", "<span style=\"font-family: monospace;\">Erste Suchergebnisseite <span style=\"color: green;\">gespeichert</span></span>");
         // Check if result contains next_page_token and try to get additional data
         if (isset($info->next_page_token)) {
             echo ControlFunctions::tagIt("h4", "<span style=\"font-family: monospace;\"><span style=\"color: orange;\">Next Page Token gefunden</span></span>");
             $this->callAddToken($info->next_page_token);
         } else {
             echo ControlFunctions::tagIt("h4", "<p><span style=\"color: orange\">Just one result page</span>: No Next Page Token found at all!</p>");
         }
         echo ControlFunctions::tagIt("h2", "<span style=\"font-family: monospace;\">nearbyAllTypesAllPage()</span><br />" . "Nearby Anfrage für 1. Seite <span style=\"color: blue;\">" . $queryData->{'types'}[$i] . "</span> Query " . $loopQuery);
         echo ControlFunctions::tagIt("h3", "Einträge: <b>" . count($info->results) . "</b>");
         echo ControlFunctions::pasteSpacer("###  Next ###");
     }
     echo ControlFunctions::tagIt("h2", "<span style=\"font-family: monospace;\">nearbyAllTypesFirstPage()</span><br />" . "Nearby Anfrage für <span style=\"color: blue;\">First Page – All Types</span>-Query ");
     echo ControlFunctions::tagIt("h3", "Einträge: <b>" . count($this->pois) . "</b>");
     $fpois = ControlFunctions::checkDuplicatePID($this->pois);
     echo ControlFunctions::tagIt("h3", "Gefilterte Einträge: <b>" . count($fpois) . "</b>");
     ControlFunctions::formatResultArray($fpois);
     ControlFunctions::forDebug($fpois, "Gefilterte Pois");
 }
Exemplo n.º 2
0
 public function radarConcatTypesInOne($queryData)
 {
     // String for request
     $this->gSearchURL .= $queryData->{'geometry'}->{'location'}->{'lat'} . "," . $queryData->{'geometry'}->{'location'}->{'lng'} . "&radius=1500" . "&types=" . $queryData->{'types'}[0] . "|" . $queryData->{'types'}[8] . "|" . $queryData->{'types'}[12] . "|" . $queryData->{'types'}[13] . "|" . $queryData->{'types'}[16] . "|";
     $this->gSearchURL = addAPIkey($this->gSearchURL);
     $info = json_decode(file_get_contents($this->gSearchURL));
     foreach ($info->results as $poi) {
         array_push($this->pois, $poi);
     }
     echo ControlFunctions::tagIt("h2", "<span style=\"font-family: monospace;\">radarConcatTypesInOne()</span><br />" . "Radar Anfrage für meherere Types in einer Anfrage: <span style=\"color: blue;\">" . $queryData->{'types'}[0] . ", " . $queryData->{'types'}[8] . ", " . $queryData->{'types'}[12] . ", " . $queryData->{'types'}[13] . ", " . $queryData->{'types'}[16] . ", " . "</span> Query " . $this->gSearchURL);
     echo ControlFunctions::tagIt("h3", "Einträge: <b>" . count($this->pois) . "</b>");
     $fpois = ControlFunctions::checkDuplicatePID($this->pois);
     echo ControlFunctions::tagIt("h3", "Gefilterte Einträge: <b>" . count($fpois) . "</b>");
     ControlFunctions::formatResultArray($fpois);
     ControlFunctions::forDebug($fpois, "Gefilterte Pois");
 }
Exemplo n.º 3
0
 public function dataTypes3Pages($queryData)
 {
     for ($i = 0; $i < count($queryData->{'types'}); $i++) {
         // for ($i = 0; $i < 1; $i++) {
         // String for request
         $loopQuery = $this->gSearchURL;
         $loopQuery .= $queryData->{'geometry'}->{'location'}->{'lat'} . "," . $queryData->{'geometry'}->{'location'}->{'lng'} . "&radius=1500" . "&types=" . $queryData->{'types'}[$i];
         $loopQuery = ControlFunctions::addAPIkey($loopQuery);
         $info = json_decode(file_get_contents($loopQuery));
         foreach ($info->results as $poi) {
             // $array =  (array) $poi;
             array_push($this->pois, $poi);
         }
         // Check if result contains next_page_token and try to get additional data
         if (isset($info->next_page_token)) {
             $this->callAddToken($info->next_page_token);
         } else {
             echo ControlFunctions::tagIt("h4", "<p><span style=\"color: orange\">Just one result page</span>: No Next Page Token found at all!</p>");
         }
     }
     $fpois = ControlFunctions::checkDuplicatePID($this->pois);
     echo ControlFunctions::tagIt("h3", "Gefilterte Einträge: <b>" . count($fpois) . "</b>");
     $this->saveToDB($fpois);
 }