title: Cordova geolocation error function called twice
body: <p>Im using geolocation plugin to know the location in my ionic2 project. there is no problem if allowed the location. But the error function called twice. Here is my code</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>getLocation(){
    
     Geolocation.getCurrentPosition().then((resp) =&gt; {
     console.log(resp.coords.latitude);
     console.log(resp.coords.longitude);
     this.options.distance=true;
    }).catch((error) =&gt; {
    
     
     console.log('Error getting location', error);
  
       let alert = this.alertCtrl.create({
      title: 'Enable Location?',
      message: 'Allow Your Location',
      buttons: [
        {
       text: 'Cancel',
       role: 'cancel',
       handler: () =&gt; {
         console.log('Cancel clicked');
       }
        },
        {
       text: 'Go to Settings',
       handler: () =&gt; {
        Diagnostic.isLocationAuthorized().then(autherized=&gt;{
         if(!autherized){
         Diagnostic.switchToLocationSettings();
         }
         
        }).catch((error)=&gt;{
         console.log(error);
        });
        
       }
        }
      ]
       });
       alert.present();
           });
    
   };</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thanks in advance....</p>