Scandit.Geolocation.PositionWatcher

new PositionWatcher()

Methods

stop(): Promise

Stops watching for position changes

Returns:
Examples
Watching for location changes
  • JavaScript
  • ES6
var positionWatcher = Scandit.Geolocation.watch(function(position) {
  console.log('Location changed, new location is: ' + position.latitude + ', ' + position.longitude);
}, function(reason) {
  console.log('Something went wrong, reason: ' + reason);
}, {highAccuracy: true});

positionWatcher.stop();
let positionWatcher = Scandit.Geolocation.watch(position => {
  console.log(`Location changed, new location is: ${position.latitude}, ${position.longitude}`);
}, reason => {
  console.log(`Something went wrong, reason: ${reason}`);
}, {highAccuracy: true});

positionWatcher.stop();