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...
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/01190000001w000000/-------------------------------------------------------------------------------------------------------------------1) IdentifyTask constructor : IdentifyTask(String url)http://help.arcgis.com/en/arcgismobi...lang.String%292) 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 ongeometry - the geometry to identifymapExtent - the current extent of the mapextentSR - the spatial reference of the maplayers - the array of layer IDs of the layers that the IdentifyTask will execute onmapWidth - the width of the map in pixelsmapHeight - the height of the map in pixelsdpi - the dot-per-inch of the map displayed on the device
//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); } }
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.