SEARCH
TOOLBOX
LANGUAGES
modified on 28 June 2010 at 18:10 ••• 2,566 views

O2 API/Google Maps/Save large map as JPG

From

Jump to: navigation, search

Here is a script that loads up a big Google Map and save it as a JPG

Note that the script is currently hardcoded to the LondonAbundace.com Google Map, but it is easy to make it generic (the file created from this script was 27Mb in size (Google map size was 4048x4048)

 
 
panel.clear();
var picture = panel.add_PictureBox();
var width = 4048;
var height = 4048; 
var zoom = 13;
var htmlCode= ("<html><body><iframe width=\"{0}\" height=\"{1}\" frameborder=\"0\" scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"  ".line() +  
 		      "src=\"http://maps.google.co.uk/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=100708142690829776065.00047f64011ffda6f29b1&amp;t=h&amp;ll=51.481129,-0.265335&amp;spn=0.003434,0.009549&amp;output=embed\" > ".line() + 
 			  "</iframe></body></html>").format(width, height,zoom);
var file = htmlCode.saveWithExtension(".html");
file.info(); 
var ie = "about:blank".ie();
ie.open(file);
//ie.InternetExplorer.FullScreen= true; 
ie.askUserToContinue();
ie.screenshot();
var targetFile = PublicDI.config.getTempFileInTempDirectory(".jpg"); 
"JPG File: {0}".info(targetFile);
ie.IE.CaptureWebPageToFile(targetFile); 
picture.load(targetFile);
ie.closeInNSeconds(10);
MediaWiki Appliance - Powered by TurnKey Linux