Location information from first method call is becoming undefined after calling second method that also gets location?

I need to use location services for two different methods:

//FIRST METHOD THAT IS CALLED
fillInStart(event, item) {
    this.geolocation.getCurrentPosition().then((resp) => {
        this.global.startLatitude = resp.coords.latitude
        this.global.startLongitude = resp.coords.longitude
    }).catch((error) => {
      console.log('Error getting location', error);
    });
}

//SECOND METHOD THAT IS CALLED
fillInEnd(event, item) {
    this.geolocation.getCurrentPosition().then((resp) => {
        this.global.endLatitude = resp.coords.latitude
        this.global.endLongitude = resp.coords.longitude
    }).catch((error) => {
      console.log('Error getting location', error);
    });
}

However, after the second method is called, the first method’s location data that I saved in the global variables (startLongitude and startLatitude) are becoming undefined even though they had values previous to calling the second method. Also, the method calls are linked to buttons so the first method is called when I click one button and the second method is called when I click another button. Any ideas on why this is happening or how to fix it? Thank you!

what’s global and…why is it called global? That makes me scared in general lol.

Can you show where these are called from, as well as the definitions of your variables. I’d also recommend just putting breakpoints in here and seeing what happens. No one on here is going to be able to tell you what’s up from what you’ve posted here.

Also…what are the even and item parameters being passed in that are never used?