New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a message if the location look up fails #10

Closed
powellc opened this Issue Dec 8, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@powellc
Member

powellc commented Dec 8, 2014

The message should probably prompt folks to reload their browser (or even provide them with a button to do that with javascript).

@serret887

This comment has been minimized.

Show comment
Hide comment
@serret887

serret887 Mar 14, 2016

Hi I found your request in code for America it seems to be a little old but maybe you are looking something like this or maybe you already have that implemented

var x = document.getElementById("your element");
function getLocation() {
    if (navigator.geolocation) {
//it allow geoposition
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
}
function showPosition(position) {
if(position){
    x.innerHTML = "Latitude: " + position.coords.latitude + 
    "<br>Longitude: " + position.coords.longitude; 
}else{
prompt("What ever you wanna do");
}
}

serret887 commented Mar 14, 2016

Hi I found your request in code for America it seems to be a little old but maybe you are looking something like this or maybe you already have that implemented

var x = document.getElementById("your element");
function getLocation() {
    if (navigator.geolocation) {
//it allow geoposition
        navigator.geolocation.getCurrentPosition(showPosition);
    } else {
        x.innerHTML = "Geolocation is not supported by this browser.";
    }
}
function showPosition(position) {
if(position){
    x.innerHTML = "Latitude: " + position.coords.latitude + 
    "<br>Longitude: " + position.coords.longitude; 
}else{
prompt("What ever you wanna do");
}
}

@powellc powellc closed this Feb 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment