-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
You now need a free API key (limited to 10000 queries/month)
http://api.ipstack.com/186.116.207.169?access_key=YOUR_ACCESS_KEY&output=json&legacy=1
🔗 https://github.com/apilayer/freegeoip/
EDIT: this is not an easy replacement for freegeoip.com since there free plan requires to add the ip manually and doesn't offer https.
A possible solution could be: http://geoip.nekudo.com/ (with some minor changes).
L.GeoIP = L.extend({
getPosition: function (ip, callback) {
//var url = "https://freegeoip.net/json/";
var url = "https://geoip.nekudo.com/apis/";
//...
if (status == 200) {
var geoip_response = JSON.parse(xhr.responseText);
// change these two lines
result.lat = geoip_response.location.latitude;
result.lng = geoip_response.location.longitude;
if (callback) {
callback(result);
}
}
//...
});Metadata
Metadata
Assignees
Labels
No labels