mostafaznv / nova-map-field

Spatial Map Fields for Laravel Nova
MIT License
40 stars 14 forks source link

Longitude and Latitude misrepresentation on show details modal #48

Closed geekdanitek closed 5 months ago

geekdanitek commented 7 months ago

There is a value mismatch on the show details modal for longitude and latitude. The value of longitude is shown as latitude. Taking a code deep dive using the screenshot below shows the coordinate assignment when compared with the database value as index zero for longitude and index one for latitude. Screenshot 2024-02-14 at 08 39 42

Using the screenshot below, it can be seen on the frontend that index zero is used for latitude instead of longitude. Screenshot 2024-02-14 at 08 58 20

mostafaznv commented 7 months ago

Hi @geekdanitek

Thank you for your report.

Are you encountering any issues with this package? Specifically, are the displayed results on your details page (lat/lng fields and map) mismatched?

According to the laravel-eloquent-spatial package, the first argument of the Point object represents latitude, and the second one is for longitude.

https://github.com/MatanYadaev/laravel-eloquent-spatial/blob/master/src/Objects/Point.php#L15

Therefore, I believe there shouldn't be any problem displaying lat/lng data on the Nova panel.