If the map image is the only thing on the page, is it wrapped in an html page? If it is at least wrapped in a body tag, you can do the following:
NSString *bodyStyle = @"document.getElementsByTagName('body')[0].style.textAlign = 'center';";
NSString *mapStyle = @"document.getElementById('mapid').style.margin = 'auto';";
[webView stringByEvaluatingJavaScriptFromString:bodyStyle];
[webView stringByEvaluatingJavaScriptFromString:mapStyle];
Let me know exactly how your html is structured, and then I can provide additional information if necessary.
source
share