Map Object
A map consists of two elements: View and Interface. The View element displays a map on the screen, and NMFMapView
is in charge of this. The Interface element, associated with interfaces used in a map, is handled by the NMFNaverMapView
class, which provides most of the UI features.
A map can be displayed with a view. Add an NMFMapView
or NMFNaverMapView
to the view controller, and a map is displayed on your app screen.
NMFMapView
Add an NMFMapView
to your view controller as a sub view, and a map is displayed on the screen. An NMFMapView
simply displays a map on the screen.
The following code example adds an NMFMapView
to the view controller to display a map.
override func viewDidLoad() {
super.viewDidLoad()
let mapView = NMFMapView(frame: view.frame)
view.addSubview(mapView)
}
Swift
override func viewDidLoad() {
super.viewDidLoad()
let mapView = NMFMapView(frame: view.frame)
view.addSubview(mapView)
}
Objective-C
- (void)viewDidLoad {
[super viewDidLoad];
NMFMapView *mapView = [[NMFMapView alloc] initWithFrame:self.view.frame];
[self.view addSubview:mapView];
}
If you use an Interface Builder such as XIB
and storyboard
, add a UIView
and set NMFMapView
in Custom Class
.
NMFNaverMapView
You can also add an NMFNaverMapView
to display a map on the screen. An NMFNaverMapView
has basic UIs for a map, enabling you to easily implement a map app.
You can add it in the same way as the NMFMapView
.
override func viewDidLoad() {
super.viewDidLoad()
let naverMapView = NMFNaverMapView(frame: view.frame)
view.addSubview(naverMapView)
}
Swift
override func viewDidLoad() {
super.viewDidLoad()
let naverMapView = NMFNaverMapView(frame: view.frame)
view.addSubview(naverMapView)
}
Objective-C
- (void)viewDidLoad {
[super viewDidLoad];
NMFNaverMapView *naverMapView = [[NMFNaverMapView alloc] initWithFrame:self.view.frame];
[self.view addSubview:naverMapView];
}