旋转地图时,地图上的标记会更改位置 [英] The markers on the map change position when map is rotated

查看:80
本文介绍了旋转地图时,地图上的标记会更改位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在地图上添加了标记:

I added markers on my map :

ClusterLayer markersClusterLayer = new ClusterLayer();
Collection<MapMarker> markers = new ArrayList<>();
for (GeoCoordinate geoCoordinate : list.get(0).getRoute().getWaypoints()) {
    MapMarker marker = new MapMarker();
    marker.setCoordinate(geoCoordinate);
    markers.add(marker);
}
markersClusterLayer.addMarkers(markers);
map.addClusterLayer(markersClusterLayer);

当我用手指在设备上旋转地图时,标记位置会稍有变化,例如,从道路的一侧到另一侧.

When I rotate my map using my fingers on the device, the marker position changes slightly, going from one side of a road to another for example.

我该如何解决?

谢谢

显示问题的视频:youtu.be/mhObjaq72GQ

video showing the problem: youtu.be/mhObjaq72GQ

推荐答案

我发现了这个问题,它与该点的高度有关.

I found the issue, it was related to the altitude of the point.

我正在使用

PositioningManager.getInstance().getLastKnownPosition()

返回高度的位置.结果,标记在地图上方飞行".将海拔高度设置为0可以解决此问题.

which returned a position with altitude. As a result the marker was "flying" above the map. Setting altitude to 0 fixed the issue.

这篇关于旋转地图时,地图上的标记会更改位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆