Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1adadfd0

Přidáno uživatelem horkym před téměř 7 roky(ů)

refs #6847: Cron - ziskani geolokace z google locations a ulozeni do databaze

Oprava kodu. Vyhledavani probihalo po cele zemi, omezeno pouze pro Plzensky kraj.

Zobrazit rozdíly:

cron/location.php
14 14
    // --- ZEMEPISNA SIRKA A DELKA A UDAJE POTREBNE K JEJICH ZJISTENI. ---
15 15
    
16 16
    private $key;
17
    private $locality;
17 18
    private $region;
18 19
    
19 20
    public $lat;
......
27 28
        // $this->area = $data[4];
28 29
        
29 30
        $this->key = "AIzaSyCSx7hyAzQiG5uocJTeZgf1Z3lpDy4kpEk";
31
        $this->locality = "Plzeňský kraj";
30 32
        $this->region = "cz";
31 33
        $this->lat = -1;
32 34
        $this->lng = -1;
......
38 40
        if ($this->town != $this->street) {
39 41
            $address .= " ".$this->street;
40 42
        }
43
        $address .= " ".$this->locality;
41 44
        $address = str_replace(" ", "+", $address); // Nemusi byt, jen pro jistotu.
42 45
        
43 46
        $json = file_get_contents("https://maps.google.com/maps/api/geocode/json?address=$address&sensor=false&region=".$this->region."&key=".$this->key);

Také k dispozici: Unified diff