Skip to content

Commit

Permalink
Change mapType() to type() to match column
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Nov 15, 2024
1 parent 7f0483b commit 79a068d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
14 changes: 7 additions & 7 deletions src/Fields/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 79a068d

Please sign in to comment.