{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2455","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2455/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2455/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2455/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/2455","id":108930831,"number":2455,"title":"Sporadic missing sprites","user":{"login":"johnnewman","id":1591735,"avatar_url":"https://avatars.githubusercontent.com/u/1591735?v=3","gravatar_id":"","url":"https://api.github.com/users/johnnewman","html_url":"https://github.com/johnnewman","followers_url":"https://api.github.com/users/johnnewman/followers","following_url":"https://api.github.com/users/johnnewman/following{/other_user}","gists_url":"https://api.github.com/users/johnnewman/gists{/gist_id}","starred_url":"https://api.github.com/users/johnnewman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnnewman/subscriptions","organizations_url":"https://api.github.com/users/johnnewman/orgs","repos_url":"https://api.github.com/users/johnnewman/repos","events_url":"https://api.github.com/users/johnnewman/events{/privacy}","received_events_url":"https://api.github.com/users/johnnewman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"207de5"},{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/P2","name":"P2","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-29T18:32:12Z","updated_at":"2015-12-01T23:38:00Z","closed_at":"2015-12-01T23:38:00Z","body":"In the iOS GL SDK 2.1.2, we sometimes see console logs about missing sprites:\r\n```\r\n[INFO] {Worker}[Sprite]: Can't find sprite named 'com.mapbox.sprites._motoring_'\r\n```\r\n\r\nTo double check that we are providing valid images to the map, we log the MGLAnnotationImage, its UIImage, and the reuse identifier in the `mapView:imageForAnnotation:` delegate.  This is what our current `imageForAnnotation` body looks like:\r\n```objective-c\r\n- (nullable MGLAnnotationImage *)mapView:(MGLMapView * __nonnull)mapView imageForAnnotation:(id<MGLAnnotation> __nonnull)annotation\r\n{\r\n    if ([annotation isKindOfClass:[RT_MapAnnotation class]])\r\n    {\r\n        RT_MapAnnotation *mapAnnotation = (RT_MapAnnotation *)annotation;\r\n        MGLAnnotationImage *annotationImage = [self.map dequeueReusableAnnotationImageWithIdentifier:mapAnnotation.reuseIdentifier];\r\n        if (annotationImage == nil)\r\n        {\r\n            annotationImage = [mapAnnotation annotationImage];\r\n            NSLog(@\"generated: %@\\timage: %@\\tidentifier: \\\"%@\\\"\", annotationImage, annotationImage.image, mapAnnotation.reuseIdentifier);\r\n        }\r\n        return annotationImage;\r\n    }\r\n    return nil;\r\n}\r\n```\r\nHere is a log pulled from an iPhone 5:\r\n```\r\n2015-09-29 14:07:04.366 [2214:958551] generated: <MGLAnnotationImage: 0x1d276d10>\timage: <UIImage: 0x1b5d54e0>, {27, 78}\tidentifier: \"_motoring_\"\r\n2015-09-29 14:07:04.369 [2214:958724] [INFO] {Worker}[Sprite]: Can't find sprite named 'com.mapbox.sprites._motoring_'\r\n```"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/161132219","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/2455#issuecomment-161132219","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/2455","id":161132219,"user":{"login":"jfirebaugh","id":98601,"avatar_url":"https://avatars.githubusercontent.com/u/98601?v=3","gravatar_id":"","url":"https://api.github.com/users/jfirebaugh","html_url":"https://github.com/jfirebaugh","followers_url":"https://api.github.com/users/jfirebaugh/followers","following_url":"https://api.github.com/users/jfirebaugh/following{/other_user}","gists_url":"https://api.github.com/users/jfirebaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/jfirebaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfirebaugh/subscriptions","organizations_url":"https://api.github.com/users/jfirebaugh/orgs","repos_url":"https://api.github.com/users/jfirebaugh/repos","events_url":"https://api.github.com/users/jfirebaugh/events{/privacy}","received_events_url":"https://api.github.com/users/jfirebaugh/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T23:38:00Z","updated_at":"2015-12-01T23:38:00Z","body":"This was likely a race condition with adding an annotation icon while the style was loading. With #3049, annotations have their own sprite atlas and the race condition has been eliminated, so I'm pretty confident it is fixed. This will be part of the 3.1.0 SDK release."}}