Jake Vanderwerf
2026-08-28 5b50afdcafd150186ea5c7b0e1cad98065590b35
inc/integrations/services/GoogleMapsOld.php
@@ -7,6 +7,7 @@
namespace JVBase\integrations\services;
use JVBase\integrations\Integrations;
use JVBase\registrar\Registrar;
use WP_Error;
if (!defined('ABSPATH')) {
   exit;
@@ -17,7 +18,6 @@
   private string $public_key;
   private string $private_key;
   private string $map_id;
   private array $enabled_apis = [];
   // Edmonton default coordinates
   private const DEFAULT_LAT = 53.5461;
@@ -202,7 +202,7 @@
         'key' => $this->private_key
      ];
      $key = $this->cache->generateKey(['geocode', $address]);
      $key =['geocode', $address];
      $cached = $this->cache->get($key);
      if ($cached) {
         return $cached;
@@ -256,7 +256,7 @@
         'key' => $this->private_key
      ];
      $key = $this->cache->generateKey(['reverse', $lat, $lng]);
      $key = ['reverse', $lat, $lng];
      $cached = $this->cache->get($key);
      if ($cached) {
         return $cached;
@@ -302,7 +302,7 @@
      $default_fields = ['name', 'formatted_address', 'geometry', 'rating', 'formatted_phone_number'];
      $fields = empty($fields) ? $default_fields : $fields;
      $key = $this->cache->generateKey(['place', $place_id, $fields]);
      $key = ['place', $place_id, $fields];
      $cached = $this->cache->get($key);
      if ($cached) {
         return $cached;
@@ -355,7 +355,7 @@
         $params['type'] = $type;
      }
      $key = $this->cache->generateKey(['nearby', $lat, $lng, $radius, $type]);
      $key = ['nearby', $lat, $lng, $radius, $type];
      $cached = $this->cache->get($key);
      if ($cached) {
         return $cached;
@@ -406,7 +406,7 @@
         'key' => $this->private_key
      ];
      $key = $this->cache->generateKey(['distance', $origin_str, $dest_str, $mode]);
      $key = ['distance', $origin_str, $dest_str, $mode];
      $cached = $this->cache->get($key);
      if ($cached) {
         return $cached;
@@ -649,25 +649,20 @@
   {
      $theme = $this->credentials['theme'] ?? 'default';
      switch ($theme) {
         case 'dark':
            return [
               ['elementType' => 'geometry', 'stylers' => [['color' => '#242f3e']]],
               ['elementType' => 'labels.text.fill', 'stylers' => [['color' => '#746855']]],
               ['elementType' => 'labels.text.stroke', 'stylers' => [['color' => '#242f3e']]],
               ['featureType' => 'road', 'elementType' => 'geometry', 'stylers' => [['color' => '#38414e']]],
               ['featureType' => 'water', 'elementType' => 'geometry', 'stylers' => [['color' => '#17263c']]]
            ];
         case 'minimal':
            return [
               ['featureType' => 'poi', 'stylers' => [['visibility' => 'off']]],
               ['featureType' => 'transit', 'stylers' => [['visibility' => 'off']]]
            ];
         default:
            return [];
      }
      return match ($theme) {
         'dark' => [
            ['elementType' => 'geometry', 'stylers' => [['color' => '#242f3e']]],
            ['elementType' => 'labels.text.fill', 'stylers' => [['color' => '#746855']]],
            ['elementType' => 'labels.text.stroke', 'stylers' => [['color' => '#242f3e']]],
            ['featureType' => 'road', 'elementType' => 'geometry', 'stylers' => [['color' => '#38414e']]],
            ['featureType' => 'water', 'elementType' => 'geometry', 'stylers' => [['color' => '#17263c']]]
         ],
         'minimal' => [
            ['featureType' => 'poi', 'stylers' => [['visibility' => 'off']]],
            ['featureType' => 'transit', 'stylers' => [['visibility' => 'off']]]
         ],
         default => [],
      };
   }
   /**