2016-08-17 41 views
-3

我在同一坐标上有很多注释,现在我的地图视图显示单个注释。如果我点击我想以这种方式显示它的注释。 Spiderfier在此先感谢Google地图的Spiderfier注释

GMSMapView *mapView; 
mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; 
mapView.myLocationEnabled = YES; 
mapView.delegate = self; 
self.view = mapView; 

for (int i = 0; i < [final_loc count]; i++) 
{ 
    GMSMarker *marker = [[GMSMarker alloc] init]; 
    marker.position = CLLocationCoordinate2DMake([[[final_loc objectAtIndex:i]valueForKey:@"LAT"]floatValue], [[[final_loc objectAtIndex:i]valueForKey:@"LON"]floatValue]); 
    marker.title = [[final_loc objectAtIndex:i]valueForKey:@"LAT"]; 
    marker.snippet = [[final_loc objectAtIndex:i]valueForKey:@"LON"]; 
    marker.icon = [UIImage imageNamed:@"Map_pin"]; 
    marker.appearAnimation = kGMSMarkerAnimationPop; 
    marker.map = mapView; 
} 
[_activityindicator stopAnimating]; 
_overlayView.hidden = YES; 
+0

什么代码,你写的吗? –

+0

你尝试了什么? – Rupsingh

+0

如果您发现一个lib,请将链接发布,我将非常感激。 –

回答

0

@christopher

GMSMapView *mapView; 
    mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera]; 
    mapView.myLocationEnabled = YES; 
    mapView.delegate = self; 
    self.view = mapView; 

    for (int i = 0; i < [final_loc count]; i++) 
    { 
     GMSMarker *marker = [[GMSMarker alloc] init]; 
     marker.position = CLLocationCoordinate2DMake([[[final_loc objectAtIndex:i]valueForKey:@"LAT"]floatValue], [[[final_loc objectAtIndex:i]valueForKey:@"LON"]floatValue]); 
     marker.title = [[final_loc objectAtIndex:i]valueForKey:@"LAT"]; 
     marker.snippet = [[final_loc objectAtIndex:i]valueForKey:@"LON"]; 
     marker.icon = [UIImage imageNamed:@"Map_pin"]; 
     marker.appearAnimation = kGMSMarkerAnimationPop; 
     marker.map = mapView; 
    } 
    [_activityindicator stopAnimating]; 
    _overlayView.hidden = YES; 
+0

这是我的代码 现在所有注释都重叠在这里我想将它显示为发布在问题中的图像 –