This is my code but it does not enable GPS in wix Iframe
getLocation()
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
window.alert("Geolocation is not supported by this browser.");
}
}
function showPosition(position) {
window.x= []
window.x.push(position.coords.latitude)
window.x.push(position.coords.longitude);
}
I tried your code in Wix iframe, and it worked perfectly on my iPhone.
first time it asked for permission to access location and when I approved it, it showed the coordinates (I’ve added a few lines to show the results).
You should put the script between the tags.
I tested your code and found out that it works on sites connected to your own domain and does not work if it is under the wixsite.com generic domain.
@chidiejike is it premium and already connected to your own domain?
If it is, I don’t know what the problem is. I tried your code and it worked on my iphone.
@jonatandor35 Please have you tried it on desktop?, My Premium account is on Wix. Is there any other domain name that is not owned by the Admin? I don’t understand. I own the domain name hosted in Wix.