django-mapbox-location-field
django-mapbox-location-field copied to clipboard
Coordinates are not the same after form error
So I click on the map, everything is great, coordinates are good, when I save the form everything is good too, even if I then edit the form and save again it works great.

But when form has errors, page reloads, and coordinates are messed up for some reason, and now I'm in Africa 😄
Coordinates are kinda same, just missing first number in the second coordinate...

I actually don't know, but maybe it is something with Firefox, it should work, there's no reason to fail like that...
IMO
I didn't fully review your js code, but I saw that there's some guessing with lat/lng coords. I will review it a bit further and maybe make a PR if I will have time. I think lat and lng should always be lat/lng, not lng/lat...
P.S. Thank you for your work, this project is working better than any other django map library out there!
I'll try to find some time to look into it. Regarding the coordinates' order, I've explained myself in docs: https://github.com/simon-the-shark/django-mapbox-location-field#versions-140
The EPSG:4326 standard is clear: it should be lat/lng. However, most spatial software such as PostGIS uses lng/lat
I think I've got it worked out. Should be rolling out a patch in the upcoming days.
@simon-the-shark Thanks a lot! Also there's another issue(kinda), but I'll mention it here: I think when pasting coordinates to coordinates field, map should react to that... I don't know if it's an issue or another feature to add 😄.
The EPSG:4326 standard is clear: it should be lat/lng. However, most spatial software such as PostGIS uses lng/lat
Is the patch available somewhere? Need help testing/finishing it up? Thanks!
Is the patch available somewhere? Need help testing/finishing it up? Thanks!
I have made an ugly patch as I have to deploy the application. Probably not general enough to make a pull request but if anyone needs it please ask replying to this message
Which issue are you referring to?
The one in this page: "Coordinates are not the same after form error #38 "
I still have an inconsistent behavior with regards to coordinate order rendered in the widget map, it's hard to replicate so I won't go into details until I have some more information. Can you confirm if this problem was fixed in version 2.0.0 though?
I think I've got it worked out. Should be rolling out a patch in the upcoming days.
I recall working on it but the issue is from Apr and the latest release is from Mar, so there's no option for the patch to be included in 2.0. Something weird happened here. ¯_(ツ)_/¯ 🤷🏻♂️ I have no idea where this patch is 🤷🏻♂️ I will try to sit down to it soon and investigate further again.