//if we have a grouplayer we need to check the sublayers too for popups if(layer instanceof GroupLayer){ Layer[] groupLayers = ((GroupLayer) layer).getLayers(); for(Layer groupLayer:groupLayers){ if (groupLayer instanceof ArcGISFeatureLayer) { // Query feature layer and display popups ArcGISFeatureLayer featureLayer = (ArcGISFeatureLayer) groupLayer; if (featureLayer.getPopupInfo() != null && featureLayer.getPopupInfo().isInitialized()) { // Query feature layer which is associated with a popup // definition. found=true; count.incrementAndGet(); new RunQueryFeatureLayerTask(x, y, IDENTIFY_TOLERANCE, id).execute(featureLayer); } }
Here are a few examples regarding performing an Identify on the line features mentioned. Looking at the data through both ArcGIS Online and the ArcGIS Server JavaScript API, the features can be identified successfully. Also please look at the documentation regarding the identify task.
http://resources.arcgis.com/en/help/android-sdk/concepts/index.html#/Identify_task_sample/0119000000...
-------------------------------------------------------------------------------------------------------------------
1) IdentifyTask constructor : IdentifyTask(String url)
http://help.arcgis.com/en/arcgismobi...lang.String%29
2) IdentifyParameters constructor : IdentifyParameters(String url,
Geometry geometry,
Envelope mapExtent,
SpatialReference extentSR,
int[] layers,
int mapWidth,
int mapHeight,
int dpi,
boolean returnGeometry)
Constructor with required parameters.
Parameters:
url - the URL of the service to identify on
geometry - the geometry to identify
mapExtent - the current extent of the map
extentSR - the spatial reference of the map
layers - the array of layer IDs of the layers that the IdentifyTask will execute on
mapWidth - the width of the map in pixels
mapHeight - the height of the map in pixels
dpi - the dot-per-inch of the map displayed on the device
Hello.
I've met the same issue. I did not resolved it yet, but I assume that the problem is in featureLayer.getPopupInfo() method. It returns null and the following code do not work.
if (featureLayer.getPopupInfo() != null && featureLayer.getPopupInfo().isInitialized()) {
// Query feature layer which is associated with a popup definition.
...
}
I've tried featureLayer.createPopupInfo(), and then featureLayer.setPopupInfos(...), but this is not enough for editing feature (popup does not show any editable content). Continue exploring...