Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望在地图上有一个带有句柄的标记,允许用户旋转标记。然后我想获得标记所面对的指南针方向。Google Maps API 可以做到这一点吗?有什么好的例子吗?
我想出的解决方案是将预先旋转的图像发送到标记对象,而不是物理 url,而是旋转图像的 base64 编码字符串。 所以你旋转图像div可能隐藏在你base64编码它的地图之外,然后你更新标记
div
marker.setIcon({url:(The base64 string here of the image),origin: new google.maps.Point(0,0),anchor: new google.maps.Point(0,0)});