Closed DrPaulBrewer closed 2 months ago
SSL is required for geolocation to work.
Ideally, the http/https endpoint would be detected on the client and the button shown or hidden.
Here is where the 'use web geolocation' click is handled:
In Using the Geolocation API, MDN note:
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
There are no errors in the browser console associated with SSL being off. Experimentation injecting code into the browser console at an http vs https site shows that geolocation function will exist but do nothing under http, and will create a consent popup and behave correctly under https.
Check location.protocol === 'https:'
to see if the client is connected via https.
(see also https://stackoverflow.com/questions/4723213/detect-http-or-https-then-force-https-in-javascript )
Note: Creation of conditional HTML in the meteor html file with #if
requires defining a template helper in the javascript.
You can't test location.protocol
directly in the HTML
(See also https://forums.meteor.com/t/template-if-condition/25517 )
On the QTH tab of a signed-in web client, clicking "Use web geolocation" currently does not return a location.
Possible causes: