I am using HTML5 Geolocation feature. My code is well running in 'localhost' but problem in 'subdomain' .My code below:
if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, showError); } else { console.log("Geolocation is not supported by this browser."); } - The error message is: 'A Geolocation request can only be fulfilled in a secure context.'
- My localhost url: 'http://localhost/voice-of-mankind/'
- My subdomain url: 'http://vom.local.com/'
A Geolocation request can only be fulfilled in a secure context.. Please check the following answers: stackoverflow.com/questions/37192827/… and the following one: stackoverflow.com/questions/37835805/…