Select to view content in your preferred language

api 2.3 crash on adding graphic object to featurelayer

951
2
12-13-2011 06:49 AM
MarcoRosa
Emerging Contributor
Hi to all,
i have a featurelayer on map, likje this:

FeatureLayer f = _Map.Layers["MyLayer"] as FeatureLayer;

I have also a query task who give me a featureset of graphics objects: then i add these graphics objects to f like this:

foreach (Graphic graphic in args.FeatureSet.Features)
    f.Graphics.Add(graphic);
                   
after these the application crash. if i rem these last 2 lines of code all works.

The same code work fine on the same layer if i use API 2.2 beta

Has anyone notice that whith api 2.3 ?

Thanks
GP
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
What was the error message? I am not able to reproduce this.

Can you check that the FeatureSet returned from your query match geometry type and attributes of your FeatureLayer? Also, are you adding features after the layer has been initialized?
0 Kudos
MarcoRosa
Emerging Contributor
Hi Jennifer,
sorry for the late answer, i have restarted with a new environment on a fresh machine and all works good.
Thank you

GD
0 Kudos