Simply add a map field in the admin controller class.
...
$form->text('lat');
$form->text('lon');
$form->map('lat', 'lon', 'Mapa');
...
In app/Admin/boostrap.php file is important delete or comment this line:
Encore\Admin\Form::forget(['map', 'editor']);
You can add your google map api key in your .env file:
GOOGLE_API_KEY=xxxxxxxxxx
@rasmalan Thanks for good idea and example, but it doesn't work for me. The main reason is form fields duplicating, because map component generates two hidden inputs with names of first and second function argument. This way map's fields duplicate text fields and these fieds values don't save after form submitting at all (empty values getted).
Most helpful comment
Simply add a map field in the admin controller class.
In app/Admin/boostrap.php file is important delete or comment this line:
Encore\Admin\Form::forget(['map', 'editor']);
You can add your google map api key in your .env file:
GOOGLE_API_KEY=xxxxxxxxxx