Move all the markers on the map to their updated/new current location periodically as users moves

∥☆過路亽.° 提交于 2019-11-27 16:27:10
danny117

Save the result of addMarker and later call setPosition on it (result of addMarker).

It appears as if there is nothing wrong with your code. I am sorry I could not find anything wrong with it as it is, but here is a file that you can use as a guideline to find the problem:

http://pastebin.com/9qq484Fz

I hope you solve the problem soon! (Apologies for the messy code, it's pretty old)

Kishore Jethava

1. Whenever onLocationChanged called means user moved to some distance.

Update user's updated location on Firebase in onLocationChanged so, other user can find your updated location.

Note: use geofire to update user location and see this answer.

@Override
public void onLocationChanged(Location location) {
mCurrentLocation = location;
currentLtAU = mCurrentLocation.getLatitude();
currentLnAU = mCurrentLocation.getLongitude();
}

2. call acceptingUserReference.child(requestID) code when you successfully update user location to Firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!