gpt4 book ai didi

javascript - 如何在 Google map 中创建定向(成 Angular )标记?

转载 作者:行者123 更新时间:2023-11-30 17:51:39 28 4
gpt4 key购买 nike

我有标记的 Angular ,我只希望标记旋转到那个 Angular 。

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
});

是否有像上面示例中那样可以使用的 Angular 属性之类的属性?

最佳答案

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

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
}
});

关于javascript - 如何在 Google map 中创建定向(成 Angular )标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18885882/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com