本文整理汇总了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();
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例5: SimpleFeatureRendererUI
import com.nextgis.maplib.display.SimpleFeatureRenderer; //导入依赖的package包/类
public SimpleFeatureRendererUI(SimpleFeatureRenderer renderer) {
mRenderer = renderer;
mStyle = renderer.getStyle();
}