当前位置: 首页>>代码示例>>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;未经允许,请勿转载。