I am working on a site that uses HTML5 Geolocation. Here is code I am using:
html:
<button onclick="getLocation()">Try It</button>
js
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
console.log('Geolocation is not supported by this browser.');
}
}
function showPosition(position) {
console.log(position.coords);
alert(position.coords.latitude);
alert(position.coords.longitude);
}
Everything seem to works well, but some users are getting KCLError Domain error
. Here are their comments:
I did not found any solution or reasons related to HTML about this error.
Everything seem to works fine, but some users get
KCLError Domain error
I'm guessing it might be a device related bug than of an app. From my point of view your code is pretty much "standard" when it comes to consuming the API.
Update from OP:
So the KCLError Domain error error was not retated to html5 geolocation code but to users GSM triangulation, reverse IP geolocation or WiFi network database lookups.
I was confused by this error because it was not self explanatory and here is where I made a mistake, this error is not strict error code it just additional error message and the error code was error.POSITION_UNAVAILABLE
and this code is well known.
UPDATE FROM CUSTOMER:
I upgraded the OS on my iPad today and location services have started working again. So all good now