【发布时间】:2016-08-14 03:07:28
【问题描述】:
【问题讨论】:
标签: android google-maps google-maps-markers
【问题讨论】:
标签: android google-maps google-maps-markers
在这里找到答案:Android Google Map InfoWindow anchor point after marker rotation
您可以使用以下代码找到标记顶部中间的点:
var angle = 0.0;
var x = Math.sin(-angle * Math.PI / 180) * 0.5 + 0.5;
var y = -(Math.cos(-angle * Math.PI / 180) * 0.5 - 0.5);
并设置一些偏移量。就我而言-0.1f:
marker.setInfoWindowAnchor((float)x, (float)y -0.1f); // -0.1f for moving up
【讨论】: