None of the Google map API's support the ability to rotate a map overlay. For an application I am writing, I need to rotate a map overlay to an arbitrary angle.
So I thought I could render my image resource to a canvas like:
overlay = new Image();
overlay.onload = function(){
if (context != false){
context.translate(canvas.width / 2, canvas.height / 2);
context.rotate(Math.PI / 4);
context.drawImage(overlay,0,0,67,360);
}
};
overlay.src = 'myimage.png';
Using the Google maps API I can now create a ground overlay:
var thing = new google.maps.GroundOverlay(href, bounds);
where href is canvas.toDataURL('image/png');
Unfortunately the above idea is not working. At the moment it only works with an actual image url such as http://www.mydomain/theimage.png
Looking for documentation it appears possible to use the canvas to render custom markers
How to create Google Latitude like markers?
but I need this to work for ground overlays.