# Find coordinates of current location

**URL:** <https://forum.ionicframework.com/t/find-coordinates-of-current-location/104021>\
**Category:** ionic-v1\
**Created:** [September 2, 2017, 6:28am UTC](https://forum.ionicframework.com/t/find-coordinates-of-current-location/104021 "2017-09-02T06:28:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivani8710](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shivani8710/32/112070_2.png) [@shivani8710](https://forum.ionicframework.com/u/shivani8710)\
**Post date:** [September 2, 2017, 6:28am UTC](https://forum.ionicframework.com/t/find-coordinates-of-current-location/104021/1 "2017-09-02T06:28:27Z")

</div>

How to find Geo location coordinates of current position in ionic 1  
I found much many solutions but no one is working in my app  
’ [object PositionError] ’ error is occurring when it is running in browser

'Only secure origins are allowed (see: [https://goo.gl/Y0ZkNV](https://goo.gl/Y0ZkNV))." ’ is also an error

```
   $scope.getLocation = function () {
  var posOptions = { timeout: 10000, enableHighAccuracy: false };

    $cordovaGeolocation.getCurrentPosition(posOptions).then(function (position) {
        var lat = position.coords.latitude
        var long = position.coords.longitude
        console.log(lat + ' ' + long)
    }, function (err) {
        console.log(err)
    });

    var watchOptions = { timeout: 3000, enableHighAccuracy: false };
    var watch = $cordovaGeolocation.watchPosition(watchOptions);

    watch.then(
       null, function (err) {
           console.log(err)
       }, function (position) {
           var lat = position.coords.latitude
           var long = position.coords.longitude
           console.log(lat + '' + long)
       }
    );

    watch.clearWatch();
}

```

this is my code
