(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 don't agree. The National Park tutorial uses a different method of determining nearest than I recommended and does not have a method to 'erase' previously set Runtime Markers. The example I posted removes previously set Runtime Markers. You are welcome to experiment with the NP example as you want. Instead of Runtime Markers you probably would do better using lots of Designtime Markers as a mentioned earlier.

The spreadsheet you posted won't work with NP or my example.

  • The sheet must only contain the most recent coordinates of the drivers . Your current spreadsheet shows every instance of an updated driver's location without replacing the previous location. You want to identify ONLY the most recent locations for the marker. You need to eliminate all the items with a red X. I don't know how you would do that. Your code should have a way restrict the content to ONLY the most recent for each driver. ONLY the green highlighted entries are valid. :frowning_face: You need to fix that. :thinking:

  • also, your spreadsheet has
    a time/date, name, number, latitude,longitude and does not have an item for DISTANCE

2.1,01088,Mustafa,11111111,31.44598,31.67974
1.3,01098,Ali etc.
etc.
while the example uses
2.1,1,Mustafa,11111111,31.44598,31.67974 (it does not have an item for time/date )
1.3,2,Ahmed etc.
etc.

It appears you have done a lot of work. You are still copying code instead of understanding the code unfortunately. Attempting to get everything to work in one step makes your attempts at coding confusing by providing a lot of code that does not work. Seldom does that strategy work.

Good luck with your project.

i listened to your advice and tried your aia file, i just replaced the file with the sheet, just lets make a view and let me know what can i do to make it read same as the file
driverSelectionExample8.aia (17.5 KB)

1 Like

I don't have a solution. Here is what I experimented with.
driverSelectionExampleMustafaData.aia (18.3 KB)
It might help you come up with a solution.

Mustafadata.csv (267 Bytes)
Column H can be used for time. I used the 0\n to get the data that your Web_import added to the original csv. All entries need it but the last entry must not have the \n . The link you provided worked to capture Hassan once, then when I returned to the docs.google document, Hassan was no longer there. I guess you are modifying the document See Mustafadata.csv where I showed how I think the csv should look. When you add an new time with a more recent time, you should not add the driver as a new item, you should REPLACE the previous position.

I load the csv file from an asset. That means you will have to store the modified version in the app's private storage ASD app specific instead. I don't show how to do that. (Asset: Files are read from the app assets. It is an error to write to app assets as they are contained in read-only storage.)

  • you are trying to enter each driver with a sequential id number. Doing that complicates the coding. Instead I suggest everyone gets a permanent id perhaps.

  • The csv Table is named as fullDriverCSV in the File1.GotText block.

  • Create the fullDriverList in Button3 and by assigning fullDriverList to list from scv table text fullDriverCSV (see the Button3 code) . This lets you use what is now a List to calculate the nearest driver

  • run the example. First press the get Spreadsheet contents button to load the csv. Then use the Find nearest driver Sort destinations button. Then you can Post All Drivers Locations. to see where all the drivers are. When you sort, Ahmed becomes the nearest to my location (because I use the LocationSensor to set the customer and I have to use my gps location with the LS to provide an example).

Hope this jumbled discussion helps you fine a way forward.

unfortunately, you made it more hard to me, All my trying is to make the location updated from the google sheet but you back it again to a file which i cant make it works with updated locations, i will try another ways anyway thanks for your response

o avoid using a csv solution you have to download the sheet as a ListOfLists. instead of as a csv as you did ( iz/tq?tqx=out:csv&range=A2:G200&tq=SELECT ] ) or store the customers as a ListOfLists using Firebase.. Can you do that? Sorry, I don't know how.

Anyway good luck.

Is it that much difficult to locate a location/distance between two moving objects using GPS?(with real time update).

Hi @SteveJG your aia project you sent me before was great in the first time and worked well but somehow when i opened it again i found its lagging and closing dont know the reason, can you figure it out please?
UberFirebaseExperiment (1).aia (21.1 KB)

You significantly modified the code I suggested. Now the code will not run.

When I provided the code that initially 'worked', I also provided these cautions:

The test example contains a lot of unfinished example code because I was experimenting. You picked and choosed unrelated code and got into trouble.

I can see these issues:

  • problem #1, your modified app uses your FirebaseToken and your Firebase project settings. . It is not using the default FirebaseDB token. I can't use your tokken.
    When I set the Use Default checkbox for the FirebaseDB , I can get the app to respond (it still is broken because you modified a lot of code snippets).

notDefaultFBtoken defaultFB

  • problem #2; You added a second LocationSensor for the drivers. You should NOT do allow the drivers from the same app. Your 'lagging' is possibly be you now use two LocationSensors to update. I used only the user's location to decide which driver is nearest at the moment.

You are using a FirebaseDb you need to communicate with. The changes to the DB are not made instantaneously. The FirebaseDB needs to be updated. You also have the Map OSM updating. I know some of the OSM servers used by Map can the can get very slow depending on how many other apps are currently accessing the map tiles. LAGGING will occur. You may need the drivers to update their locations using a separate app.


Do you have a copy of the app aia when it last worked for you? You should have made a backup aia or a checkpoint?

I am sorry, I cannot help you fix this. I am glad that the code was useful (until something happened with your modifications).
.
Go back to the last version that worked for you and try again.

Regards,
Steve