简体   繁体   中英

Android real-time Google Maps location tracking

I am working on an Android app where players battle each on their phones in real-time based on their location. On Google maps, you can see where you are, in what direction you are facing, and where you are moving, all from a little blue dot. My question is: How can I integrate something like that in my app, so when the player moves, you can see it on the Google Maps fragment?

Edit: Currently, my application drops a new pin every time your location updates. I'm looking for something that moves the pin rather then adding a new one.

I found a temporary solution! What I'm doing now is calling map.clear() , and then adding new markers to the places I need... I decided this was best because I am dynamically creating new ones, and not just working with an array, or single marker.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM