I have place a mapview as hidden in my application. The map image need to be obtained from the mapview and send as email. How can i get the map image from the hidden mapview.
Thanks,
For SDK:
UIGraphicsBeginImageContext(self.mapView.bounds.size);
[self.mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
For toolchain (using Private API)
CGRect rect = [self.mapView bounds];
// Change the snapshot rect if needed.
CGImageRef image = [self.mapView createSnapshotWithRect:rect];
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