title: calculate distance between 2 points using Javascript API in IONIC 2
body: <p>I want to get the current position of the user and calculate the distance between this position and others positions. I am using this tutorial : <a href="https://www.joshmorony.com/create-a-nearby-places-list-with-google-maps-in-ionic-2-part-2/" rel="nofollow noreferrer">Create a Nearby Places List with Google Maps in Ionic 2</a>.
  This is the code: </p>
  
  <pre><code>let usersLocation;
  Geolocation.getCurrentPosition().then((position) =&gt; {
  
     usersLocation = { lat :position.coords.latitude ,  lng : position.coords.longitude }
     locations.map((location) =&gt; {
  
      let placeLocation = {
        lat: location.latitude,
        lng: location.longitude
      };
  
      location.distance = this.getDistanceBetweenPoints(
          usersLocation,
          placeLocation,
          'miles'
      ).toFixed(2);
    });
  
  });
  </code></pre>
  
  <p>The problem is : The usersLocation variable is not set with the latitude and the longitude of the current user's postion. Can you help me!! </p>