Skip to content

Instantly share code, notes, and snippets.

@SirPepe
Created May 14, 2015 15:15
Show Gist options
  • Save SirPepe/0012c87226b50806d9b9 to your computer and use it in GitHub Desktop.
Save SirPepe/0012c87226b50806d9b9 to your computer and use it in GitHub Desktop.
Karten-Grab
// Benötigt PhantomJS. Benutzung: $ phantomjs grab.js
var page = require('webpage').create();
page.viewportSize = {
width: 10000, // A0: 9933
height: 15000 // A0: 14043
};
page.open('http://localhost/~peter/map/map.html', function(){
setTimeout(function(){
page.render('map.png');
phantom.exit();
}, 8e+4); // Render-Wartezeit nach Notwendigkeit justieren
});
<!doctype html>
<style>
body, html, #wrapper {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
<div id="wrapper">
<div id="map"></div>
</div>
<script src="https://maps.google.com/maps/api/js?sensor=false"></script>
<script>
window.onload = function(){
var el = document.getElementById('map');
el.style.height = window.innerHeight + 'px';
var map = new google.maps.Map(el, {
zoom: 11,
center: new google.maps.LatLng(50.75, 11.5),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment