private void worldLayer_Imported(object sender, Infragistics.Controls.Maps.MapLayerImportEventArgs e)
{
if (e.Action == MapLayerImportAction.End)
{
// Polyline collection to hold points for shape
MapPolylineCollection lines = new MapPolylineCollection();
List<Point> points = new List<Point>();
// Points to make the shape
points.Add(new Point(-74.535 - 2, 40.246 - 1));
points.Add(new Point(-74.535 + 2, 40.246 - 1));
points.Add(new Point(-74.535 + 4, 40.246 + 1));
points.Add(new Point(-74.535 - 4, 40.246 + 1));
// Convert Geodetic to Cartesian coordinates
lines.Add(map1.MapProjection.ProjectToMap(points));
// Create surface element and position shape using polylines
SurfaceElement surfaceElement = new SurfaceElement() { Polylines = lines, Fill = new SolidColorBrush(Colors.Brown) };
map1.Layers[0].Elements.Add(surfaceElement);
Rect worldRect = surfaceElement.WorldRect;
worldRect = lines.GetWorldRect();
surfaceElement.WorldRect = worldRect;
}
}