0
註解未在地圖上顯示。可能是什麼原因?請help.i不能在地圖上看到的任何引腳或註解,它顯示葡萄牙,西班牙等註釋未在googlemap上顯示
addressArray = dictionary[@"data"][@"centers"];
NSArray *latitude =[dictionary[@"data"][@"centers"]valueForKey:@"lat"];
NSArray *longitude=[dictionary[@"data"][@"centers"]valueForKey:@"lng"];
NSString *cname=[dictionary[@"data"][@"centers"]valueForKey:@"category_name"];
loaderView.hidden = true;
NSLog(@"%@",latitude);
NSLog(@"%@",longitude);
NSLog(@"%@",cname);
UIImage *pinImage = [UIImage imageNamed:@"map_gym"];
GMSMarker *mark=[[GMSMarker alloc]init];
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake([[latitude objectAtIndex:0] doubleValue] ,[[longitude objectAtIndex:0] doubleValue]);
NSLog(@"%@",[latitude objectAtIndex:0]);
NSLog(@"%@",[longitude objectAtIndex:0]);
mark.position =coord;
mark.title=cname;
mark.icon=pinImage;
mark.infoWindowAnchor = CGPointMake(0.5, 0.25);
mark.groundAnchor = CGPointMake(0.5, 1.0);
mark.map=_mapView;
你從哪裏把它添加到地圖? 'marker.map = yourMapView;'似乎缺少。 – Larme
我添加了它,但仍然沒有標記。@ Larme –
是否有任何代表用於顯示googlemap或marker? –