Currently i am working an app like Uber iOS application. I Already integrated Google Maps SDK and I showed custom image for User current location also. Currently I am getting some Driver's Current location details(Ex: 100 Driver's) from server. I saved in one NSArray
and I tried to display those Lat & Long on GoogleMaps by using following code:
for(int i=0;i<[latLongArr count];i++)
{
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake([[(NSDictionary *)[latLongArr objectAtIndex:i] valueForKey:@"Latitude"] doubleValue], [[(NSDictionary *)[latLongArr objectAtIndex:i] valueForKey:@"Longitude"] doubleValue]);
marker.appearAnimation = kGMSMarkerAnimationPop;
marker.title = @"Title";
marker.snippet = @"Sub title";
marker.map = self.gMapView;
}
But I am looking UIDesign & Functionality like this:
Can Any one help me out how can I show User Current location & Driver's list of Annotations
(How to rotate custom marker image on google map)
In directions API (apple or google map) have a list points. So , to calculate the angle between two points, you can:
and set rotation for maker
Updated ObjC Code below