我希望用户能够通过像苹果地图一样卷曲右上角或地图上的按钮来更改地图上的地图类型。有任何想法吗?
- (void)setUpMap {
//setMap
MKMapView *mapView = [[MKMapView alloc] initWithFrame:CGRectMake(10, 14, (self.bounds.size.width - (10 * 2)), (self.bounds.size.height - (10 * 2)))];
mapView.layer.borderColor = kITBarTint.CGColor;
mapView.layer.borderWidth = 1.0;
mapView.layer.cornerRadius = 15.0;
mapView.layer.shadowColor = [UIColor blackColor].CGColor;
mapView.layer.shadowOffset = CGSizeMake(5, 5);
mapView.layer.shadowRadius = 10;
mapView.mapType = MKMapTypeHybrid;
[mapView setDelegate:self];
[mapView setShowsUserLocation:NO];
[self addSubview:mapView];
NSMutableArray *locations = [NSMutableArray array];
BOOL isFirst = YES;
for (ITLocation *location in self.spider.locations) {
ITObjectMark *mark = [[ITObjectMark alloc] initWithCoordinate:[location geopoint] addressDictionary:nil];
mark.Object = self.Object;
[locations addObject:mark];
if (isFirst) {
int zoomLevel = 2;
// use the zoom level to compute the region
[mapView setCenterCoordinate:[location geopoint] zoomLevel:zoomLevel animated:YES];
isFirst = NO;
}
}
[mapView addAnnotations:locations];
}