15

I'm having an issue in MKMapView in iOS 8.x.x. Application works fine iOS 7.x.x but not in iOS 8.x.x. On device it shows only annotations but no map behind.

I tried to forcefully Reset my Device as well but no luck.

I added these 2 Values in info.plist as well as it was a requirement for iOS 8 and onwards

<key>NSLocationAlwaysUsageDescription</key>
<string>Location is required to find out where you are</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location is required to find out where you are</string>

and added this lines of code in my Viewdidload.

// Check for iOS 8. Without this guard the code will crash with "unknown selector" on iOS 7.
    if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
    {
        [self.locationManager requestWhenInUseAuthorization];
        //[self.locationManager requestAlwaysAuthorization];
        self.myMapView.showsUserLocation = YES;
    }

By adding these 2 values in info.plist and the above lines of code, I'm able to get the User's Location and annotation in showing on map for user's location but Map is Blank.

Similar to this post: MKMapView showing blank screen in iOS 8

Blank Map View with annotation

Community
  • 1
  • 1
Ammad Khan
  • 151
  • 1
  • 6

2 Answers2

21

Had the very same thing on IOS8.3 both sim and device. Solved by running the system Maps App (it displayed empty grid as well) for a minute till it downloaded maps. After that my MKMapView started rendering as normal.

  • 2
    We have the same issue and this "patch" is also working for us. IMO, it doesn't make sense to ask user to go open Maps app and return to your app. Any way to "force" Maps refresh and/or maps download? Thanks. – esylvestre Apr 08 '16 at 13:55
  • This issue happened for me because the Maps app had never been opened on the test device. Once it was opened I needed to accept the agreements, now my own map loads perfectly each time. – Leon Nov 29 '16 at 16:24
  • It helped me. Thanks. – Ashok Feb 20 '17 at 12:06
  • Thanks. Worked for me. – Adizbek Ergashev Dec 16 '18 at 19:29
3

try add the delegate methods:
- (void)mapViewWillStartLoadingMap:(MKMapView *)mapView; - (void)mapViewDidFinishLoadingMap:(MKMapView *)mapView; - (void)mapViewDidFailLoadingMap:(MKMapView *)mapView withError:(NSError *)error; and check the solution for you error message.

also check this solution i don't got rid of the grind but at least i got rid of the didFail error.

but seems to be an issue of iOS8 because on iOS8.3 works fine the same code.

Community
  • 1
  • 1
Constantin Saulenco
  • 2,353
  • 1
  • 22
  • 44