Here API offset map center

我是研究僧i 提交于 2019-12-06 07:49:29

问题


I'm using the Here Android SDK API. I set position indicator via:

positionManager.start(PositioningManager.LocationMethod.GPS_NETWORK);
map.getPositionIndicator().setVisible(true);
map.getPositionIndicator().setAccuracyIndicatorVisible(true);

together with NavigationManager:

navMngr.setMapUpdateMode(NavigationManager.MapUpdateMode.ROADVIEW);

My map use isometric view:

clusterMap.setTilt(60);

Thats works, but position indicator apears at the center of the screen. I need to set some offset (or padding) in order to display position indicator way below the center (some offset or padding), so driver could see more of the road ahead. Can't find anything for setting padding for position indicator and binding to view center (only for regular map markers).

Any help would be appreciated<


回答1:


Set the transform center of the map at the screen position where you want the user position to be at. That is how we accomplish it.




回答2:


to achive navigation look and view set transform center to lower than center

PointF pc = m_map.getTransformCenter();
PointF pointF = new PointF(pc.x,pc.y* 85/50);
m_map.setTransformCenter(pointF);


来源:https://stackoverflow.com/questions/43325005/here-api-offset-map-center

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!