B4J Question Gmap Market Position Change

tufanv

Expert
Licensed User
Longtime User
Hello,

I am getting the lat,lon from my database for 100 cars. At first load, I add the markers for these 100 cars, and all cars have an unique id. Later, every 1 minute I load the lat,lon of each car again from the database and I need to change the marker position of each car for their new position. My problem here is, I can't match the newly recieved data to old created markers. For example with first load I add the marker for car : abcd and with second load when i get the new lat lon , I need to change the marker of abcd with marker.position but I don't know how can I change the correct marker which is created at first load for abcd.

Whıch way is the best to achieve this ?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User
1. Create a Map
2. Add a Marker at begin and put the marker into the map using their unique id as key as the marker as Value. do this for all 100 Cars.
3. Reload the positions.
4. Iterate through all cars, get the marker from the map. Set the new position to the marker.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Thanks ! I tried list but as I cant read the title ( it is for setting only not getting) I couldnt do it. You are right map can solve this. Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…