I'm using google map sdk. I want to update gps coordinates of pin after each 5 seconds. Currently I'm just updating position attribute of GMSMarker. But it gives jump effect. I want to move marker smoothly on map.
Here is my code to update position of marker
-(void)updateLocationoordinates(CLLocationCoordinate2D) coordinates
{
if (marker == nil) {
marker = [GMSMarker markerWithPosition:coordinates];
marker.icon = [UIImage imageNamed:CAR_FOUND_IMAGE];
marker.map = mapView_;
} else
marker.position = coordinates;
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…