I'm using MarkerWithLabel to create markers on a Google map, but I want to be able to rotate the marker icon so I'm experimenting with webkit etc. transform operations.
So far I have the following:
var pictureLabel = document.createElement("img");
pictureLabel.src = "helloworld.gif";
rotateImage( pictureLabel, 20 );
var myLatlng = new google.maps.LatLng(40,-10);
marker = new MarkerWithLabel({
position: myLatlng,
labelContent: pictureLabel,
icon: " "
});
marker.setMap(map);
function rotateImage( el, angle )
{
rottext = "rotate(" + angle + "deg)";
el.style.webkitTransform = '"' + rottext + '"';
el.style.MozTransform = '"' + rottext + '"';
el.style.msTransform = '"' + rottext + '"';
el.style.OTransform = '"' + rottext + '"';
el.style.transform = '"' + rottext + '"';
el.style.transformOrigin = "50% 50%";
}
This produces no icon and I can't understand why. The problem must be in the function as, when I comment it out I get the icon displayed - just not rotated of course. Can anyone suggest what is wrong?