From 79a068dd3d8dfb6a51e4d8ff8c4aca0957714d88 Mon Sep 17 00:00:00 2001 From: Hugh Messenger Date: Thu, 14 Nov 2024 21:49:58 -0600 Subject: [PATCH] Change mapType() to type() to match column --- README.md | 2 +- src/Fields/Map.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9ceda9d..e8a54c6 100644 --- a/README.md +++ b/README.md @@ -358,7 +358,7 @@ use Cheesegrits\FilamentGoogleMaps\Fields\Map ->defaultLocation([39.526610, -107.727261]) // default for new forms ->draggable() // allow dragging to move marker ->clickable(false) // allow clicking to move marker - ->mapType('roadmap') // map type (hybrid, satellite, roadmap, terrain) + ->type('roadmap') // map type (hybrid, satellite, roadmap, terrain) ->geolocate() // adds a button to request device location and set map marker accordingly ->geolocateLabel('Get Location') // overrides the default label for geolocate button ->geolocateOnLoad(true, false) // geolocate on load, second arg 'always' (default false, only for new form)) diff --git a/src/Fields/Map.php b/src/Fields/Map.php index 4c07968..1600e55 100644 --- a/src/Fields/Map.php +++ b/src/Fields/Map.php @@ -71,7 +71,7 @@ class Map extends Field protected ?Closure $placeUpdatedUsing = null; - protected Closure|string $mapType = 'roadmap'; + protected Closure|string $type = 'roadmap'; protected Closure|array $drawingModes = [ 'marker' => true, @@ -822,9 +822,9 @@ public function getMapConfig(): string 'debug' => $this->getDebug(), 'gmaps' => MapsHelper::mapsUrl(false, $this->getDrawingControl() ? ['drawing'] : []), 'polyOptions' => $this->getPolyOptions(), - 'rectangleOptions' => $this->getRectangeOptions(), + 'rectangleOptions' => $this->getRectangleOptions(), 'circleOptions' => $this->getCircleOptions(), - 'mapType' => $this->getMapType(), + 'mapType' => $this->getType(), ]); //ray($config); @@ -887,15 +887,15 @@ public function getCircleOptions(): ?array return $this->evaluate($this->circleOptions); } - public function mapType(Closure|string $mapType): static + public function type(Closure|string $type): static { - $this->mapType = $mapType; + $this->type = $type; return $this; } - public function getMapType(): string + public function getType(): string { - return $this->evaluate($this->mapType); + return $this->evaluate($this->type); } }