Skip to content

Commit 4f39b30

Browse files
fix location in admin
1 parent 2da94ec commit 4f39b30

File tree

2 files changed

+203
-192
lines changed

2 files changed

+203
-192
lines changed

app/Filament/Forms/Components/LeafletAutocomplete.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ public function getChildComponents(): array
104104
->live()
105105
->hiddenLabel()
106106
->liveLocation()
107+
->visible(fn (Get $get) => $get('location.lat') && $get('location.lng'))
108+
->defaultLocation(45.9432, 24.9668)
107109
->zoom(18)
108110
->draggable(false)
109-
->showMyLocationButton()
111+
->showMyLocationButton(false)
110112
->hintAction(
111113
Action::make('change_pin_location')
112114
->label(__('map_points.change_pin_location'))
@@ -119,6 +121,8 @@ public function getChildComponents(): array
119121
->tilesUrl('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png')
120122
->label(__('map_points.new_point'))
121123
->liveLocation()
124+
->showMyLocationButton(false)
125+
122126
->live()
123127
->afterStateUpdated(function (?array $state, Set $set) {
124128
$set('new_lat', $state['lat']);

0 commit comments

Comments
 (0)