title: PositionError Network location provider at 'https://www.googleapis.com/' : Returned error code 404
body: <p>I am using Geolocation HTML5 API. I am using angular.js. I write a small factory function</p>
  
  <pre><code>myApp.factory("GeolocationService", ['$q', '$window', '$rootScope',
      function($q, $window, $rootScope) {
          return function() {
              var deferred = $q.defer();
  
              if (!$window.navigator) {
  
  
                  $rootScope.$apply(function() {
                      deferred.reject(new Error("Geolocation is not supported"));
                  });
              } else {
                  $window.navigator.geolocation.getCurrentPosition(function(position) {
  
                      $rootScope.$apply(function() {
                          deferred.resolve(position);
                      });
                  }, function(error) {
  
                      $rootScope.$apply(function() {
                          deferred.reject(error);
                      });
                  });
              }
  
              return deferred.promise;
          }
      }
  ]);
  </code></pre>
  
  <p>When I use it. It's giving me an error </p>
  
  <p>PositionError {message: "Network location provider at '<a href="https://www.googleapis.com/" rel="nofollow noreferrer">https://www.googleapis.com/</a>' : Returned error code 404.", code: 2, PERMISSION_DENIED: 1, POSITION_UNAVAILABLE: 2, TIMEOUT: 3} </p>
  
  <p>Can anyone please help how to resolve it ??</p>