문제

I want to track a person's movement on mapview in my iphone. I am using mapview which shows user's current location as well as one more pin which denotes another persons location say person A.I want to track person A physical Movement on my iphone mapview. That means if person A is moves from one location to another,the icon or the pin which denotes person A's location should move from one location to another on the mapview on my iphone. I want to track person A live movement on mapview.Is it possible?If Yes please explain how?Please help.

도움이 되었습니까?

해결책

This is not hard. I assume that you are using a server which will communicate between the two devices. In this case when the person A moves you can update his location coordinates to your server. You can get his/her location coordinates using the

- (void)locationManager:(CLLocationManager *)manager 
    didUpdateToLocation:(CLLocation *)newLocation 
           fromLocation:(CLLocation *)oldLocation  

delegate method. At the same time you can get person A's location coordinates from the server and keep updating your mapview. The pin will move. Just set the pin drop animation to NO.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top