I am very new to Mapkit IOS. I am creating application that should display only specific region like Germany on map and remaining area should become black as seen in the picture attached.
This is the code which I did as of now:
ViewController.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface ViewController : UIViewController{
MKMapView *mapview;
}
- (IBAction)setMap:(id)sender;
@property (strong, nonatomic) IBOutlet MKMapView *mapview;
@end
ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize mapview = _mapview;
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)setMap:(id)sender {
switch (((UISegmentedControl *)sender).selectedSegmentIndex) {
case 0:
_mapview.mapType = MKMapTypeStandard;
break;
case 1:
_mapview.mapType = MKMapTypeSatellite;
break;
case 2:
_mapview.mapType = MKMapTypeHybrid;
break;
default:
break;
}
}
@end