PDA

View Full Version : [iOS]Is it possible to load to maps on the same screen?



high5fly
29.03.2016, 16:08
Hi,

I am trying to load a view and each view to have map with drawn route. Currently I have only one visible map and for the others nothing is shown. Here is a snipped to get an idea:


- (void)setupSkMapView {

self.skMapView = [[SKMapView alloc] initWithFrame:self.bounds];
self.skMapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.skMapView.mapScaleView.hidden = YES;
self.skMapView.settings.rotationEnabled = YES;
self.skMapView.settings.showCurrentPosition = NO;
self.skMapView.settings.followUserPosition = NO;
self.skMapView.settings.showCompass = NO;
self.skMapView.settings.displayMode = SKMapDisplayMode2D;
self.skMapView.settings.headingMode = SKHeadingModeNone;
[self addSubview:self.skMapView];

}
- (void)drawRouteFromArray:(NSArray *)locations {

CLLocation *firstLocation = [locations firstObject];
CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(firstLocation.coordinat e.latitude, firstLocation.coordinate.longitude);
SKCoordinateRegion region;
region.center = coord;
region.zoomLevel = 14.222;
self.skMapView.visibleRegion = region;
self.polyline.coordinates = locations;
[self.skMapView addPolyline:self.polyline];
}
- (SKPolyline *)polyline {

if (!_polyline) {
_polyline = [SKPolyline polyline];
_polyline.identifier = 11;
_polyline.borderDotsSize = 0.1;
_polyline.borderDotsSpacingSize = 0.1;
_polyline.fillColor = [UIColor brv_buttonTextBlueWithAlpha:0.5];
_polyline.lineWidth = 16;
}
return _polyline;
}



KR,
Miro

Adela_Silvia
30.03.2016, 17:07
hi Miro,

Unfortunately, we don't support multiple independent SKMapView instances visible at the same time. The SDK supports one visible SKMapView instance at a time. Viewing multiple map instances in the same screen will result in an undefined behaviour.

high5fly
30.03.2016, 17:09
I thought so, but wanted to ask. Thank you.