當前位置: 首頁>>代碼示例>>Java>>正文


Java SimpleFeatureRenderer類代碼示例

本文整理匯總了Java中com.nextgis.maplib.display.SimpleFeatureRenderer的典型用法代碼示例。如果您正苦於以下問題:Java SimpleFeatureRenderer類的具體用法?Java SimpleFeatureRenderer怎麽用?Java SimpleFeatureRenderer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SimpleFeatureRenderer類屬於com.nextgis.maplib.display包,在下文中一共展示了SimpleFeatureRenderer類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createNewLayer

import com.nextgis.maplib.display.SimpleFeatureRenderer; //導入依賴的package包/類
private boolean createNewLayer() {
    MainApplication app = (MainApplication) getApplication();
    int geomType = getResources().getIntArray(R.array.geom_types)[mSpLayerType.getSelectedItemPosition()];
    List<Field> fields = mFieldAdapter.getFields();
    if (fields.size() == 0)
        fields.add(new Field(GeoConstants.FTString, "description", getString(R.string.default_field_name)));

    VectorLayer layer = app.createEmptyVectorLayer(mEtLayerName.getText().toString().trim(), null, geomType, fields);

    SimpleFeatureRenderer sfr = (SimpleFeatureRenderer) layer.getRenderer();
    if (null != sfr) {
        Style style = sfr.getStyle();
        if (null != style) {
            Random rnd = new Random(System.currentTimeMillis());
            style.setColor(Color.rgb(rnd.nextInt(255), rnd.nextInt(255), rnd.nextInt(255)));
        }
    }

    MapBase map = app.getMap();
    map.addLayer(layer);
    return map.save();
}
 
開發者ID:nextgis,項目名稱:android_gisapp,代碼行數:23,代碼來源:CreateVectorLayerActivity.java

示例2: getIcon

import com.nextgis.maplib.display.SimpleFeatureRenderer; //導入依賴的package包/類
@Override
public Drawable getIcon(Context context)
{
    int color = Color.RED;
    if (mRenderer != null && ((SimpleFeatureRenderer) mRenderer).getStyle() != null)
        color = ((SimpleFeatureRenderer) mRenderer).getStyle().getColor();

    return ControlHelper.getIconByVectorType(mContext, mGeometryType, color, R.drawable.ic_vector, false);
}
 
開發者ID:nextgis,項目名稱:android_maplibui,代碼行數:10,代碼來源:VectorLayerUI.java

示例3: getIcon

import com.nextgis.maplib.display.SimpleFeatureRenderer; //導入依賴的package包/類
@Override
public Drawable getIcon(Context context)
{
    int color = ((SimpleFeatureRenderer) mRenderer).getStyle().getColor();
    boolean syncable = 0 == (getSyncType() & Constants.SYNC_NONE);
    return ControlHelper.getIconByVectorType(mContext, mGeometryType, color, R.drawable.ic_vector, syncable);
}
 
開發者ID:nextgis,項目名稱:android_maplibui,代碼行數:8,代碼來源:NGWVectorLayerUI.java

示例4: setRenderer

import com.nextgis.maplib.display.SimpleFeatureRenderer; //導入依賴的package包/類
protected void setRenderer(JSONObject jsonObject)
        throws JSONException
{
    String renderName = "";
    if (jsonObject.has(JSON_NAME_KEY)) {
        renderName = jsonObject.getString(JSON_NAME_KEY);
    }
    switch (renderName) {
        case "RuleFeatureRenderer":
            mRenderer = new RuleFeatureRenderer(this);
            break;
        default:
        case "SimpleFeatureRenderer":
            mRenderer = new SimpleFeatureRenderer(this);
            break;
    }

    IJSONStore jsonStore = (IJSONStore) mRenderer;
    jsonStore.fromJSON(jsonObject);

    if (mRenderer instanceof RuleFeatureRenderer) {
        IStyleRule rule = getStyleRule();
        if (null != rule) {
            RuleFeatureRenderer renderer = (RuleFeatureRenderer) mRenderer;
            renderer.setStyleRule(rule);
        }
    }
}
 
開發者ID:nextgis,項目名稱:android_maplib,代碼行數:29,代碼來源:VectorLayer.java

示例5: SimpleFeatureRendererUI

import com.nextgis.maplib.display.SimpleFeatureRenderer; //導入依賴的package包/類
public SimpleFeatureRendererUI(SimpleFeatureRenderer renderer) {
    mRenderer = renderer;
    mStyle = renderer.getStyle();
}
 
開發者ID:nextgis,項目名稱:android_maplibui,代碼行數:5,代碼來源:SimpleFeatureRendererUI.java


注:本文中的com.nextgis.maplib.display.SimpleFeatureRenderer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。