How to get the best GPS position Geolocation APIIs there a way to get the method how the location was...
How to balance a monster modification (zombie)?
Can "few" be used as a subject? If so, what is the rule?
How to understand 「僕は誰より彼女が好きなんだ。」
Animating wave motion in water
Are hand made posters acceptable in Academia?
Unfrosted light bulb
Homology of the fiber
Symbolism of 18 Journeyers
What is the reasoning behind standardization (dividing by standard deviation)?
Does convergence of polynomials imply that of its coefficients?
I got the following comment from a reputed math journal. What does it mean?
Should a narrator ever describe things based on a characters view instead of fact?
Why is participating in the European Parliamentary elections used as a threat?
What favor did Moody owe Dumbledore?
How to find the largest number(s) in a list of elements, possibly non-unique?
The English Debate
How are passwords stolen from companies if they only store hashes?
PTIJ: Which Dr. Seuss books should one obtain?
Print last inputted byte
Do native speakers use "ultima" and "proxima" frequently in spoken English?
Which partition to make active?
Can other pieces capture a threatening piece and prevent a checkmate?
Nested Dynamic SOQL Query
Why I don't get the wanted width of tcbox?
How to get the best GPS position Geolocation API
Is there a way to get the method how the location was processed?Whats steps can I suggest to achieve the best Geolocation ResultHTML5 Geolocation with ArcGIS for JavaScript API?Dynamically update position of geolocation marker in Openlayers 3How to toggle custom geolocation marker in OpenLayers 3?Changing the geolocation of a point in the mapUpdate Leaflet circleMarker position with Android GPSstandard for generating a geolocation error ellipse from lines of position/bearingHow to move geolocation in OpenLayers 5 programaticallyHow external GPS can feed HTML5 geolocation API for django-leaflet
I want to get the most accurate position of my mobile phone with android. I'm comparing accuracy value in 2 seconds interval and if value is less than last value I'm trying to keep the position in <p>
. It looks fine but if accuracy of gps is less than 10 or 11 id doesn't save. I know that accuracy of phone gps is not big but it looks like a javascript bug. Any help? Here is my basic concept.
check this link in your mobile phone browser(firefox)
and code
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get your coordinates.</p>
<button id="measure">measure1</button>
<button id="start">start</button>
<button id="stop">stop</button>
<p id="demo">x</p>
<p id="demo2">y</p>
<input type="text" id="demo3">reference accuracy <br>
<input type="text" id="demo4">last accuracy <br>
<P id="demo5"></p>
<script>
var x = document.getElementById("demo");
var y = document.getElementById("demo2");
var z = document.getElementById("demo3");
var q = document.getElementById("demo4");
var q2 = document.getElementById("demo5");
document.getElementById("measure").onclick = getLocation;
document.getElementById("start").onclick = clockStart;
document.getElementById("stop").onclick = clockStop;
var timerId // current timer if started
function clockStart() {
if (timerId) return
getLocation()
timerId = setInterval(getCorrection, 2000)
}
function clockStop() {
clearInterval(timerId)
timerId = null
}
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function getCorrection() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition2, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
z.value = position.coords.accuracy;
}
function showPosition2(position) {
y.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
// window.document.body.onload = showPosition;
q.value = position.coords.accuracy;
if ( z.value > q.value){z.value = position.coords.accuracy;
q2.innerHTML = position.coords.accuracy + " " + position.coords.latitude + ' ' + position.coords.longitude + " the best accurancy with positon";
console.log('better')}
else (z.value < q.value); { console.log('worse')}
}
function showError(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "Uşytkownik nie zezwolił na geolokalizację?"
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Informacja o lokalizacji jest niedostępna"
break;
case error.TIMEOUT:
x.innerHTML = "Przekroczono czas zapytania"
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "Wystąpił nieznany błąd"
}
}
</script>
</body>
</html>
javascript geolocation
add a comment |
I want to get the most accurate position of my mobile phone with android. I'm comparing accuracy value in 2 seconds interval and if value is less than last value I'm trying to keep the position in <p>
. It looks fine but if accuracy of gps is less than 10 or 11 id doesn't save. I know that accuracy of phone gps is not big but it looks like a javascript bug. Any help? Here is my basic concept.
check this link in your mobile phone browser(firefox)
and code
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get your coordinates.</p>
<button id="measure">measure1</button>
<button id="start">start</button>
<button id="stop">stop</button>
<p id="demo">x</p>
<p id="demo2">y</p>
<input type="text" id="demo3">reference accuracy <br>
<input type="text" id="demo4">last accuracy <br>
<P id="demo5"></p>
<script>
var x = document.getElementById("demo");
var y = document.getElementById("demo2");
var z = document.getElementById("demo3");
var q = document.getElementById("demo4");
var q2 = document.getElementById("demo5");
document.getElementById("measure").onclick = getLocation;
document.getElementById("start").onclick = clockStart;
document.getElementById("stop").onclick = clockStop;
var timerId // current timer if started
function clockStart() {
if (timerId) return
getLocation()
timerId = setInterval(getCorrection, 2000)
}
function clockStop() {
clearInterval(timerId)
timerId = null
}
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function getCorrection() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition2, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
z.value = position.coords.accuracy;
}
function showPosition2(position) {
y.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
// window.document.body.onload = showPosition;
q.value = position.coords.accuracy;
if ( z.value > q.value){z.value = position.coords.accuracy;
q2.innerHTML = position.coords.accuracy + " " + position.coords.latitude + ' ' + position.coords.longitude + " the best accurancy with positon";
console.log('better')}
else (z.value < q.value); { console.log('worse')}
}
function showError(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "Uşytkownik nie zezwolił na geolokalizację?"
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Informacja o lokalizacji jest niedostępna"
break;
case error.TIMEOUT:
x.innerHTML = "Przekroczono czas zapytania"
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "Wystąpił nieznany błąd"
}
}
</script>
</body>
</html>
javascript geolocation
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57
add a comment |
I want to get the most accurate position of my mobile phone with android. I'm comparing accuracy value in 2 seconds interval and if value is less than last value I'm trying to keep the position in <p>
. It looks fine but if accuracy of gps is less than 10 or 11 id doesn't save. I know that accuracy of phone gps is not big but it looks like a javascript bug. Any help? Here is my basic concept.
check this link in your mobile phone browser(firefox)
and code
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get your coordinates.</p>
<button id="measure">measure1</button>
<button id="start">start</button>
<button id="stop">stop</button>
<p id="demo">x</p>
<p id="demo2">y</p>
<input type="text" id="demo3">reference accuracy <br>
<input type="text" id="demo4">last accuracy <br>
<P id="demo5"></p>
<script>
var x = document.getElementById("demo");
var y = document.getElementById("demo2");
var z = document.getElementById("demo3");
var q = document.getElementById("demo4");
var q2 = document.getElementById("demo5");
document.getElementById("measure").onclick = getLocation;
document.getElementById("start").onclick = clockStart;
document.getElementById("stop").onclick = clockStop;
var timerId // current timer if started
function clockStart() {
if (timerId) return
getLocation()
timerId = setInterval(getCorrection, 2000)
}
function clockStop() {
clearInterval(timerId)
timerId = null
}
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function getCorrection() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition2, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
z.value = position.coords.accuracy;
}
function showPosition2(position) {
y.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
// window.document.body.onload = showPosition;
q.value = position.coords.accuracy;
if ( z.value > q.value){z.value = position.coords.accuracy;
q2.innerHTML = position.coords.accuracy + " " + position.coords.latitude + ' ' + position.coords.longitude + " the best accurancy with positon";
console.log('better')}
else (z.value < q.value); { console.log('worse')}
}
function showError(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "Uşytkownik nie zezwolił na geolokalizację?"
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Informacja o lokalizacji jest niedostępna"
break;
case error.TIMEOUT:
x.innerHTML = "Przekroczono czas zapytania"
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "Wystąpił nieznany błąd"
}
}
</script>
</body>
</html>
javascript geolocation
I want to get the most accurate position of my mobile phone with android. I'm comparing accuracy value in 2 seconds interval and if value is less than last value I'm trying to keep the position in <p>
. It looks fine but if accuracy of gps is less than 10 or 11 id doesn't save. I know that accuracy of phone gps is not big but it looks like a javascript bug. Any help? Here is my basic concept.
check this link in your mobile phone browser(firefox)
and code
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get your coordinates.</p>
<button id="measure">measure1</button>
<button id="start">start</button>
<button id="stop">stop</button>
<p id="demo">x</p>
<p id="demo2">y</p>
<input type="text" id="demo3">reference accuracy <br>
<input type="text" id="demo4">last accuracy <br>
<P id="demo5"></p>
<script>
var x = document.getElementById("demo");
var y = document.getElementById("demo2");
var z = document.getElementById("demo3");
var q = document.getElementById("demo4");
var q2 = document.getElementById("demo5");
document.getElementById("measure").onclick = getLocation;
document.getElementById("start").onclick = clockStart;
document.getElementById("stop").onclick = clockStop;
var timerId // current timer if started
function clockStart() {
if (timerId) return
getLocation()
timerId = setInterval(getCorrection, 2000)
}
function clockStop() {
clearInterval(timerId)
timerId = null
}
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function getCorrection() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition2, showError, {enableHighAccuracy: true});
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
z.value = position.coords.accuracy;
}
function showPosition2(position) {
y.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude +
"<br>Accuracy: " + position.coords.accuracy +
"<br>Speed: " + position.coords.speed + " m/s" +
"<br>Altitude: " + position.coords.altitude +
"<br>altitudeAccuracy: " + position.coords.altitudeAccuracy +
"<br>Headin: " + position.coords.heading +
"<br>Timestamp: " + position.timestamp ;
// window.document.body.onload = showPosition;
q.value = position.coords.accuracy;
if ( z.value > q.value){z.value = position.coords.accuracy;
q2.innerHTML = position.coords.accuracy + " " + position.coords.latitude + ' ' + position.coords.longitude + " the best accurancy with positon";
console.log('better')}
else (z.value < q.value); { console.log('worse')}
}
function showError(error) {
switch (error.code) {
case error.PERMISSION_DENIED:
x.innerHTML = "Uşytkownik nie zezwolił na geolokalizację?"
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML = "Informacja o lokalizacji jest niedostępna"
break;
case error.TIMEOUT:
x.innerHTML = "Przekroczono czas zapytania"
break;
case error.UNKNOWN_ERROR:
x.innerHTML = "Wystąpił nieznany błąd"
}
}
</script>
</body>
</html>
javascript geolocation
javascript geolocation
asked Apr 27 '16 at 11:38
pawaeluspawaelus
107211
107211
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57
add a comment |
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57
add a comment |
1 Answer
1
active
oldest
votes
Sadly, you can't.
The HTML5 Geolocation API works by using the browser implementation of the spec. Browsers like Chrome will send data to Google servers in order to try to improve the location(Network information, like your IP, as described here), however, that doesn't always happen nor is guaranteed to, the browser/OS may choose what it think is the best, be it GPS sensor, network triangulation or even some plataform specific trickery like Bluetooth positioning.
You can always try making requests to location providers(There's a ton on Google), tho, it'll probably lead to poor results compared to the standard API.
Another option would be comparing your results with the Generic Sensor API, that can potentially give information about the device acceleration and movement.
If positioning is REALLY crucial to your application, I suggest that you try some native development, there, you can use sensors and OS specific calls more efficiently. This is also more evident since different browser implementations can lead to different user results, not to mention the incompatibility (The generic sensor API is an example of poor compatibility).
In the future, there's an extension of the Generic Sensor API that'll expose more position related sensors, you can read more of the draft here.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f191358%2fhow-to-get-the-best-gps-position-geolocation-api%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sadly, you can't.
The HTML5 Geolocation API works by using the browser implementation of the spec. Browsers like Chrome will send data to Google servers in order to try to improve the location(Network information, like your IP, as described here), however, that doesn't always happen nor is guaranteed to, the browser/OS may choose what it think is the best, be it GPS sensor, network triangulation or even some plataform specific trickery like Bluetooth positioning.
You can always try making requests to location providers(There's a ton on Google), tho, it'll probably lead to poor results compared to the standard API.
Another option would be comparing your results with the Generic Sensor API, that can potentially give information about the device acceleration and movement.
If positioning is REALLY crucial to your application, I suggest that you try some native development, there, you can use sensors and OS specific calls more efficiently. This is also more evident since different browser implementations can lead to different user results, not to mention the incompatibility (The generic sensor API is an example of poor compatibility).
In the future, there's an extension of the Generic Sensor API that'll expose more position related sensors, you can read more of the draft here.
New contributor
add a comment |
Sadly, you can't.
The HTML5 Geolocation API works by using the browser implementation of the spec. Browsers like Chrome will send data to Google servers in order to try to improve the location(Network information, like your IP, as described here), however, that doesn't always happen nor is guaranteed to, the browser/OS may choose what it think is the best, be it GPS sensor, network triangulation or even some plataform specific trickery like Bluetooth positioning.
You can always try making requests to location providers(There's a ton on Google), tho, it'll probably lead to poor results compared to the standard API.
Another option would be comparing your results with the Generic Sensor API, that can potentially give information about the device acceleration and movement.
If positioning is REALLY crucial to your application, I suggest that you try some native development, there, you can use sensors and OS specific calls more efficiently. This is also more evident since different browser implementations can lead to different user results, not to mention the incompatibility (The generic sensor API is an example of poor compatibility).
In the future, there's an extension of the Generic Sensor API that'll expose more position related sensors, you can read more of the draft here.
New contributor
add a comment |
Sadly, you can't.
The HTML5 Geolocation API works by using the browser implementation of the spec. Browsers like Chrome will send data to Google servers in order to try to improve the location(Network information, like your IP, as described here), however, that doesn't always happen nor is guaranteed to, the browser/OS may choose what it think is the best, be it GPS sensor, network triangulation or even some plataform specific trickery like Bluetooth positioning.
You can always try making requests to location providers(There's a ton on Google), tho, it'll probably lead to poor results compared to the standard API.
Another option would be comparing your results with the Generic Sensor API, that can potentially give information about the device acceleration and movement.
If positioning is REALLY crucial to your application, I suggest that you try some native development, there, you can use sensors and OS specific calls more efficiently. This is also more evident since different browser implementations can lead to different user results, not to mention the incompatibility (The generic sensor API is an example of poor compatibility).
In the future, there's an extension of the Generic Sensor API that'll expose more position related sensors, you can read more of the draft here.
New contributor
Sadly, you can't.
The HTML5 Geolocation API works by using the browser implementation of the spec. Browsers like Chrome will send data to Google servers in order to try to improve the location(Network information, like your IP, as described here), however, that doesn't always happen nor is guaranteed to, the browser/OS may choose what it think is the best, be it GPS sensor, network triangulation or even some plataform specific trickery like Bluetooth positioning.
You can always try making requests to location providers(There's a ton on Google), tho, it'll probably lead to poor results compared to the standard API.
Another option would be comparing your results with the Generic Sensor API, that can potentially give information about the device acceleration and movement.
If positioning is REALLY crucial to your application, I suggest that you try some native development, there, you can use sensors and OS specific calls more efficiently. This is also more evident since different browser implementations can lead to different user results, not to mention the incompatibility (The generic sensor API is an example of poor compatibility).
In the future, there's an extension of the Generic Sensor API that'll expose more position related sensors, you can read more of the draft here.
New contributor
New contributor
answered 8 mins ago
Nick LeBlancNick LeBlanc
312
312
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f191358%2fhow-to-get-the-best-gps-position-geolocation-api%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
@Marcel Kohls says "try to compare values with parseFloat() or parseInt() functions, like: if( parseFloat(z.value) > parseFloat(q.value) ). This way you will be sure that js will be comparing numbers and not strings. I am saying this because on a string comparation, "2" is bigger than "10"." and it works :D
– pawaelus
Apr 29 '16 at 6:57