Showing GPS Coordinates

Hello i am trying to make an app that takes a picture , stores the picture in cloudinary, retrieves the picture url and stores in firebase the picture url plus the gps coordinates of the location where that picture has been taken. The problem i am having is that the sensor location , gets location when location has changed, but since i am standing in a place when i take picture, unless i move some meters and then take picture, i have no latitude and longitude to store, and it shows 0 in both.
Is there anyway to solve this issue? Thank you in advance.

You can try Google maps component to fetch coordinates instead. That will be instentionous.

I guess your device simply does not yet have GPS location at the time you are taking the photo… Sometimes - especially indoors this takes some time. In your blocks it does not look like you store the location anywhere - I guess you are just testing right now?

Yes, but for the event to be triggered, you must change the phone location, i mean it doesnt get location when screen initializes.

Yes, the problem is the event handler is when location changed, but if i am standing and want to take a picture it doesnt get location and show lat :0 long: 0

Hello @Martin_Castellan

You can look at the example of Auto Centering from Google maps here:

This will immeditley go you your current location as soon as map component is ready ang gets
Lat and lng which is usually intentionusly.


Thank you very much for your help, i finally could get it working.

You’re welcome!

Happy Thunking!

how did you get it working. could you please explain your experience with this problem.