Select to view content in your preferred language

WPF API 2.2 Issue with new Draw polygons

766
1
06-27-2011 05:09 PM
PatrickKing
Emerging Contributor
Congratulations on releasing v. 2.2! I've encountered a bug with the four new polygons on the Draw toolbar, unfortunately.

When the Draw object returns with geometry for one of the four new polygons (arrow, triangle, circle, or ellipse) the spatial reference is not set, unlike the earlier types. If you then make a graphic with the geometry and add it to a feature layer, it will add to the layer but silently fail to be saved to the remote database. There's a simple work around, assigning the current Map's spatial reference to the new graphic allows it to be saved.

Also, the images for the four new buttons don't seem to be in the SDK's Assets/images folder with the others.

Cheers,
Patrick
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
Thank you for trying out v2.2 and for reporting this bug to us.

I was able to reproduce the bug that the new DrawModes are completed without the SpatialReference.

For workaround, you can do the following:
 
void draw_DrawComplete(object sender, DrawEventArgs e)
{
 e.Geometry.SpatialReference = MyMap.SpatialReference;
 GraphicsLayer l = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
 l.Graphics.Add(new Graphic() { Geometry = e.Geometry, Symbol = this.LayoutRoot.Resources["DefaultFillSymbol"] as Symbol });
}
0 Kudos