I'm not sure, but I think the feature layer is causing the problem. Could you test by using an ArcGISDynamicMapServiceLayer in your xaml and then identifying using that layer?
In your original code, you used this to define the url, which is the way I did it."ArcGISDynamicMapServiceLayer dynamicServiceLayer = (ArcGISDynamicMapServiceLayer)MyMap.Layers["Limites_Administratives"];"But you don't have an ArcGISDynamicMapServiceLayer defined in your xaml, because you're using feature layers. That's probably why your identify task didn't return any results.I would suggest reverting to your original identify code, but use "FeatureLayer" instead of "ArcGISDynamicMapServiceLayer" so that you're referencing the same rest services that your map is using.I'm not a great programmer either, so hopefully that'll work for you. Let me know.
I'm using all.
LayerOption = LayerOption.all,
Yes. I didn't read the example carefully enough. I made that changed and used the ID from xaml, but now I'm getting a NullReferenceException on this part.foreach (int x in EMDataLayer.VisibleLayers)identifyParams.LayerIds.Add(x);
if (EMDataLayer.VisibleLayers != null) foreach (int x in EMDataLayer.VisibleLayers) identifyParams.LayerIds.Add(x);
I'm getting the error "Cannot convert type 'ESRI.ArcGIS.Client.LayerInfo' to 'ESRI.ArcGIS.Client.ArcGISDynamicMapServiceLayer'.This is the line with the problem.ArcGISDynamicMapServiceLayer EMDataLayer = (ArcGISDynamicMapServiceLayer)EMDataLayer.Layers[20];
ArcGISDynamicMapServiceLayer EMDataLayer = (ArcGISDynamicMapServiceLayer)myMap.Layers[20];
ArcGISDynamicMapServiceLayer EMDataLayer = (ArcGISDynamicMapServiceLayer)myMap.Layers["MyLayerId"];
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.