Hello!
In this article I will try to describe how we (the Maptrix developers) defeated Apple maps and replaced them with maps from
OpenStreetMap .
Problem:
It's no secret that, starting with iOS 6.0 firmware in the embedded component MkMapkit, Apple's cards are used. Finally, Apple became independent and was able to abandon Google. At the
presentation, everything looked awesome!
But as always one “but”: all these 3d wonders are available only to US users (well, and some other developed countries). In particular, according to the ideas of Apple, the inhabitants of Russia live in one big desert.
')

Possible solutions:
The first thought was to leave MKMapView.
Unfortunately, from the considered analogues, it was not possible to find a full-fledged copy of this library. A less similar structure, by the way, is in the Yandex library (http://github.com/yandexmobile/yandexmapkit-ios and
github.com/yandexmobile/yandexmapkit-ios ).
So, we came to the idea that working with a map, pins, etc. it is necessary to leave it as it is, and in place of pictures of cards from Apple to substitute any more developed ones.
As a result, we decided to use Open Street Map and
now this library with some modifications.

What did not suit:
1. When switching Satelite Map, the map did not switch.
2. If the card is not loaded, Apple first appeared on the map, after which the OSM card blocked it
So, the code itself:
1. Add the necessary files
github.com/nutiteq/ldiw-iphone/tree/master/OSM2.h ViewController file
#import "TileOverlay.h" @interface MapView : UIViewController <MKMapViewDelegate> { IBOutlet MKMapView *mapView; } @property (nonatomic, retain) TileOverlay *overlay;
3.m ViewController file
#import "TileOverlay.h" #import "TileOverlayView.h" @synthesize overlay; - (void)viewDidLoad { [super viewDidLoad]; overlay = [[TileOverlay alloc] initOverlay]; MKMapRect visibleRect = [mapView mapRectThatFits:overlay.boundingMapRect]; visibleRect.size.width /= 2; visibleRect.size.height /= 2; visibleRect.origin.x += visibleRect.size.width / 2; visibleRect.origin.y += visibleRect.size.height / 2; mapView.visibleMapRect = visibleRect; [self SetMapDisplayTypeToSatelite:NO]; } - (void)SetMapDisplayTypeToSatelite:(BOOL)IsSatelite{ mapView.mapType = (IsSatelite == NO) ? MKMapTypeSatellite : MKMapTypeStandard; [self AddRemoveOverlay:IsSatelite]; } - (void)AddRemoveOverlay:(BOOL)show{ // 1: OSM 6.0 NSString *reqSysVer = @"6.0"; NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending){ if (show == YES && [Maptrix appmodel].SegmentMapPressed == YES) { [mapView addOverlay:overlay]; // 2: , Apple if ( [mapView.subviews count] && [((UIView *)[mapView.subviews objectAtIndex:0]).subviews count] ) ((UIView *)[((UIView *)[mapView.subviews objectAtIndex:0]).subviews objectAtIndex:0]).alpha = 0.0; }else if (show == NO && [Maptrix appmodel].SegmentMapPressed == NO){ [mapView removeOverlay:overlay]; // 3: Apple if ( [mapView.subviews count] && [((UIView *)[mapView.subviews objectAtIndex:0]).subviews count] ) ((UIView *)[((UIView *)[mapView.subviews objectAtIndex:0]).subviews objectAtIndex:0]).alpha = 1.0; } } }
Total
For firmware over 6.0, OSM cards are used. And until the card is loaded, the user will not see the Apple card. When switching between map / satellite, the map changes between OSM and Apple.

I honestly was afraid that Apple would not let us down. We blocked the Apple cards, made their map transparent (alpha = 0). And yet we zapruvili. Here is the
link .
Now we plan to connect OSM on android. But more about that in the next article.