In Kürze Mit MapKit nicht passierbar.
Ich habe ein SDK von Drittanbietern für das gleiche verwendet. Bitte lesen Sie den folgenden Link:
https://www.mapbox.com/developers/
Objective C
@import Mapbox;
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds];
mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
// set the map's center coordinates and zoom level
[mapView setCenterCoordinate:CLLocationCoordinate2DMake(40.7326808, -73.9843407)
zoomLevel:12
animated:NO];
[self.view addSubview:mapView];
}
@end
Swift
import Mapbox
class ViewController: UIViewController, MGLMapViewDelegate {
override func viewDidLoad() {
super.viewDidLoad()
let mapView = MGLMapView(frame: view.bounds)
mapView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
// set the map's center coordinate
mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 40.7326808,
longitude: -73.9843407),
zoomLevel: 12, animated: false)
view.addSubview(mapView)
}
}
Für eine ausführliche Dokumentation siehe auch: https://www.mapbox.com/help/first-steps-ios-sdk/
Bitte beachten Sie, dass es nicht kostenlos ist: https://www.mapbox.com/pricing/
Vielen Dank für Ihre Antwort. ich werde es prüfen. –
Willkommen. Lassen Sie sich Zeit. Es ist sehr einfach zu implementieren .... –
Hier ist die Demo https://github.com/mapbox/mapbox-gl-native/tree/master/platform/ios –