You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when doing a reverse geocode lookup, an empty array is returned due to the following if-statement (this is minified JS so not very helpful):
The chain of failures is the following:
NominatimResult (defined here) is incorrect and does not account for different format flags being used, which further leads to incorrect expectations about the data returned by Nominatim.
reverse (defined here) incorrectly assumes that lat and lon are present in the returned data and returns an empty array instead of a) useful error information or b) data.
My suggestions are:
Correct this behaviour and return the expected result in the "geocodejson"-format. (Recommended)
Document this incorrect and unexpected behaviour and alter the L.Control.Geocoder.nominatim options to respond with an error when trying to pass the "geocodejson" format.
Update:
The response from nominatim when using the "geocodejson"-format looks like the following:
The text was updated successfully, but these errors were encountered:
yeah, the error handling should be improved overall in leaflet-control-geocoder.
Nominatim support a bunch of different output formats, see https://nominatim.org/release-docs/latest/api/Output/. Currently, only the default JSON is supported. Being curios, why are you overriding the format to GeocodeJSON?
We would like to use the following geocoder:
But when doing a reverse geocode lookup, an empty array is returned due to the following if-statement (this is minified JS so not very helpful):
The chain of failures is the following:
NominatimResult
(defined here) is incorrect and does not account for different format flags being used, which further leads to incorrect expectations about the data returned by Nominatim.reverse
(defined here) incorrectly assumes thatlat
andlon
are present in the returned data and returns an empty array instead of a) useful error information or b) data.My suggestions are:
L.Control.Geocoder.nominatim
options to respond with an error when trying to pass the "geocodejson" format.Update:
The response from nominatim when using the "geocodejson"-format looks like the following:
The text was updated successfully, but these errors were encountered: