示例#1
0
        internal static MapDefinition CreateDefault()
        {
            return(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>(),
#if MDF_240
                Watermarks = new BindingList <OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_4_0.WatermarkType>()
#elif MDF_230
                Watermarks = new BindingList <OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0.WatermarkType>()
#endif
            });
 void IMapDefinition.SetExtents(double minx, double miny, double maxx, double maxy)
 {
     if (this.Extents == null)
     {
         var ext = new Box2DType()
         {
             MaxX = maxx,
             MaxY = maxy,
             MinX = minx,
             MinY = miny
         };
         this.Extents = ext;
     }
     else
     {
         this.Extents.MaxX = maxx;
         this.Extents.MaxY = maxy;
         this.Extents.MinX = minx;
         this.Extents.MinY = miny;
         OnPropertyChanged(nameof(Extents));
     }
 }