I have an input field on multiple pages where a user can type in their location and it autocompletes to the correct city.
Currently I am using Geobytes.com API for this however, their results are kind of ugly because they output the German Umlauts (äöü) and my audience is mostly German.
I have tried using the Maps / Places API but I'm never getting through, it always shows either "API not enabled" or this "Enable Billing Shit"
.... every other Google Product is mint and their developers are supposed to be the best in the world, so why is the Maps API the worst thing I've seen in my 10 years as a developer? smh
Any suggestions for a less trashy API for location search?
@Nikoisonfire You have to enable the google places API from the console and generate a key to bypass the error you are receiving. Google places API has a language setting which you can use to return the results in a specific supported language.
Other alternatives you can look into are mapbox and sygic.
I have tried enabling everything, swapping out keys, security rules etc.
Seems like GCP wants me to pay a million dollars a month to use their service XD
thanks for the other recommendations
Is the root problem that the umlauts don't come out well in your logs? If so, would it make sense to just take your existing API's output and strip the diacritical marks?
You'll need to figure out how to do that in your language of choice, but there's a good chance that the Unicode API has a function to translate a Unicode string between "normal forms." If you convert to one of the decomposed normal forms (
NFDfor "normal form, decomposed," for example), you can strip off any character in the\u0300to\u036frange (diacritical marks), which will leave you with plain Latin text, plus any non-letter characters.Well, except for the L-with-stroke most commonly found in Polish. For some reason, the stroke part isn't considered a diacritical mark, even though there's an identical stroke in that range. That could be relevant, since Poland is nearby...
It's not they don't come out well, the API im using apparently dosent use these charsets. Therefore the German town Lübeck becomes Lubeck... which in the frontend (im using the value for public user profile) looks pretty ugly tbh
Gotcha. The problem is the other way around from the way I read it, which...yeah, that's definitely not acceptable, and probably insulting for a lot of people.
GeoBytes has a few services. Is this the IP Geolocation? Or could their results be replaced by or supplemented with Open Street Map Names results? I can't find a public API on a superficial search and it might be too heavy to run on your server, but it looks like it does a nice job of finding the right place from mangled names.
Here's an article i found on getting OSM data, if u're interested
https://gis.stackexchange.com/questions/185793/is-there-a-way-to-retrieve-all-cities-in-the-world-from-openstreetmap
I was honestly thinking of just downloading and extracting OSM Data (All world cities) and just reading an in-memory JSON file (or splitting into first letter, idk) or building my own API for it...
Ah, yeah, then the Names server might be at least close to what you want. The handful of mangled/Latinized international cities I tried through their UI came back as expected.
I'm not sure if I can help you with a places API, but if you'd like to display a location based on IP I'd recommend. https://www.npmjs.com/package/location-please