title: Invalid location: latitude must be a number
body: <p>I'm trying to perform a GeoQuery with <a href="https://www.npmjs.com/package/geofirestore" rel="nofollow noreferrer">geofirestore</a>. I'd like to grab all documents in a given collection which are within a radius of 1000.</p>
  
  <p>Here is my .js file:</p>
  
  <pre><code>const GeoFirestore = require('geofirestore').GeoFirestore;
  const GeoPoint = require('geopoint');
  const firebase = require('firebase');
  
  firebase.initializeApp({
      projectId : 'my-project-id'
  });
  
  module.exports = {
     getLocalDocuments: getLocalDocuments
  }
  
  async function getLocalDocuments() {
      let latitude = 38.9537323;
      let longitude = -77.3507578;
      let radius = 1000;
  
      // Create a Firestore reference
      const firestore = firebase.firestore();
  
      // Create a GeoFirestore reference
      const geofirestore = new GeoFirestore(firestore);
  
      // Create a GeoCollection reference
      const geocollection = geofirestore.collection('myDocs');
  
      const query = geocollection.near({
          center: new GeoPoint(latitude, longitude),
          radius
      });
  
      // Get query (as Promise)
  
      await query.get().then((value) =&gt; {
          console.log(`value.docs: ${value.docs}`); // All docs returned by GeoQuery
      });
  }
  
  </code></pre>
  
  <p>I'm getting the following stack trace when the <em>getLocalDocuments()</em> function is called: </p>
  
  <pre><code>Error: Invalid location: latitude must be a number
      at validateLocation (/srv/node_modules/geofirestore/dist/index.cjs.js:567:15)
      at validateQueryCriteria (/srv/node_modules/geofirestore/dist/index.cjs.js:600:9)
      at GeoCollectionReference.GeoQuery.near (/srv/node_modules/geofirestore/dist/index.cjs.js:1416:9)
      at getLocalDocuments (/srv/utils/locationService.js:45:33)
      at Object.getLocalDocuments (/srv/utils/locationService.js:58:11)
      at buildLocalTPRecipients (/srv/utils/notificationInstructorGenerator.js:370:43)
      at notifyTPOfLocalJobsInstructionGenerator (/srv/utils/notificationInstructorGenerator.js:255:32)
      at Object.generateNewJobInstructions (/srv/utils/notificationInstructorGenerator.js:98:29)
      at handleOnCreate (/srv/db/jobs/onCreate.f.js:20:53)
      at cloudFunction (/srv/node_modules/firebase-functions/lib/cloud-functions.js:131:23)
  </code></pre>
  
  <p>Here is the <em>validateLocation</em> method:</p>
  
  <pre><code>function validateLocation(location, flag) {
      if (flag === void 0) { flag = false; }
      var error;
      if (!location) {
          error = 'GeoPoint must exist';
      }
      else if (typeof location.latitude === 'undefined') {
          error = 'latitude must exist on GeoPoint';
      }
      else if (typeof location.longitude === 'undefined') {
          error = 'longitude must exist on GeoPoint';
      }
      else {
          var latitude = location.latitude;
          var longitude = location.longitude;
          if (typeof latitude !== 'number' || isNaN(latitude)) {
              error = 'latitude must be a number';
          }
          else if (latitude &lt; -90 || latitude &gt; 90) {
              error = 'latitude must be within the range [-90, 90]';
          }
          else if (typeof longitude !== 'number' || isNaN(longitude)) {
              error = 'longitude must be a number';
          }
          else if (longitude &lt; -180 || longitude &gt; 180) {
              error = 'longitude must be within the range [-180, 180]';
          }
      }
      if (typeof error !== 'undefined' &amp;&amp; !flag) {
          throw new Error('Invalid location: ' + error);
      }
      else {
          return !error;
      }
  }
  </code></pre>
  
  <p>Any idea why it's saying that latitude is not a number? I've checked with isNaN() and other methods and they all say that is a number. </p>