【发布时间】:2015-02-27 09:53:33
【问题描述】:
我正在尝试将轮流导航嵌入到我的 android 移动应用程序中。我发现诺基亚有一个android api。我已关注https://developer.here.com/mobile-sdks/documentation/android/topics/app-simple.html 将诺基亚此处的地图嵌入到我的 android 应用程序中。
问题是当我打开应用程序时,屏幕是空白的,并且地图会加载。我尝试调试,发现 mapFragment 的 OnEngineInitListener() 正在生成并且错误“UNKNOWN”
// Search for the map fragment to finish setup by calling init().
mapFragment = (MapFragment)getFragmentManager().findFragmentById(
R.id.mapfragment);
mapFragment.init(new OnEngineInitListener() {
@Override
public void onEngineInitializationCompleted(
OnEngineInitListener.Error error)
{
if (error == OnEngineInitListener.Error.NONE) {
// retrieve a reference of the map from the map fragment
map = mapFragment.getMap();
// Set the map center to the Vancouver region (no animation)
map.setCenter(new GeoCoordinate(49.196261, -123.004773, 0.0),
Map.Animation.NONE);
// Set the zoom level to the average between min and max
map.setZoomLevel(
(map.getMaxZoomLevel() + map.getMinZoomLevel()) / 2);
} else {
System.out.println("ERROR: Cannot initialize Map Fragment");
System.out.println(error);
}
}
});
有人使用过诺基亚 HERE Android API 吗?如果是,并且您遇到类似的问题,请分享您的解决方案。
如果有人能向我推荐一个地图 api,我将不胜感激,它提供了可以嵌入到我的 android 应用程序中的轮流导航。
提前致谢。
【问题讨论】: