1

我有标记的角度,我只想让标记旋转到那个角度。

marker = new google.maps.Marker({
                position: myLatlng,
                location: LocInfo,
                map: map,
                title: titleInfo,
                icon: image,
                html: text,
                angle: 150 // i want to do something like this
            });

我可以像上面的例子一样使用像角度属性这样的属性吗?

4

1 回答 1

2

经过几次搜索,我找到了答案并且它有效。

var angleDegrees = 150;
    new google.maps.Marker({
        position: a,
        map: map,
        icon: {
            path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
            scale: 6,
            fillColor: "red",
            fillOpacity: 0.8,
            strokeWeight: 2,
            rotation: angleDegrees //this is how to rotate the pointer
        }  
    });
于 2013-09-20T03:43:36.077 回答