Google地图的Spiderfier注释

时间:2016-08-17 13:12:39

标签: ios objective-c cocoa-touch

我在同一坐标上有很多注释,现在我的地图视图显示单个注释。如果我点击我想要显示的注释。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;

1 个答案:

答案 0 :(得分:1)

@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;