2016-05-03 8 views
0

注釈は地図上に表示されていません。理由は何ですか? plsは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; 
+0

どこにマップを追加しましたか? 'marker.map = yourMapView;'が見つからないようです。 – Larme

+0

私はそれを追加しましたが、マーカーはありません。@ Larme –

+0

googlemapまたはマーカーを表示するために使用される代理人はありますか? –

答えて

0

近くの領域を示している私は、マーカーの座標が正しく実装されていないと思います。 Google's Documentのコードサンプルを見てください。

CLLocationCoordinate2D position = CLLocationCoordinate2DMake(10, 10); 
GMSMarker *marker = [GMSMarker markerWithPosition:position]; 
marker.title = @"Hello World"; 
marker.map = mapView_; 

コードを調整してください。

など。

CLLocationCoordinate2D coord = CLLocationCoordinate2DMake([[latitude objectAtIndex:0] doubleValue] ,[[longitude objectAtIndex:0] doubleValue]); 
GMSMarker *marker = [GMSMarker markerWithPosition:coord]; 
marker.title = @"Hello World"; 
    marker.map = mapView_; 
関連する問題