如何更改谷歌地图中标记和信息窗口之间的距离?

Ole*_*ych 3 android google-maps google-maps-markers

在我的设计中,标记和信息窗口之间有一段距离。有办法实现这一点吗?

图片

编辑:我的问题是如何将信息窗口向上移动一点。

Ole*_*ych 5

在这里找到答案: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)