I am currently encoding a web application that imports image data from Google Maps via the Static API - http://code.google.com/apis/maps/documentation/staticmaps/ - into HTML5 Canvas.
Unfortunately, I ran into the problem of the inability to manipulate pixel data from Google Maps due to cross-domain restrictions.
However, I read this blog post by Mr. Dob, one of the people behind the video in the desert ( http://thewildernessdowntown.com ) who uses the canvas with Google Maps - http://mrdoob.com/blog / post / 705 - and it reads:
"Another problem was that you do not have access to the pixel data of images downloaded from another domain ... However, although access to the pixel is prohibited, context.drawImage () from images hosted on other domains is allowed for copy areas" .
I feel that this may be the solution to my problem, since later in the message it shows the manipulation of the image of the image, but I do not quite understand what exactly this means, since for contexting.drawImage () it is allowed to copy areas from the image placed on other domains, "and it would be very helpful if someone could clarify this for me.
Thanks,
DLiKS
Edit: Here is the code that I use to draw a Google Maps image on canvas:
var ctx = document.getElementById('canvas').getContext('2d'); var img = new Image(); img.src = 'LINK TO GOOGLE MAPS IMAGE'; img.onload = function(){ ctx.drawImage(img,0,0); }
The image is displayed OK, but when I try to use getImageData to control this inline image on the canvas, I get an error
javascript html5 canvas
DLiKS
source share