本文整理匯總了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();
}