(Making an Uber like app) I wanna make a global marker for all drivers will be registered on my app with the name shown

i wanna make a global marker for all drivers will be registered on my app with the name shown
How can i make a global marker for all drivers, drivers are already their locations been stored with their data on firebase so how can i make the customer when he open the map to find the nearest driver as all drivers locations should be stored on the map with a global marker so the customer can choose the nearest one!

Which map ?

my app map so when the customer open it and press find the nearest driver so the nearest driver will be appeared with his name
i made the location stored in each driver data so i wanna a global marker added on the map so store the get the stored drivers location from the firebase to the map

its something like that but i wanna make a global marker for all stored drivers

You are using the Appinventor Map component then ?

Where are you having a problem assigning markers to drivers? If each driver has a location, you should be easily able to set a marker to that location with their name/id.

You might find this useful in creating runtime markers (there is another way also):

yes thanks will check but please how can i save every driver location on the map with his unique the app name or name+email to be unique

so i wanna save their locations on the name by the app name+his name so the customer can just search for the nearest one or just enter the app name to view all drivers

  • How many drivers do you anticipate? You have two choices, Design time Markers (like Marker1, Marker2, etc.) or Run time Markers (as Tim describes)

  • Will you post the driver's home location or his actual location at the moment? Home is easy (latitude,longitude posted from a permanent database). Actual location would be like the Social Distancing tutorial which uses Design time Markers. Easy to work with in a CloudDB or FirebaseDB where drivers continually post / update their current location to the Map the customer sees. My experience with CloudDB and how Run time markers are handled (not assigned to any one individual by marker name case) requires very difficult programming. Knowing the driver's current location is most important to the person wanting a ride. :slightly_smiling_face: I would assign a Design time Marker to each Driver (Mustaf, Marker1, etc). Sorry, I don't know how many Designtime markers can be used where those unassigned can be hidden). Perhaps a hundred? Perhaps more.

i dunno how many drivers, its up to be for who will register as a driver and yes i wanna make it location changed with his current time location not his home so a clock will be added so if you showed me blocks for that you will he me much as am confused with many such blocks all i want a general marker so all drivers registered users and the customer when press find the nearest one or even search by the app name for example wasalna app name so all nearest registerd drivers current locations will be appeared with the his last location time

1 Like

This sentence is the key to your data structure.

You need to define a course grid covering all your territories, each grid square under its own tag. The value for that tag should be a list of registered location announcements in the last 24 (?) hours in that grid square.

Each registered location announcement should include:

  • driver information
  • lat
  • long
  • timestamp (for cleanup of old registrations

This organization scheme may need further work, to address how to keep just the latest location of each driver under that grid square, or a driver crossing the boundary between one grid square and the next.

am trying that blocks but cant add that block i dunno why lol so how can i put it?

image

which it was been added in the link above

Use Clock1.Now.

SystemTime used to be an instant, but now it is milliseconds.

ok thanks

am trying that link aia file now but its taking much time for the progress and didnt finish yet so how can it be fixed?

nevermind it worked externally without the emulator but still taking much time before opening

If you use an emulator you cannot use the LocationSensor. The emulator does NOT have the required hardware to use the gps. So from now own, test with a real device.

As mentioned in the tutorial "The Blocks determine how frequently the location sensor will attempt to achieve a fresh satellite fix (Using values lower than 30 seconds has limited value) and link the LocationSensor to the Map component."

The LocationChanged block is used to call setLocationStore. If your cell phone is resting on your desk, it is not moving is it so why do you expect it to tell you it has triggered a movement.

Keep trying, you are making progress to learn how the CloudDB works (your FirebaseDB works in a similar way). If you set your device data on (so it does not depend on wifi to access the OpenStreetMap and database) and go outside for a walk, your device will update much more frequently. Remember to set StayAwake so you device Screen does not close or you will loose updates while it is closed.

1 Like

What is the problem with my blocks please if I wanna make all opened customers and drivers seeing each others on the app map as markers with their distance by metres?
and each one has his name in the tab from the tinydb


here are the blocks

image

image

image

Any help here please!

lets check my blocks to fix any issues in

I see you trying to use location sensor results in a permission granted event.

That's the wrong event.

Try the location changed event.

Also, your markers will grow without limits, so there is no point trying to number them in your blocks.

Learn tables.

i just copied that blocks just changed the name and the data store

so do you mean to adjust blocks like that or lets show me exactly what to do to not to miss any other issues