我在iOS應用程序中使用Google Maps SDK。我被困在地圖上繪製多個針腳。這就是我如何繪製針腳。我使用完全相同的方法來顯示使用MapKit的多個引腳,它工作得很好,但沒有成功與谷歌地圖。iOS中的Google地圖不顯示多個針腳
-(void)plotMembersOnMap
{
for (NSMutableDictionary *obj in self.jsonDictionary)
{
membersDict = [obj objectForKey:@"members"];
NSLog(@"Count member %d",[membersDict count]); // shows count
for (NSDictionary *obj in membersDict)
{
CLLocationCoordinate2D center;
NSString *latitudeString = [obj objectForKey:@"lat"];
NSString *longitudeString = [obj objectForKey:@"lng"];
double latitude = [latitudeString doubleValue];
double longitude = [longitudeString doubleValue];
center.latitude =latitude;
center.longitude = longitude;
NSString *userName = [obj objectForKey:@"pseudo"];
GMSMarker *marker = [[GMSMarker alloc] init];
marker.map = mapView_;
marker.position = CLLocationCoordinate2DMake(center.latitude, center.longitude);
customGoogleCallout.callOutTitleLabel.text = @"Member";
customGoogleCallout.callOutUserName.text = userName;
marker.icon = [UIImage imageNamed:@"marker_membre.png"];
}
}
}
沒有你的答案。 – chandru