Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Can't find sprite named 'com.mapbox.sprites.USTATION' #2326

Closed
maciekish opened this issue Sep 15, 2015 · 7 comments
Closed

Can't find sprite named 'com.mapbox.sprites.USTATION' #2326

maciekish opened this issue Sep 15, 2015 · 7 comments
Labels
bug iOS Mapbox Maps SDK for iOS

Comments

@maciekish
Copy link
Contributor

Hi,
I'm returning UIImages to MapBox using the following method:

[MGLAnnotationImage annotationImageWithImage:[HITLocation imageForPOIType:location.poiType] reuseIdentifier:location.firstPOIString];

This works initially and displays subway entrances on the map. When i enable the real estate map which draws multiple polygons on the map the subway entrances disappear and the console log is spammed with the following message:

[INFO] {Worker}[Sprite]: Can't find sprite named 'com.mapbox.sprites.USTATION'

Is this a bug or am i doing it wrong? I'm currently at 8f37502.

@friedbunny
Copy link
Contributor

I'm returning UIImages to MapBox using the following method:

Are you using the reuse identifier or returning a new UIImage for each annotation? If the latter, here is the recommended flow which checks if the resource can be reused.

When i enable the real estate map which draws multiple polygons on the map

Is this a different style?

@maciekish
Copy link
Contributor Author

I was returning a new UIImage for each annotation but i just changed it to leverage the reuse mechanism MapBox is offering. I still get the error message and the annotations still disappear though.

The real estate "map" is a bunch of shape annotations, but we do change the style (sorry).

Here is what happens: http://s.swic.name/d7M6

And here is my new code:

HITLocation *location = (HITLocation *)self.response;
NSString *identifier = location.firstPOIString;
MGLAnnotationImage *annotationImage = [mapView dequeueReusableAnnotationImageWithIdentifier:identifier];

if (!annotationImage) {
    annotationImage = [MGLAnnotationImage annotationImageWithImage:[HITLocation imageForPOIType:location.poiType] reuseIdentifier:identifier];
}

return annotationImage;

imageForPOIType: uses location.firstPOIString internally so they always match up.

@kristfal
Copy link

@friedbunny: we're seeing this issue ios-v2.1.2 both when following the reuse flow and when setting a new UIImage for each annotation.

Annotations load correctly on initial launch of the app, but if the app is closed and reopened, all loaded annotations disappear. If I pan to a new area with a new annotation not loaded during the previous launch, this new annotation will show – only to disappear on the next app launch.

@friedbunny
Copy link
Contributor

I wonder if this is a regression from #2289, @incanus?

@robipresotto
Copy link

+1

@incanus incanus added bug iOS Mapbox Maps SDK for iOS labels Sep 16, 2015
@incanus
Copy link
Contributor

incanus commented Sep 17, 2015

Changing the style as you do in your video sounds like it is actually triggering #1488, a known issue.

@incanus incanus closed this as completed Sep 17, 2015
@maciekish
Copy link
Contributor Author

I forgot that we switch to satellite mode which is a different style, sorry!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

5 participants