Open joseadrian opened 10 months ago
Hi, i face same issue here. does anyone know how to fix this?
Si creo que es un error del mismo plugin
There is an ugly workaround. I don't know why for it to be triggered, you need a GeoJSON structure and an extra field. From one of the plugin's file, the markerMoved
calls this.geoJsonContains
method which needs those two things for the setStateUsing
function to be fired. There must be a reason but I don't know what that is.
Create a simple field, call it however you want.
Forms\Components\TextInput::make('any_name'),
Then to the Map
field, add this piece of code:
Map::make('your_field')
->geoJson(function() { return '{}'; })
->geoJsonContainsField('any_name')
Then somehow, hide the field using css. It won't work if you use the method visible
or hidden
on the field. Demo? Also, you need to add work with the model with that new field.
Any idea on a fix for this rather than the "ugly workaround" @cheesegrits? Thanks
From the README, I copied this code and the map loads fine, however I was expecting the closure in
afterStateUpdated
to be fired since the readme saysIf you wish to update your lat and lng fields on the form when the map marker is moved:
. Added a breakpoint, it looks like it doesn't fire, though it does when I click the lat or lng field and then click outside. Is it a bug?