2016-08-17 40 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

這是我的代碼 現在所有註釋都重疊在這裏我想將它顯示爲發佈在問題中的圖像 –