@Override
  protected AdvancedStyle getStyle() {
    if (style != null) {
      return style;
    }
    Bundle extras = getIntent().getExtras();
    String tableName = extras.getString(SpatialiteLibraryConstants.PREFS_KEY_TEXT);
    try {
      spatialTable = SpatialDataSourceManager.getInstance().getVectorTableByName(tableName);
    } catch (Exception e) {
      Log.e("STYLE", "unable to retrive table" + tableName);
    }

    style = StyleManager.getInstance().getStyle(spatialTable.getName());

    return style;
  }
示例#2
0
  /**
   * Initializes the database
   *
   * @return true if the initialization was successful
   */
  private boolean initDb() {
    // init styleManager
    StyleManager.getInstance().init(this, MAP_DIR);
    // init Db
    SpatialDataSourceManager dbManager = SpatialDataSourceManager.getInstance();

    try {
      // Only if not already loaded some tables
      if (dbManager.getSpatialVectorTables(false).size() <= 0) {
        dbManager.init(MAP_DIR);
      }
    } catch (Exception e) {

      return false;
    }
    return true;
  }