Oomph / MacMapKit

MapKit Framework for the Mac
BSD 3-Clause "New" or "Revised" License
256 stars 43 forks source link

Retina annotations #18

Open fousa opened 12 years ago

fousa commented 12 years ago

Hi,

Is it possible to get the retina images working. I added an @2x version of the image to the project. But when I'm on my retina Mac I always get the annotations with double the size....

Any idea how I can fix this?

jeffsawatzky commented 11 years ago

I don't have a mac with a retina display, so I can't try this, but have you tried the following: 1) In your targets build settings, set "Combine High Resolution Artwork" to no 2) Load your images like so (assuming you have images named pin.png and pin@2x.png): NSString * imageUrl = [[[NSBundle mainBundle] URLForImageResource:@"pin"] absoluteString]; view.imageUrl = imageUrl;

I noticed that when I had "Combine High Resolution Images" set to YES, the two images would be combined into a multipage tiff file, with the high resolution image set as the first page. Then when the tiff was loaded in the map, it would only show the first page, which was the high resolution one, and I don't have a retina display so the pins were huge. Setting "Combine High Resolution Images" to NO keeps them as separate pngs, and URLForImageResource:@"pin" should in theory return the correct image depending on whether you have a retina display or not. But again, I don't have a retina display so I can't confirm.