Get Google Maps API libraries

@return array
@codeCoverageIgnore
357883
public function getGoogleMapAddressLibraries()
    {
        return $this->scopeConfig->getValue(
            self::XML_GOOGLE_MAP_ADDRESS_LIBRARIES,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
397000
public function enqueueJQueryAddressLibs()
    {
        if (($data = $this->didEnqueueLibs(__METHOD__))) {
            return $data; // Did this already.
        } // We only need to enqueue once.

        $data = [
            'scripts' => [
                'jquery-address' => [
                    'version' => '1.6',
                    'deps'    => ['jquery'],
                    'url'     => 'https://cdnjs.cloudflare.com/ajax/libs/jquery.address/%1$s/jquery.address.min.js',
                ],
            ],
        ];
        return $this->enqueueLibs(__METHOD__, $data);
    }
1361446
protected function getFilesFromBrokenMap()
    {
        $mapParts = array_filter($this->brokenMap);

        $this->codeFrames = array_values(array_map(function ($frame) {
            if (count($frame) === 3) {
                [$file, $linesOfCode, $line] = $frame;
            }

            if (!$this->isValidFile($file)) {
                return new Codeframe($file, 0, [], trim($line));
            }

            $codes = $this->getTheCodeFromTheFile($file, (int) $linesOfCode);

            return new Codeframe($file, (int) $linesOfCode, $codes, trim($line));
        }, $mapParts));

        return $this;
    }
903401
public static function getList()
    {
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();
        $libraries = [];
        foreach ($db->fetchAll('select sclHandle from SystemCaptchaLibraries order by sclHandle asc') as $row) {
            $scl = static::getByHandle($row['sclHandle']);
            $libraries[] = $scl;
        }

        return $libraries;
    }
755585
protected function getMapSchoolsProgramIds() {
    $map = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $programs = $this->getAllChildCarePrograms();
    foreach ($programs as $program) {
      $schools = $this->scrapeDaxkoSchoolsByProgram($program->id);
      $schools_data = $schools->each(function ($item) {
        return [
          'name' => $item->text(),
          'id' => $this->getQueryParam('location_id', $item->attr('href')),
        ];
      });

      foreach ($schools_data as $school) {
        $map[$program->id][$school['id']] = $school;
      }
    }

    $this->cache->set($cid, $map);
    return $map;
  }
50899
public function getJs()
    {
        $bounds = $this->getBounds()->getJs();
        $options = $this->getEncodedOptions();
        $js = [];
        $js[] = "var {$this->getName()} = new google.maps.GroundOverlay('{$this->url}',{$bounds}, {$options});";

        foreach ($this->events as $event) {
            /** @var \dosamigos\google\maps\Event $event */
            $js[] = $event->getJs($this->getName());
        }

        return implode("\n", $js);
    }
1189598
public function getFunctions()
    {
        $functions = array(
            new \Twig_SimpleFunction('get_available_devices', array($this, 'getAvailableDevices')),
            new \Twig_SimpleFunction('is_mobile', array($this, 'isMobile')),
            new \Twig_SimpleFunction('is_tablet', array($this, 'isTablet'))
        );

        foreach ($this->getAvailableDevices() as $device => $fixedName) {
            $methodName = 'is'.$device;
            $twigFunctionName = 'is_'.$fixedName;
            $functions[] = new \Twig_SimpleFunction($twigFunctionName, array($this, $methodName));
        }

        return $functions;
    }
167185
public function getCompilerPasses(): array
    {
        $mappingBagProvider = $this->getMappingBagProvider();

        return $mappingBagProvider instanceof MappingBagProvider
            ? array_merge(
                parent::getCompilerPasses(),
                [new MappingCompilerPass($mappingBagProvider)]
            )
            : parent::getCompilerPasses();
    }
311924
public static function getNameMap(): array
    {
        if (self::$nameMap === null) {
            self::$nameMap = [];
            $countries     = self::getLoader()->all();

            foreach ($countries as $country) {
                self::$nameMap[$country['alpha2']] = $country['name'];
            }

            self::$alpha2CodeMap = array_flip(self::$nameMap);
        }

        return self::$nameMap;
    }
549760
protected function getMapRateOptions() {
    $map = [];

    $cid = __METHOD__;
    if ($cache = $this->cache->get($cid)) {
      return $cache->data;
    }

    $domain = $this->getUrlFromOpenyProgramsSearchSettings('base_url');

    // Here we'll iterate over each program and scrape data for each school.
    // We should be careful in order not to make a high load on Daxko.
    $programs = $this->getAllChildCarePrograms();
    foreach ($programs as $program) {
      // Get a list of schools for particular program.
      $schools = $this->scrapeDaxkoSchoolsByProgram($program->id);

      // @todo Check whether we were scraping correct page (with schools).
      $school_pages = $schools->each(function ($school) {
        $href = $school->attr('href');
        return [
          'url' => $href,
          'id' => $this->getQueryParam('location_id', $href),
        ];
      });

      // Scrape each school page to get the rates url.
      foreach ($school_pages as $school_page) {
        $url = $domain . $school_page['url'];
        $source = $this->getDaxkoPageSource($url);
        $this->crawler->clear();
        $this->crawler->addHtmlContent($source);
        $rate_list = $this->crawler->filter('#session-list-table tr.childcare-rate');

        // Scrape each rate item.
        $rate_data = $rate_list->each(function ($rate_data_item) {
          // Get context ID && session name.
          $link = $rate_data_item->filter('a.session-name');
          return [
            'context_id' => $this->getQueryParam('context_id', $link->attr('href')),
            'name' => $link->text(),
            'registration_url' => $link->attr('href'),
          ];
        });

        // Fill in map dada.
        if (!isset($map[$school_page['id']][$program->id])) {
          $map[$school_page['id']][$program->id] = [];
        }

        foreach ($rate_data as $rate_data_item) {
          $map[$school_page['id']][$program->id][$rate_data_item['context_id']] = $rate_data_item;
        }
      }
    }

    $this->cache->set($cid, $map);
    return $map;
  }
489733
public static function getAssets()
    {
        switch (config('admin.map_provider')) {
            case 'tencent':
                $js = '//map.qq.com/api/js?v=2.exp&key='.env('TENCENT_MAP_API_KEY');
                break;
            case 'google':
                $js = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key='.env('GOOGLE_API_KEY');
                break;
            case 'yandex':
                $js = '//api-maps.yandex.ru/2.1/?lang=ru_RU';
                break;
            default:
                $js = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key='.env('GOOGLE_API_KEY');
        }

        return compact('js');
    }
578617
public function getMappers(): array
    {
        if (empty($this->mappers)) {
            $this->setMappers([
                new NicknameMapper($this->getNicknameDelimiters()),
                new SalutationMapper($this->getSalutations(), $this->getMaxSalutationIndex()),
                new SuffixMapper($this->getSuffixes()),
                new InitialMapper(),
                new LastnameMapper($this->getPrefixes()),
                new FirstnameMapper(),
                new MiddlenameMapper(),
            ]);
        }

        return $this->mappers;
    }
1274271
public static function getAssets()
    {
        $key = env('GOOGLE_API_KEY', false);
        if(!$key) return false;
        if (config('app.locale') == 'zh-CN') {
            $js = '//map.qq.com/api/js?v=2.exp';
        } else {
            $js = '//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key='.$key;
        }

        return compact('js');
    }
509888
public function getOutlineMapsList() {
        $res = array();
        $root_path = WT_ROOT.WT_MODULES_DIR.Constants::MODULE_MAJ_GEODISP_NAME.'/maps/';
        if(is_dir($root_path)){
            $dir = opendir($root_path);
            while (($file=readdir($dir))!== false) {
                if (preg_match('/^[a-zA-Z0-9_]+.xml$/', $file)) {
                    $res[base64_encode($file)] = new OutlineMap($file, true);
                }
            }
        }
        return $res;
    }
1204749
protected function getMap()
    {
        $fileSets = $this->getFilesets();

        // No filesets set
        // We're assuming single file / directory
        if (empty($fileSets)) {
            return $this->getTarget();
        }

        $targets = [];

        foreach ($fileSets as $fs) {
            if (!($fs instanceof FileSet)) {
                continue;
            }

            // We need a directory to store the links
            if (!is_dir($this->getLink())) {
                throw new BuildException('Link must be an existing directory when using fileset');
            }

            $fromDir = $fs->getDir($this->getProject())->getAbsolutePath();

            if (!is_dir($fromDir)) {
                $this->log('Directory doesn\'t exist: ' . $fromDir, Project::MSG_WARN);
                continue;
            }

            $fsTargets = [];

            $ds = $fs->getDirectoryScanner($this->getProject());

            $fsTargets = array_merge(
                $fsTargets,
                $ds->getIncludedDirectories(),
                $ds->getIncludedFiles()
            );

            // Add each target to the map
            foreach ($fsTargets as $target) {
                if (!empty($target)) {
                    $targets[$target] = $fromDir . DIRECTORY_SEPARATOR . $target;
                }
            }
        }

        return $targets;
    }
1319119
public function getList()
    {
        $routes = &gplcart_static('route.list');

        if (isset($routes)) {
            return $routes;
        }

        $routes = (array) gplcart_config_get(GC_FILE_CONFIG_ROUTE);
        $this->hook->attach('route.list', $routes, $this);
        return $routes;
    }
52663
public function geocode()
    {
        // build query string
        $query = [];
        $query[] = $this->street       ?: '';
        $query[] = $this->street_extra ?: '';
        $query[] = $this->city         ?: '';
        $query[] = $this->state        ?: '';
        $query[] = $this->post_code    ?: '';
        $query[] = $this->getCountry() ?: '';

        // build query string
        $query = trim(implode(',', array_filter($query)));
        $query = str_replace(' ', '+', $query);

        if (! $query)
            return $this;

        // build url
        $url = 'https://maps.google.com/maps/api/geocode/json?address='. $query .'&sensor=false';

        // try to get geo codes
        if ($geocode = file_get_contents($url)) {
            $output = json_decode($geocode);

            if (count($output->results) && isset($output->results[0])) {
                if ($geo = $output->results[0]->geometry) {
                    $this->lat = $geo->location->lat;
                    $this->lng = $geo->location->lng;
                }
            }
        }

        return $this;
    }