Android 我应该如何初始化SKMapInitSettings的路径?
我正在尝试为android安装Skobbler地图SDK,但在初始化它时遇到了问题。在文档中找不到应在“SKMapInitSettings”上设置的路径值。我得到以下例外情况:Android 我应该如何初始化SKMapInitSettings的路径?,android,skmaps,Android,Skmaps,我正在尝试为android安装Skobbler地图SDK,但在初始化它时遇到了问题。在文档中找不到应在“SKMapInitSettings”上设置的路径值。我得到以下例外情况: 05-29 16:09:29.713: E/AndroidRuntime(18545): com.skobbler.ngx.SKMapsPathsNotInitializedException: SKMaps paths were not initialized. Set the following in SKMapIn
05-29 16:09:29.713: E/AndroidRuntime(18545):
com.skobbler.ngx.SKMapsPathsNotInitializedException: SKMaps paths were not
initialized. Set the following in SKMapInitSettings : mapResourcesPath,
currentMapViewStyle, mapsPath.
这些路径的适当值是什么?为什么默认情况下不设置路径?中有一个关于如何设置路径的示例:
SKMapsInitSettings initMapSettings = new SKMapsInitSettings();
// set path to map resources and initial map style
initMapSettings.setMapResourcesPaths(app.getMapResourcesDirPath(),
new SKMapViewStyle(app.getMapResourcesDirPath() + "daystyle/", "daystyle.json"));
其中app.getMapResourcesDirPath指向:
File externalDir = getExternalFilesDir(null);
// determine path where map resources should be copied on the device
if (externalDir != null) {
mapResourcesDirPath = externalDir + "/" + "SKMaps/";
} else {
mapResourcesDirPath = getFilesDir() + "/" + "SKMaps/";
}
((DemoApplication) getApplication()).setMapResourcesDirPath(mapResourcesDirPath);
在中,有一个关于如何设置路径的示例:
SKMapsInitSettings initMapSettings = new SKMapsInitSettings();
// set path to map resources and initial map style
initMapSettings.setMapResourcesPaths(app.getMapResourcesDirPath(),
new SKMapViewStyle(app.getMapResourcesDirPath() + "daystyle/", "daystyle.json"));
其中app.getMapResourcesDirPath指向:
File externalDir = getExternalFilesDir(null);
// determine path where map resources should be copied on the device
if (externalDir != null) {
mapResourcesDirPath = externalDir + "/" + "SKMaps/";
} else {
mapResourcesDirPath = getFilesDir() + "/" + "SKMaps/";
}
((DemoApplication) getApplication()).setMapResourcesDirPath(mapResourcesDirPath);
建议在文档中添加此信息:感谢反馈:建议在文档中添加此信息:感谢反馈: