nvK
nvK
FFilament
Created by nvK on 3/30/2025 in #❓┊help
Filament Google Maps plugin is not changing my TextInput fields when marker is being moved.
Hello there. I'm using this package. I'm working on a project that needs the latitude ang longitude so that we can put them up for people to navigate exactly where the place to go. My only problem is that when moving the marker using drag or click, The TextInput fields does not react. I tried reading the documentation a lot of times but it's not really working how I like it to work. It works when I: Move pin -> click on the text field for latitude -> click outside the text field -> the latitude and longitude updates
TextInput::make('lat')->label('Latitude Pin')
->nullable()
// ->hidden()
->maxLength(16)
>lazy(),
TextInput::make('lng')->label('Longitude Pin')
->nullable()
// ->hidden()
->maxLength(16)
->lazy(),
Map::make('location')
->columnSpanFull()
->height('600px')
->defaultZoom(15)
->draggable()
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('lat', $state['lat']);
$set('lng', $state['lng']);
}),
TextInput::make('lat')->label('Latitude Pin')
->nullable()
// ->hidden()
->maxLength(16)
>lazy(),
TextInput::make('lng')->label('Longitude Pin')
->nullable()
// ->hidden()
->maxLength(16)
->lazy(),
Map::make('location')
->columnSpanFull()
->height('600px')
->defaultZoom(15)
->draggable()
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('lat', $state['lat']);
$set('lng', $state['lng']);
}),
Only something works. Am I doing it wrong? I saw some posts like my problem in #google-maps but I can't seem to find the solution for that. Send help, my brother @cheesegrits Thanks!
6 replies