2016-04-15 9 views
0

herunterladen Arbeiten an Mapkit Rahmen arbeiten.Wie man Karte programmatisch in iOS

Ich möchte bestimmte Bereiche der Karte programmgesteuert herunterladen.

Und würde auch zeigen, dass die heruntergeladene Karte offline.Wie kann ich das tun.

Kann jemand mir helfen wird sehr geschätzt.

Vielen Dank.

Antwort

0

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/

+1

Vielen Dank für Ihre Antwort. ich werde es prüfen. –

+0

Willkommen. Lassen Sie sich Zeit. Es ist sehr einfach zu implementieren .... –

+0

Hier ist die Demo https://github.com/mapbox/mapbox-gl-native/tree/master/platform/ios –