minad/osm

FEATURE REQUEST: Get osm-search to return the name of item selected

Closed this issue · 7 comments

rswgnu commented

If I call osm-search with a partial name match, it shows me completions and allows me to select one but there is presently no return value that shows what got selected. Since osm--goto is the last call within this function, just have that return the name it is given or nil if none. Then change osm-goto to not return nil but return the result of osm--goto as well.

Also, if there is a name associated with an osm--goto call, it would be good to see that name on the map display somewhere, e.g. on the modeline or in the minibuffer, without having to move the mouse to hover over the mark on the map highlighting the selection. Immediate feedback is better. Thanks.

Try this as an example to test: (osm-search "Embassy of France, 58")

minad commented

Hi Robert, why do you need this? It seems a bit unconventional to return the name from osm-search or osm--goto. An undefined or nil return value is more natural.

rswgnu commented
minad commented

Okay and what do you need this for? osm.el is not really supposed to be a query API for the nominatim geo naming service. Even if osm-search would return the full name or location it would still lead to a jump in the map, which is probably not desired if you want to call this programmatically?

minad commented

I extracted a function osm--search to search by name. It returns a list of results. I hope this helps for your use case.

rswgnu commented
minad commented

Sure, just pass the results from osm--search to completing-read. Alternatively take the first match?

rswgnu commented