简体   繁体   中英

how to show custom map in MapBox IOS sdk

I am new in MapBox IOS sdk and i have no idea,how to load custom Map in MapBox. Here my Custom Map:

https://api.tiles.mapbox.com/v4/faridullah.loj1n5f3/page.html?access_token=pk.eyJ1IjoiZmFyaWR1bGxhaCIsImEiOiJVU3ZCNS1VIn0.Owqu7VB5OZQbGj3LBBpPOA#16/33.6471/72.9881

and my code:

#define kMapboxMapID @"faridullah.loj1n5f3"

- (void)viewDidLoad {

    [super viewDidLoad];

RMMapboxSource *onlineSource = [[RMMapboxSource alloc] initWithMapID:kMapboxMapID];

RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:onlineSource];

    mapView.zoom = 5;
    mapView.delegate = self;
    mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;

    [self.view addSubview:mapView];
    mapView.showsUserLocation=YES;

}

but the markers doesnot display on device...

Just follow this example and implement the needed or delegate methods

https://www.mapbox.com/mapbox-ios-sdk/examples/marker-custom-image/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM