X
Thinta lapha ukuze uye kuveshini yamakhalekhukhwini kusayithi.

Isithangami Sabeseki

Lolu chungechunge lwabekwa kunqolobane. Uyacelwa ubuze umbuzo omusha uma udinga usizo.

How do I get a geolocate api jey?

Kuphostiwe

I want to use Mozilla geolocate on a web page as the Google one requires https - how do I obtain the Mozilla api-key? Thank You

I want to use Mozilla geolocate on a web page as the Google one requires https - how do I obtain the Mozilla api-key? Thank You

Eminye Imininingwane Yohlelo

Fakela amapulagi

  • Adobe PDF Plug-In For Firefox and Netscape 15.20.20039
  • Google Update
  • Intel web components for Intel® Identity Protection Technology
  • Intel web components updater - Installs and updates the Intel web components
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Next Generation Java Plug-in 11.111.2 for Mozilla browsers
  • np-mswmp
  • Adobe Shockwave for Director Netscape plug-in, version 12.2.2.172
  • 5.1.50901.0
  • NPWLPG

Isisebenziso

  • I-ejenti Engumsebenzisi: Mozilla/5.0 (Windows NT 6.1; rv:51.0) Gecko/20100101 Firefox/51.0

Eminye Imininingwane

the-edmeister
  • Top 25 Contributor
  • Moderator
5411 izisombululo 40290 izimpendulo
Kuphostiwe

See these MDN pages.

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation

I would be surprised if the Firefox Geolocation API worked on HTTP.

See these MDN pages. https://developer.mozilla.org/en-US/docs/Web/API/Geolocation https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/Using_geolocation I would be surprised if the Firefox Geolocation API worked on HTTP.

Umnikazi wombuzo

I need an api key to try it! How do I get one? Yjanx

I need an api key to try it! How do I get one? Yjanx

Umnikazi wombuzo

Oops, thanx I meant!

Oops, thanx I meant!

Umnikazi wombuzo

I am using https://location.services.mozilla.com/v1/geolocate?key=test but get status 0 - invalid key?

I am using https://location.services.mozilla.com/v1/geolocate?key=test but get status 0 - invalid key?
cor-el
  • Top 10 Contributor
  • Moderator
17567 izisombululo 158896 izimpendulo
Kuphostiwe
See: *https://location.services.mozilla.com/api
cor-el
  • Top 10 Contributor
  • Moderator
17567 izisombululo 158896 izimpendulo
Kuphostiwe

Works for me: https://location.services.mozilla.com/v1/geolocate?key=test

  • {"location": {"lat": xx.xxxx, "lng": x.xxxx}, "accuracy": 1000.0}
Works for me: https://location.services.mozilla.com/v1/geolocate?key=test *{"location": {"lat": xx.xxxx, "lng": x.xxxx}, "accuracy": 1000.0}

Umnikazi wombuzo

Not for me! var url = 'https://location.services.mozilla.com/v1/geolocate?key=test'; xhr.open('GET', url); xhr.setRequestHeader('Content-type', 'application/json'); Gives readystate:4 status:0 and "text" in text!

Not for me! var url = 'https://location.services.mozilla.com/v1/geolocate?key=test'; xhr.open('GET', url); xhr.setRequestHeader('Content-type', 'application/json'); Gives readystate:4 status:0 and "text" in text!
cor-el
  • Top 10 Contributor
  • Moderator
17567 izisombululo 158896 izimpendulo
Kuphostiwe
var url = 'https://location.services.mozilla.com/v1/geolocate?key=test'; 
var xhr=new XMLHttpRequest();
xhr.open("GET",url,true);
xhr.onload=function(e){if(xhr.readyState===4){if(xhr.status===200){console.log(xhr.responseText)}else{console.error(xhr.statusText)}}};
xhr.onerror=function(e){console.error(xhr.statusText)};
xhr.send(null);
<pre><nowiki>var url = 'https://location.services.mozilla.com/v1/geolocate?key=test'; var xhr=new XMLHttpRequest(); xhr.open("GET",url,true); xhr.onload=function(e){if(xhr.readyState===4){if(xhr.status===200){console.log(xhr.responseText)}else{console.error(xhr.statusText)}}}; xhr.onerror=function(e){console.error(xhr.statusText)}; xhr.send(null);</nowiki></pre>

Umnikazi wombuzo

Yes and I get - readystate:4 status:0 text when I log the 3 fields to console, which implies invalid key! Possibly it's because I'm in Thailand?

Yes and I get - readystate:4 status:0 text when I log the 3 fields to console, which implies invalid key! Possibly it's because I'm in Thailand?
cor-el
  • Top 10 Contributor
  • Moderator
17567 izisombululo 158896 izimpendulo
Kuphostiwe

Does it work at least when you visit a website that uses geolocation?

Does it work at least when you visit a website that uses geolocation? *https://www.flickr.com/map (find my location) *http://www.techsupportalert.com/content/how-enable-or-disable-location-sensing-windows-7-and-8.htm

Umnikazi wombuzo

Thanx. I've no sensor on the pc but, Google maps does get the approximate location though this obviously uses https!

Thanx. I've no sensor on the pc but, Google maps does get the approximate location though this obviously uses https!