Ejemplo 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");
 }
Ejemplo n.º 2
0
 function radarAllTypesIteration($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=3000" . "&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("h2", "<span style=\"font-family: monospace;\">radarAllTypesIteration()</span><br />" . "Radar Anfrage für  1. <span style=\"color: blue;\">" . $queryData->{'types'}[$i] . "</span> Query " . $loopQuery);
         echo ControlFunctions::tagIt("h3", "Einträge: <b>" . count($info->results) . "</b>");
         echo ControlFunctions::pasteSpacer("#");
     }
     echo ControlFunctions::tagIt("h2", "<span style=\"font-family: monospace;\">radarAllTypesConcat()</span><br />" . "Radar Anfrage für <span style=\"color: blue;\">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");
 }
Ejemplo 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);
 }