Hello,
I created a map document on ArcMap, and I created polygons in it. I assigned numbers to the polygons, and i am able to see them as labels in ArcMap. However, when i download the layers on my android application, the labels of the polygons do not show. Does anyone know how to display labels from ArcMap on Android ? Thanks!
Hi Thomas Saldana,
I would look into turning on labeling via the feature layer method setLabelsEnabled(booelan enabled):
I believe that documentation link should put you on the correct path.
Thanks,
Alexander
Oh okay, thank you.
Do i add that right after I set a layer?
This is how i am setting a layer in the android application:
mFeatureServiceUrl = ".../arcgis/rest/services/SecondPrototypetest/MapServer/2";//getString(R.string.FirstFloors);set all floors in the basement level, one by one mFeatureLayer = new ArcGISFeatureLayer(mFeatureServiceUrl, ArcGISFeatureLayer.MODE.ONDEMAND);//leave mMapView.addLayer(mFeatureLayer);
I am also using the
ArcGISFeatureLayer class, but I am not sure if it makes a difference.
I get an error. It cannot resolve the method.
Hi thomassldn,
I was under the assumption that you were working with Runtime version 100, not runtime version 10.2.x. I will need to go and revisit the previous runtime version and see if I can come up with something.
Thanks,
Alexander
Hi Thomas Saldana,
Perhaps you could try using FeatureLayer | ArcGIS Android 10.2.9 API and using the setLabelsEnabled(boolean) to turn on labels for your feature. This would take a feature table as the constructor for a feature layer and you should be able to construct the feature table from a GeodatabaseFeatureServiceTable. I hope this helps!
Thanks,
Alexander
Hi Alexander,
Thank you for the information. I have tried your suggestion, like this:
mFeatureLayer = new ArcGISFeatureLayer(mFeatureServiceUrl, ArcGISFeatureLayer.MODE.ONDEMAND);//leavepublic ArcGISFeatureLayer mFeatureServiceUrl = ".../arcgis/rest/services/SecondPrototypetest/MapServer/2";
mMapView.addLayer(mFeatureLayer2);
GeodatabaseFeatureServiceTable layertable = new GeodatabaseFeatureServiceTable("http://...:6080/arcgis/rest/services/SecondPrototype/MapServer/2", 158);
FeatureLayer layer = new FeatureLayer(layertable);
layer.setEnableLabels(true);
However, it did not seem to work. I think i am doing it incorrectly.
Is this what you were thinking?
Thank you for your time.
Sorry, I meant like this:
public ArcGISFeatureLayer mFeatureLayer;
mFeatureServiceUrl = ".../arcgis/rest/services/SecondPrototypetest/MapServer/2"; mFeatureLayer = new ArcGISFeatureLayer(mFeatureServiceUrl, ArcGISFeatureLayer.MODE.ONDEMAND);//leave mMapView.addLayer(mFeatureLayer2); GeodatabaseFeatureServiceTable layertable = new GeodatabaseFeatureServiceTable("http://roomquest.research.cse.csusb.edu:6080/arcgis/rest/services/SecondPrototype/MapServer/158", 158); FeatureLayer layer = new FeatureLayer(layertable); layer.setEnableLabels(true);