properly set layer scale for MapBox markers
Showing
1 changed file
with
2 additions
and
2 deletions
@@ -144,12 +144,12 @@ | @@ -144,12 +144,12 @@ | ||
144 | 144 | ||
145 | NSString *cachePath = [NSString stringWithFormat:@"%@/%@", kCachesPath, [imageURL lastPathComponent]]; | 145 | NSString *cachePath = [NSString stringWithFormat:@"%@/%@", kCachesPath, [imageURL lastPathComponent]]; |
146 | 146 | ||
147 | - if ((image = [UIImage imageWithContentsOfFile:cachePath]) && image) | 147 | + if ((image = [UIImage imageWithData:[NSData dataWithContentsOfFile:cachePath] scale:(useRetina ? 2.0 : 1.0)]) && image) |
148 | return [self initWithUIImage:image]; | 148 | return [self initWithUIImage:image]; |
149 | 149 | ||
150 | [[NSFileManager defaultManager] createFileAtPath:cachePath contents:[NSData dataWithContentsOfURL:imageURL] attributes:nil]; | 150 | [[NSFileManager defaultManager] createFileAtPath:cachePath contents:[NSData dataWithContentsOfURL:imageURL] attributes:nil]; |
151 | 151 | ||
152 | - return [self initWithUIImage:[UIImage imageWithContentsOfFile:cachePath]]; | 152 | + return [self initWithUIImage:[UIImage imageWithData:[NSData dataWithContentsOfFile:cachePath] scale:(useRetina ? 2.0 : 1.0)]]; |
153 | } | 153 | } |
154 | 154 | ||
155 | - (void)dealloc | 155 | - (void)dealloc |
-
Please register or login to post a comment