Frojd / wagtail-geo-widget

Wagtail-Geo-Widget is the complete map solution for your Wagtail site.
MIT License
138 stars 37 forks source link

Reverse geocoding #110

Open mikaraunio opened 1 year ago

mikaraunio commented 1 year ago

With wagtail==4.0.4 and wagtailgeowidget==6.2.0, I have setup linked address and position fields as in the docs, and tested with both Google Maps and Leaflet + Nominatim.

When I change the address, the pin moves on the map as expected.

However, if I move the pin, the address does not update. Is it supposed to, ie. is reverse geocoding supported?

If it isn't, it would be great to have an option to either prevent the user from moving the pin (so the map would just be a 'read-only' confirmation of the address), or to empty the address field if the pin is moved - so as to prevent situations where the address and position are out of sync.

marteinn commented 1 year ago

Hi mikaraunio and apologies for the late reply.

However, if I move the pin, the address does not update. Is it supposed to, ie. is reverse geocoding supported?

This is the expected behavior, we do not have reverse geocoding from lat/long to string. The reason is that I have never seen this requirement, it might also result in a lot of costly requests against the geocoding API.

If it isn't, it would be great to have an option to either prevent the user from moving the pin (so the map would just be a 'read-only' confirmation of the address), or to empty the address field if the pin is moved - so as to prevent situations where the address and position are out of sync.

I think having a read-only map is a good idea, contributions are welcome!