I am trying to show a small google static map in my application. I am wondering if this can be done using UIImageView? This doesn't seem to work for me, but maybe I'm doing something wrong.
This is what I have (I removed the url to make it easier to read):
NSURL *mapurl = [[NSURL alloc] initWithString:@"http://maps.google.com/maps/api/staticmap?[...]"];
NSData *mapdata = [[NSData alloc] initWithContentsOfURL:mapurl];
UIImage *uimap = [[UIImage alloc] initWithData:mapdata];
self.map.image = uimap;
[mapurl release];
[mapdata release];
[uimap release];
I know that my UIImageView is configured correctly, because if I replace the URL with one of the images, it will load normally. I also know that the Google Maps URL is correct, because if I download it directly to the browser, it displays normally.
I am starting to think that this may be impossible. If anyone has any ideas or alternatives, please share.
Thank.