Add API for getting just the closest reverse geocoded answer

Because we don't care about anything that is nearby when the user clicks
on the map, we just want the closest thing.
This commit is contained in:
Eli Ribble 2026-04-27 19:38:17 +00:00
parent b92697b8c8
commit 96498c01bf
No known key found for this signature in database
6 changed files with 132 additions and 44 deletions

View file

@ -102,6 +102,7 @@ func AddRoutes(r *mux.Router) {
geocode := resource.Geocode(router)
r.Handle("/geocode/by-gid/{id:.*}", handlerJSON(geocode.ByGID)).Methods("GET")
r.Handle("/geocode/reverse", handlerJSONPost(geocode.Reverse)).Methods("POST")
r.Handle("/geocode/reverse/closest", handlerJSONPost(geocode.ReverseClosest)).Methods("POST")
r.Handle("/geocode/suggestion", handlerJSONSlice(geocode.SuggestionList)).Methods("GET")
publicreport := resource.Publicreport(router)
r.Handle("/publicreport/{id}", handlerBasic(publicreport.ByID)).Methods("GET").Name("publicreport.ByIDGet")