I am creating an app where in I have to show just the part of the area where on my place will be plotted, Similar like the one below.
Clicking on this will image will take my app further. But here it's just an static image generated depending upon my longitude and latitude.
Any help would be really appreciated. Thanks
Here's the working code. Incase anybody's still searching out for the answer.
NSString *staticMapUrl = [NSString stringWithFormat:@"http://maps.google.com/maps/api/staticmap?markers=color:red|%f,%f&%@&sensor=true",yourLatitude, yourLongitude,@"zoom=10&size=270x70"];
NSURL *mapUrl = [NSURL URLWithString:[staticMapUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:mapUrl]];
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With