title: get geolocation if its changed more than thousand feet
body: <p>I am working on an angular 6 app and I need to track a location of the device after every 15 minutes. I need to also check that the location should not be same as last recorded location and it should be different and more than 100 meters than the previous recorded location coordinates. </p>
  
  <p>Any example for doing this kind of stuff would be good help. </p>
  
  <p>I am using <code>window.navigator.geolocation.getCurrentPosition</code> for getting location after every 5 minutes and I am getting the data but want to avoid the duplication of the data and the data should be more than 100 meters apart. </p>
  
  <p>Here is the code</p>
  
  <pre><code>      handleLocationError (error) {
      console.log(error);
    }
    getLocationVal() {
      if (window.navigator.geolocation) {
        window.navigator.geolocation.getCurrentPosition(
          (position) =&gt; {
            console.log(position.coords.latitude);
          },
          (error) =&gt; {
            console.log(error);
          },
          { maximumAge: 500, timeout: 0 , enableHighAccuracy: true}
        );
      }
    }
    startTracking() {
      this.subscription = timer(0, 10000).pipe().subscribe(
        result =&gt; this.getLocationVal()
      );
    }
  </code></pre>