【发布时间】:2013-02-15 07:36:31
【问题描述】:
当我在地图中放置多个图钉时,取决于不同的纬度和经度值。我得到所有图钉都在地图上的一个地方。
我编写了这段代码来删除多个引脚。
dealerMapView.mapType = MKMapTypeStandard;
dealerMapView.zoomEnabled =YES;
[dealerMapView setDelegate:nil];
dealerMapView.scrollEnabled = YES;
dealerMapView.showsUserLocation = NO;
CLLocationCoordinate2D location;
for (int i =0; i<[delarsInfoArray count]; i++) {
NSString *lattitudeValue = [[delarsInfoArray objectAtIndex:i]objectForKey:@"LATITUDE" ];
NSString *longitudeValue = [[delarsInfoArray objectAtIndex:i]objectForKey:@"LONGITUDE" ];
CLLocationCoordinate2D pCoordinate ;
pCoordinate.latitude = [lattitudeValue floatValue];
pCoordinate.longitude = [longitudeValue floatValue];
MKCoordinateRegion region;
MKCoordinateSpan span;
span.latitudeDelta = 0.005;
span.longitudeDelta = 0.005;
region.span = span;
region.center = location;
[dealerMapView setRegion:region animated:YES];
myAnnotation1 = [[MyAnnotation alloc] init];
myAnnotation1.coordinate = location;
myAnnotation1.title = [[delarsInfoArray objectAtIndex:i]objectForKey:@"STORE"];
[dealerMapView addAnnotation:myAnnotation1];
}
【问题讨论】: