How to rotate marker icon image in Google Maps Javascript API v3

Viewed 3996

I am trying to rotate marker icon image but rotation angle doesn't seem to have any effect on the orientation of the icon image.

I found that giving svg path instead of image for marker would make the rotation work like intended.

But is there any way to make rotation work when using image?

jsfiddle of the issue

function updateMap(bearing) {
// var bearing = 135;

console.log(bearing);
var icon = marker.getIcon();
icon.rotation = bearing;
marker.setIcon(icon);

console.log(marker);
}
function initialize() {
   initMap({ Latitude:37.4419, Longitude: -122.1419});
}
1 Answers
Related