1

我希望在地图上有一个带有句柄的标记,允许用户旋转标记。然后我想获得标记所面对的指南针方向。Google Maps API 可以做到这一点吗?有什么好的例子吗?

4

1 回答 1

1

我想出的解决方案是将预先旋转的图像发送到标记对象,而不是物理 url,而是旋转图像的 base64 编码字符串。
所以你旋转图像div可能隐藏在你base64编码它的地图之外,然后你更新标记

marker.setIcon({url:(The base64 string here of the image),origin: new google.maps.Point(0,0),anchor: new google.maps.Point(0,0)});
于 2014-12-25T21:55:54.943 回答