Phonegap serve - Geolocation promise error


#1

I use the following code (which works using ionic-serve) to get location details:

Geolocation.getCurrentPosition().then((response) => {
                            console.log('location retrieved...' + JSON.stringify(response));
                            this.journey.StartLat = response.coords.latitude;
                            this.journey.StartLng = response.coords.longitude;
                        });

but in phonegap serve it gives the following error:

Can anybody help me with this?