Lacerte / clima

MOVED TO https://codeberg.org/Lacerte/clima
Mozilla Public License 2.0
105 stars 14 forks source link

Dropdown search #314

Open Uj947nXmRqV2nRaWshKtHzTvckUUpD opened 2 years ago

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 2 years ago

The search bar should have a fropdown list showing found location matching search string and should contain the country or country code

prestosole commented 2 years ago

We had considered it before, but all the choices required some sort of GMS intervention, which we don't like in Clima. However, please feel free to offer any suggestions you may have!

triallax commented 2 years ago

Just like @PrestoSole said, we want to make it clear that we are not going to accept any GMS usage in Clima. That being said, we can use https://openweathermap.org/api/geocoding-api, which, given a complete city name (plus an optional country code, and a state name for US locations, which is also optional), will give back up to five matching locations.

https://github.com/Lacerte/clima/issues/267 is related.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 2 years ago

just fo reference - the open source project "forecastie" (https://f-droid.org/en/packages/cz.martykan.forecastie/) also uses openweathermap and it is able to show a list of matching locations without GMS

triallax commented 2 years ago

@fusionneur does it show matching locations even if you don't type the complete city name? For instance, does it show you cities named "London" if you put in "Londo"?

prestosole commented 2 years ago

@mhmdanas it does not, actually; It shows an "invalid city name" type error.

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented 2 years ago

yes you're right, it seems that forecastie isn't actually able to show matches based on part of the city's name. However if there are multiple cities with same name (eg. 4 cities named Rome in US and 1 in IT) they are shown in a different list, unlike in Clima. Also it seems that both clima and forecastie are able to correct misspelled cities (eg. Valeta -> Valletta)

triallax commented 2 years ago

However if there are multiple cities with same name (eg. 4 cities names Rome in US and 1 in IT) they are shown in a different list, unlike in Clima.

Well, that's exactly what I believe OpenWeatherMap supports, so we're gonna use that.

Also it seems that both clima and forecastie are able to correct misspelled cities (eg. Valeta -> Valletta)

Clima doesn't do anything of the sort, it's almost certaintly OpenWeatherMap doing that.