onury / geolocator

A utility for getting geo-location information via HTML5 and IP look-ups, geocoding, address look-ups, distance and durations, timezone information and more...
https://onury.io/geolocator
MIT License
642 stars 107 forks source link

GeoError happening #62

Closed adrianobarroso closed 6 years ago

adrianobarroso commented 6 years ago

Hello everyone, I'm having this error which started a couple of days ago.

Have anyone gone through this error too?

fetch.js:229 GET https://geoip.nekudo.com/shutdown net::ERR_ABORTED 404

geolocator.js:957

{
  "name": "GeoError",
  "code": "UNKNOWN_ERROR",
  "message": "Could not load source at https://geoip.nekudo.com/api↵[object Event]",
  "stack": "GeoError: Could not load source at https://geoip.n…/libs/geolocator/2.1.3/geolocator.min.js:1:11824)"
}
sterien7 commented 6 years ago

I also get this error. Is there a bug fix for that

onury commented 6 years ago

This is due to service change. Geolocator was using nekudo as the Geo IP source, now the service is changed. See this notice.

The reason for using nekudo is that it was the only provider that supported HTTPS for free. Now it's changed to a service named ipapi. It still has a free plan but for HTTPS you need a paid plan. (I have no affiliation with them.)

If you know of a free service that supports HTTPS, we can make that default for geolocator.

For now, a workaround is to use the .setGeoIPSource() method to use another service. See examples here.

adrianobarroso commented 6 years ago

Thanks @onury

I changed my call to only .locate() and now is working

Was getting the error using the method .locateByIP()