Java Code Examples for com.nextgis.maplib.util.Constants#FIELD_ID

The following examples show how to use com.nextgis.maplib.util.Constants#FIELD_ID . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VectorLayer.java    From android_maplib with GNU Lesser General Public License v3.0 6 votes vote down vote up
public GeoGeometry getGeometryForId(
        long rowId,
        int zoom)
{
    if (zoom > GeoConstants.DEFAULT_CACHE_MAX_ZOOM) {
        return getGeometryForId(rowId);
    }

    MapContentProviderHelper map = (MapContentProviderHelper) MapBase.getInstance();
    if (null == map) {
        throw new IllegalArgumentException(
                "The map should extends MapContentProviderHelper or inherited");
    }
    SQLiteDatabase db = map.getDatabase(true);
    String[] columns = new String[] {Constants.FIELD_GEOM_ + zoom};
    String selection = Constants.FIELD_ID + " = " + rowId;

    return getGeometryFromQuery(columns, selection, db);
}
 
Example 2
Source File: RuleFeatureRendererUI.java    From android_maplibui with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void fillFieldValues() {
    String[] column = new String[]{Constants.FIELD_ID, mSelectedField};
    String[] from = new String[]{mSelectedField};
    int[] to = new int[]{android.R.id.text1};

    MapContentProviderHelper map = (MapContentProviderHelper) MapBase.getInstance();
    SQLiteDatabase db = map.getDatabase(true);
    mData = db.query(true, mLayer.getPath().getName(), column, null, null, column[1], null, null, null);
    mValueAdapter = new SimpleCursorAdapter(getContext(), android.R.layout.simple_spinner_item, mData, from, to, 0);
    mValueAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    mStyleRule.setKey(mSelectedField);
}
 
Example 3
Source File: VectorLayer.java    From android_maplib with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GeoGeometry getGeometryForId(long rowId)
{
    MapContentProviderHelper map = (MapContentProviderHelper) MapBase.getInstance();
    if (null == map) {
        throw new IllegalArgumentException(
                "The map should extends MapContentProviderHelper or inherited");
    }
    SQLiteDatabase db = map.getDatabase(true);
    String[] columns = new String[] {Constants.FIELD_GEOM};
    String selection = Constants.FIELD_ID + " = " + rowId;
    return getGeometryFromQuery(columns, selection, db);
}
 
Example 4
Source File: VectorLayer.java    From android_maplib with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GeoGeometry getGeometryForId(
        long rowId,
        SQLiteDatabase db)
{
    String[] columns = new String[] {Constants.FIELD_GEOM};
    String selection = Constants.FIELD_ID + " = " + rowId;
    return getGeometryFromQuery(columns, selection, db);
}
 
Example 5
Source File: VectorLayer.java    From android_maplib with GNU Lesser General Public License v3.0 5 votes vote down vote up
public GeoGeometry getGeometryForId(
        long rowId,
        int zoom,
        SQLiteDatabase db)
{
    if (zoom > GeoConstants.DEFAULT_CACHE_MAX_ZOOM) {
        return getGeometryForId(rowId, db);
    }

    String[] columns = new String[] {Constants.FIELD_GEOM_ + zoom};
    String selection = Constants.FIELD_ID + " = " + rowId;

    return getGeometryFromQuery(columns, selection, db);
}