Hey there!! I’m really confused with geolocation. I’ve read some posts about it but no one seems to be quite the answer I’m looking for.
I have this simple code on my .js at codepen:
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position);
});
} else {
console.log("Not working");
}
}
$( document ).ready( function(){
getLocation();
});
I just want to see that it works before doing anything else. But when I refresh the page, all I get at the console is this:
pen.js:3 [Deprecation] getCurrentPosition and watchPosition usage in cross-origin iframes is deprecated and will be disabled in M63, around December 2017. To continue to use this feature, it must be enabled by the embedding document using Feature Policy, e.g. <iframe allow="geolocation" ...>. See https://goo.gl/EuHzyv for more details.
I’ve read something about allowing geolocation on iframe, but I don’t fully understand what that is or how could I do so. May be there’s some (or lots of) important things that I should learn before doing this, could someone point me on the right direction please?