I'm hitting the 2048 size restriction on static map creation. I have upwards of 100,000 coordinates that I I'm plotting, and then have I have a button to take a screen shot of the map as it's viewed on the screen, Currently, I am doing this:
function plotMapPoints(locations) {
var marker, i, pos;
var image = "http://maps.google.com/maps/api/staticmap?sensor=false¢er=0,0&zoom=" + map.getZoom() + "&size=512x512";
for (i = 0; i < locations.length; i++) {
pos = new google.maps.LatLng(locations[i][0], locations[i][1]);
marker = new google.maps.Marker({
position: pos,
map: map
});
image += "&markers=" + pos.lat() + ',' + pos.lng();
}
console.log(image);
}
When I click on the link in my console, it appears to be formatted great, however, I receive this from Google:
413. That’s an error.
Your client issued a request that was too large. That’s all we know.
Does anyone else know of a way to capture the map as an image? I have tried html2canvas as well, however i was having cross origin canvas problems.
Any help would be great.