Ole*_*ych 3 android google-maps google-maps-markers
在我的设计中,标记和信息窗口之间有一段距离。有办法实现这一点吗?
编辑:我的问题是如何将信息窗口向上移动一点。
在这里找到答案:Android Google Map InfoWindow锚点标记旋转后
您可以使用以下代码找到标记顶部的中间点:
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);
Run Code Online (Sandbox Code Playgroud)
并设置一些偏移量。就我而言 -0.1f:
marker.setInfoWindowAnchor((float)x, (float)y -0.1f); // -0.1f for moving up
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
958 次 |
| 最近记录: |