KevinGebhardt86

Using ArcGISFeatureLayer offline

Discussion created by KevinGebhardt86 on Dec 19, 2012
Latest reply on May 11, 2014 by kosmich
Hello,
I'm trying to use an ArcGISFeatureLayer offline.
Here is my code:

Graphic[] graphics = new Graphic[baumLayerFields.length];
ArrayList<Field> fields = new ArrayList<Field>();
FeatureSet featureSet = new FeatureSet();
for (int i = 0; i < baumLayerFields.length; i++)
{
Field f = new Field(baumLayerFields[i],baumLayerFields[i],"esriFieldTypeString");
fields.add(f);
}
featureSet.setFields(fields);

for (all features in my local storage)
{
Hashtable<String,Object> map = new Hashtable<String,Object>();
map.put("OBJECTID", String.valueOf(i));
map.put("VNK", baeume.get(i).getVNK());
map.put("NNK", baeume.get(i).getNNK());
map.put("VST", baeume.get(i).getVST());
PictureMarkerSymbol pms = new PictureMarkerSymbol(drawable);
InfoTemplate infoTemplate = new InfoTemplate();
Point p = new Point();
p.setX(baeume.get(i).getX());
p.setY(baeume.get(i).getY());
SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.RED, 50, SimpleMarkerSymbol.STYLE.CIRCLE);
Graphic g = new Graphic(p,sms,map,infoTemplate);
graphics[i] = g;
}
featureSet.setGraphics(graphics);
featureSet.setSpatialReference(new SpatialReference("\"wkid\":31468"));
fLayer = new ArcGISFeatureLayer(null,featureSet, o);

My Problem is, that i have an extent, but cant see any features. I also dont understand how the LayerDefinition for the ArcGISFeatureLayer should look like. I have tried some, but nothing seems to work.

Has anyone an idea, or is there a better approach?

Kind regards,
Kevin

Outcomes