如何旋转 google 地图标记?

How to rotate google maps marker?

我使用下面的代码创建了一个 190 度旋转的标记,但它不起作用。其他图标选项都很好,只有旋转不起作用。

createMapMarker(pos, map) {
    var iconUrl = 'assets/img/green_arrow.png'
    var iconScaledSize = new google.maps.Size(15, 15)
    var iconOrigin = new google.maps.Point(0,0)
    var iconAnchor = new google.maps.Point(7.5, 7.5)

    return new google.maps.Marker({
      position: pos,
      map: map,
      title: '',
      icon: {
        url: iconUrl,
        scaledSize: iconScaledSize,
        origin: iconOrigin,
        anchor:iconAnchor,
        rotation: 180,
      }
    });
  } 

旋转不是 Icon Interface, it is only valid for the SVG Symbol 接口的 属性。

为您的图标使用 SVG 符号或旋转图像(jpeg、png、gif)使用 CSS(相关问题:rotate a .gif image on google maps api v3?