2

我正在尝试为 android 设置 Skobbler Maps SDK,但在初始化它时遇到了麻烦。我在文档中找不到应该在“SKMapInitSettings”上设置什么路径值。我得到以下异常:

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.

这些路径的适当值是多少?为什么不默认设置?

4

1 回答 1

4

Android 演示项目中,有一个关于如何设置路径的示例:

    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);
于 2014-05-30T06:35:38.887 回答