诺基亚HERE SDK-如何定位地图? [英] Nokia HERE sdk - How to orient map?

查看:90
本文介绍了诺基亚HERE SDK-如何定位地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在GoogleMaps中,如果您想更改地图的方向,则可以更改用作地图透视图的相机"的方位.

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.

如何重新定位诺基亚HERE SDK地图? 换句话说,默认情况下,地图的顶部显示为North. 但是随着用户的移动,转弯,驾驶等,我想重新调整地图的方向使其与他们的航向/方向/方位/方向相匹配,以使前进"位于顶部.

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.

推荐答案

地图可以沿任何方向定向.默认情况下,方向处于真正的北位置.下面的代码将方向更改为南上":

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();

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

这篇关于诺基亚HERE SDK-如何定位地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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