We would like to use the following geocoder:
var nominatim = L.Control.Geocoder.nominatim({
reverseQueryParams: {
format: "geocodejson",
addressdetails: 1,
"accept-language": "de-AT,de-DE",
},
geocodingQueryParams: {
countrycodes: "at",
"accept-language": "de-AT,de-DE",
},
});
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:

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 thatlatandlonare 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.nominatimoptions 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: