Questions about delivery app using Firebase

I am developing a delivery application and I need to calculate the distance between the user and the drivers to assign the closest one

I am using firebase, as follows.,

main tag: “active drivers”

subtag: “delivery_id”
and within the subtag I’m saving the lat/long values, but when I request a delivery person I get all the information together of the subtag and the value

Captura de pantalla (19)
blocks (1)


blocks (3)

1 Like

Hi, I can’t see any block about the project bucket.
When user selects a driver you have to change the bucket to show only the information about that driver o only the driver position.

1 Like

This could help you , there are a lot of beautiful guides about firebase :+1:t2:
Look at this :point_right:t2: GUIDE

1 Like

I keep trying every time I have time with logical solutions that occur to me but I can’t find what I need

:point_right:t2: GUIDE

  1. You have to set bucket on conductores activos
  2. call all the tag
  3. when got tag save tag and values in a dictionary

In this way you can easy search and get data about drivers

1 Like

Use list by walking to find easy lat/long of driver, I can’t see your data structure but I recommend this Guide :point_left:t2:

1 Like

I was already able to obtain the list of active users as I needed and their coordinates, now I have to calculate the distance between driver and user, do you recommend that I save the driver’s location separately lat/lng or save the coordinates as a single value?

Now that is my problem to calculate distances, I can’t figure out the logic.

I already managed to obtain the coordinates but they are saved as a single value
EX: location:“78.3040–225.5475”

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.