public static IResource Deserialize(string xml)
        {
            var mdf = MapDefinition.Deserialize(xml);

            foreach (var group in mdf.MapLayerGroup)
            {
                group.Parent = mdf;
            }
            return(mdf);
        }
        internal static MapDefinition CreateDefault()
        {
            var mdf3 = new MapDefinition()
            {
                Name             = string.Empty,
                CoordinateSystem = string.Empty,
                Extents          = new Box2DType()
                {
                    MaxX = 0.0, MaxY = 0.0, MinX = 0.0, MinY = 0.0
                },
                BackgroundColor = Color.White,
                MapLayer        = new System.ComponentModel.BindingList <MapLayerType>(),
                MapLayerGroup   = new System.ComponentModel.BindingList <MapLayerGroupType>(),
                Watermarks      = new BindingList <OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
            };

            ((IMapDefinition3)mdf3).TileSourceType = TileSourceType.None;
            return(mdf3);
        }