dotswan / filament-map-picker

Map Picker is a Filament custom field designed to simplify the process of choosing a location on a map and obtaining its geo-coordinates.
MIT License
32 stars 10 forks source link

Using separate decimal columns for lat,lng #17

Closed mokhosh closed 2 months ago

mokhosh commented 2 months ago

Thanks for the great package.

If I use a json column called location, the input works just fine, but if I use separate decimal columns for latitude and longitude, I can't get the input to work as expected.

For example if I don't have a location column in addition to latitude and longitude, I get Column not found, unknown column 'location'. I have to either add the location column which I don't need, or add location to guarded on the model which is not ideal.

And for the README example code to work, I have to have separate latitude and longitude text fields on the form, or else they won't be saved to the database.

Am I getting it wrong?

mohaphez commented 2 months ago

Hi @mokhosh ,

If you want to save latitude and longitude in separate columns, perhaps this issue could be helpful: https://github.com/dotswan/filament-map-picker/issues/2. If not, please let me know.

mokhosh commented 2 months ago

Thanks @mohaphez

It was helpful, but it basically confirmed that there is no clean way to use separate columns.