Geolocation Examples

Provides a consistent API to the geolocation on all platforms.

Here's a simple example that continuously logs updates on the user's distance to the Adtile office.

var adtile = new MotionStack.Geolocation.LatLon({
  lat: 32.914,
  lon: -117.235
});

var geolocation = new MotionStack.Geolocation();

geolocation.start(function(e) {
  // log distance from the Adtile
  // office to each geolocation reading
  console.log(adtile.distanceTo(e));
});