Question

I'm using the Javascript below to detect the geolocation service:

var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current position is:');
  console.log('Latitude : ' + crd.latitude);
  console.log('Longitude: ' + crd.longitude);
  console.log('More or less ' + crd.accuracy + ' meters.');
};

function error(err) {
  console.warn('ERROR(' + err.code + '): ' + err.message);
};

navigator.geolocation.getCurrentPosition(success, error, options);

Android, Apple prompts for geo location service whereas Nokia Lumia 920 doesn't prompt. Could someone please confirm whether I need to enable anything? Location detector is already enabled.

Was it helpful?

Solution

By default the Nokia Lumia 920 runs an IE10 browser which does support HTML5 geolocation.

You can check this using the link on w3schools.com. Clicking the try it button, it prompted me for my location as you would expect. The site also helpfully provides the code.

The HERE Maps API for JavaScript offers the nokia.maps.positioning.Manager which wraps this nicely and also works in mobile - try the example here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top