Nokia HERE sdk - How to orient map?

好久不见. 提交于 2019-12-13 07:12:58

问题


In GoogleMaps if you want to change the orientation of the map you change the bearing of the 'camera' being used as perspective of the map.

How do I re-orient a Nokia HERE sdk map? In other words, by default the map is displayed with North at the top. But as the user moves, turns, drives etc., I want to reorient the map to match their course/heading/bearing/direction so that 'forward' is at the top.

I can get the direction the mobile device is facing from the built-in compass sensor without a problem. I just can't find a method or parameter on the map object to set.


回答1:


The map can be orientated in any direction. By default, the orientation is in a true North position. The following code changes the orientation to South-up:

// Rotate 180 degrees.
map.setOrientation(180);

// Get the orientation, should be 180.
float orientation = map.getOrientation();

Source: https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps.html



来源:https://stackoverflow.com/questions/36290807/nokia-here-sdk-how-to-orient-map

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