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

标签 javascript jquery google-maps google-maps-markers

我有标记的 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/

相关文章:

javascript - 使用 ng-repeat 和指令来创建适应数据的表

javascript - 在 Photoshop 中使用 Javascript 获取文件夹的属性

javascript - 贪婪在 JavaScript 中表现不同?

javascript - 获取 HTML canvas 上两个不同位置的坐标

jquery - 数据表仅在排序列上显示排序箭头

javascript - 将谷歌地图标记颜色更改为我选择的颜色

javascript - 获取同时包含文本和复选框的标签中的文本

javascript - 从 Javascript (JQuery) 调用 C# 函数 (WebMethod)

css - 无法使用 rails helpers image_tag 或 image_path 在 Google map 上显示本地镜像图标

javascript - 通过自动完成添加多个谷歌地图标记