-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geolocation via google API service #67
Comments
Also just to add to this the current geolocation is fairly inaccurate (as noted in the docs) whilst using google's geolocation is pretty spot on. Is it not possible to utilise this in the plugin? |
Hi @splendidrob, thanks for raising this issue. It's a great question, one that requires serious consideration. The BackstoryThe ipstack API has been the preferred geolocation service since the dawn of Smart Map, around 8 years ago. It wasn't always called "ipstack"... it was originally called "FreeGeoIP", and was completely free (but sometimes unstable). Then the company got bought, changed names, and has slowly changed their policies. I was not aware that ipstack now has a limit of only 100 free requests per month, I have no idea when that limitation was introduced. Clearly the company has changed a lot over the past 8 years, and it's extremely fair to now consider our other options. The PlanI've tinkered with the idea of switching over to the Google Geolocation API, although I still don't know much about it. I'll need to do a bit of research, of course, to figure out the best way to introduce that API. Once the API is supported, we may drop support for the ipstack and MaxMind APIs. In terms of a timeline, I'm not certain as to when this will be prioritized. I can say, however, that it will almost certainly be tied to a major release. It will be considered a breaking change if we drop support for ipstack and MaxMind. Thanks again for raising this issue! We'll post any updates back on this thread. 👍 |
Here's how I achieved it in the end:
|
That's a great front-end solution, thanks for sharing @splendidrob! Just to be clear to future readers... that solution doesn't use the Google Geolocation API. It is relying on native JavaScript geolocation in the browser. While there are some drawbacks to this approach (the user may decline to be geolocated), it will also give you the most accurate possible results. Thanks again for the snippet, I'm sure some folks will find it helpful! 👍 |
Just wandering why geolocation requires a third party service when google provides this directly as part of its API? https://developers.google.com/maps/documentation/geolocation/overview
The 'Free' service the docs suggest (https://ipstack.com/product) only allow 100 requests a month before charging.
Many thanks!
The text was updated successfully, but these errors were encountered: