Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Here API offset map center

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<

like image 416
Andrey Suvorov Avatar asked Feb 14 '26 06:02

Andrey Suvorov


2 Answers

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.

like image 128
David Leong Avatar answered Feb 16 '26 19:02

David Leong


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);
like image 36
Fuad All Avatar answered Feb 16 '26 18:02

Fuad All



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!