2016-12-05 24 views
3

我想通过从Beacons获取位置来实现在Here-sdk的Indoor-Spaces的室内路由。当我想用RoutingController创建一条路线时,我正在挣扎。该控制器需要一个BaseType为BaseLocation的位置作为起点。 但是没有BaseLocation的孩子,它允许我从我的信标中得到的值自己设置建筑物内的位置和级别。当我看着LevelLocation我需要一个Level -Object没有公共构造函数。 从我的信标我收到的地理坐标形式的室内位置和建筑物内的水平整数。我如何使用来自我的信标的信息创建LevelLocation?还是有任何其他的对象我可以使用?如何在从Beacons获取位置信息时使用here api设置Indoorlocation

回答

0

我找到了解决方案。你可以从VenueController获得Level。

private LevelLocation createLevelLocationWithBeaconData(int floor, double latitude, double longitude) { 

    venueController = mapFragment.getVenueController(this.venue); 
    GeoCoordinate geoCoordinate = new GeoCoordinate(latitude,longitude); 

    Level level = venueController.getVenue().getLevels().get(floor); 
    return new LevelLocation(level, geoCoordinate ,this.venue); 
    } 
相关问题