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):
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. 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
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.
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.
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
You need to learn to code to build your Uber like app. It is not possible to slightly mofify the CloudDB / Location Marker Tutorial. The tutorial uses routines and examples that can be used in the NEW app you code.
Here is what I suggest:
build a test app that does not use a LocationSensor that will let you decide how you want to handle the different things you need to do in your app. If you do not initially use a LS you can make the basic parts more simply.
I expect you will want to make an example of how you will handle drivers, customer, calculate distance to customer (routine of one way shown in tutorial), etc
-You might want to make a list or csv: like this:
1,Mustafa,11111111,42.36646,-71.11139\n
2,Ahmed,2222222222,42.35137,-71.11377\n
3,Abraham,3333333333,42.36957,-71.08035\n
4,Steve ,4444444444,42.36801,-71.11459
containing Marker Number, Name, phone number, home latitude, home longitude to place in driver's Marker nearest the customer or number of open seats available in the driver's vehicle and anything else the driver should share with the customer.
Here are some simple possibilities to handle drivers:
if you have a List of drivers (name, coordinates, availability, phone contact) in your firebase it is easy to determine which is the nearest available driver. Determine the nearest to the user (customer) and post only the nearest driver available as Marker1 to show the driver location on your map. Calculate either straight line distance between the customer and driver or more complexly using the Navigate tool to determine nearest driver. Straight line distance should be good in most instances and not significantly different than road driving distance.
alternatively post the Markers for all the drivers on the Map.
just determine the nearest available driver to the customer. Provide the customer with the drivers name, distance and phone number. You don't even have to have a map to provide the info the customer needs to identify.
it is possible to use circles on the map to show the distance of all the drivers available and various other schemes. Most other options will just use up more of your realtime database time to post fancy things on the Map.
When you get one part working save it as a separate project. Keep marking individual parts work, then combine them to make the app you want. To do that you will have to experiment.
This is a long holiday here. I am visiting with my grandchild so sorry I can't be more specific as programming is not what I expect to do for the next week through New Year.
The example I use with a CloudDB. You can do something similar with your FirebaseDB or Spreadsheet. For the example I did not use a LocationSensor to make the testing easy. A fixed presentLatitude,presentLongitude ( 42.35914 , -71.09361 ) was used instead to show the customer. The location is shown with a red marker. You can later set the location to the LS coordinates (your job).
if you have a List of drivers (place holder for distance, driver number, name, phone contact, coordinates, availability, number of passengers that can be carried) in your firebase it can be easy to determine which is the nearest available driver. Determine the nearest to the user (customer) and post only the nearest driver available as Marker1 to show the driver location on your map. Calculate either straight line distance between the customer and driver( or more complexly using the Navigate tool) to determine nearest driver. Straight line distance should be good in most instances and not significantly different than road driving distance.
I've also was able to post the Markers for all the drivers using Run time Markers (with slightly different code) using a diffferent example. Posting all the driver Markers can get messy and may be slow on the OSM map server.
just determine the nearest available driver to the customer. Provide the customer with the drivers name, distance and phone number and other data like number of seats available. You don't even have to have a map to provide the info the customer needs to identify.
Label5 displays the distances in km. for all the drivers. Presently set to Visibility false.
Label6 displays all the driver info (not pretty) and the distance from the customer. Presently set to Visibility false.
Lable7 displays the distance from the driver nearest the customer in km.
thanks so much for your effort, i will try to check it but lets help me about that
i see you are getting the locations from the csv file or sheets but how can i adjust blocks to get locaions from the firebase instead of the csv file and that are my tags
you can advice me to change the tag if needed