Problem with filament-google-maps
@Hugh Messenger When I edit an existing entry the lat and long are right in the Textfield but the Map not starting at the existing lat and long
TextInput::make('lat')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('location', [
'lat' => floatVal($state),
'long' => floatVal($get('long')),
]);
})
->lazy(), // important to use lazy, to avoid updates as you type
TextInput::make('long')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('location', [
'lat' => floatval($get('lat')),
'long' => floatVal($state),
]);
})
->lazy(), // important to use lazy, to avoid updates as you type
Map::make('location')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('lat', $state['lat']);
$set('long', $state['lng']);
}),TextInput::make('lat')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('location', [
'lat' => floatVal($state),
'long' => floatVal($get('long')),
]);
})
->lazy(), // important to use lazy, to avoid updates as you type
TextInput::make('long')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('location', [
'lat' => floatval($get('lat')),
'long' => floatVal($state),
]);
})
->lazy(), // important to use lazy, to avoid updates as you type
Map::make('location')
->reactive()
->afterStateUpdated(function ($state, callable $get, callable $set) {
$set('lat', $state['lat']);
$set('long', $state['lng']);
}),