Class MapObject
Represents a map object.
Inherited Members
Namespace: FastReport.Map
Assembly: FastReport.dll
Syntax
public class MapObject : ReportComponentBase, IDisposable, IFRSerializable, IParent
  Constructors
MapObject()
Initializes a new instance of the MapObject class.
Declaration
public MapObject()
  Fields
ShapefileFolder
Gets or sets the path to folder containing shapefiles.
Declaration
public static string ShapefileFolder
  Field Value
| Type | Description | 
|---|---|
| System.String | 
Remarks
This property is used by the map editor when selecting a shapefile.
Properties
ColorScale
Gets the color scale settings.
Declaration
public ColorScale ColorScale { get; }
  Property Value
| Type | Description | 
|---|---|
| ColorScale | 
Layers
Gets or sets a collection of map layers.
Declaration
[Browsable(false)]
public LayerCollection Layers { get; set; }
  Property Value
| Type | Description | 
|---|---|
| LayerCollection | 
MaxZoom
Gets or sets maximum zoom value.
Declaration
public float MaxZoom { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Single | 
MercatorProjection
Gets or sets the value indicating that mercator projection must be used to view the map.
Declaration
public bool MercatorProjection { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Boolean | 
MinZoom
Gets or sets minimum zoom value.
Declaration
public float MinZoom { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Single | 
OffsetX
Gets or sets the X offset of the map.
Declaration
public float OffsetX { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Single | 
OffsetY
Gets or sets the Y offset of the map.
Declaration
public float OffsetY { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Single | 
Padding
Gets or sets padding within the map.
Declaration
public Padding Padding { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Windows.Forms.Padding | 
Zoom
Gets or sets the map zoom.
Declaration
public float Zoom { get; set; }
  Property Value
| Type | Description | 
|---|---|
| System.Single | 
Methods
AddChild(Base)
Adds a child object to this object's childs.
Declaration
public void AddChild(Base child)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | child | Object to add.  | 
      
Assign(Base)
Copies the contents of another, similar object.
Declaration
public override void Assign(Base source)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | source | Source object to copy the contents from.  | 
      
Overrides
Remarks
Call Assign to copy the properties from another object of the same type. The standard form of a call to Assign is
destination.Assign(source);
which tells the destination object to copy the contents of the source object to itself. In this method, all child objects are ignored. If you want to copy child objects, use the AssignAll method.
See Also
CanContain(Base)
Gets a value indicating that this object can contain the specified child object.
Declaration
public bool CanContain(Base child)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | child | Child object.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | true if this object can contain the specified child object; otherwise, false.  | 
      
CreateUniqueNames()
Creates unique names for all contained objects such as layers, shapes, etc.
Declaration
public void CreateUniqueNames()
  Draw(FRPaintEventArgs)
Draws the object.
Declaration
public override void Draw(FRPaintEventArgs e)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FRPaintEventArgs | e | Paint event args.  | 
      
Overrides
Remarks
This method is widely used in the FastReport. It is called each time when the object needs to draw or print itself.
In order to draw the object correctly, you should multiply the object's bounds by the scale parameter.
cache parameter is used to optimize the drawing speed. It holds all items such as pens, fonts, brushes, string formats that was used before. If the item with requested parameters exists in the cache, it will be returned (instead of create new item and then dispose it).
Draw(FRPaintEventArgs)
Draws the object.
Declaration
public override void Draw(FRPaintEventArgs e)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FRPaintEventArgs | e | Paint event args.  | 
      
Overrides
Remarks
This method is widely used in the FastReport. It is called each time when the object needs to draw or print itself.
In order to draw the object correctly, you should multiply the object's bounds by the scale parameter.
cache parameter is used to optimize the drawing speed. It holds all items such as pens, fonts, brushes, string formats that was used before. If the item with requested parameters exists in the cache, it will be returned (instead of create new item and then dispose it).
FinalizeComponent()
Performs a finalization after the report is finished.
Declaration
public override void FinalizeComponent()
  Overrides
Remarks
This method is used by the report engine, do not call it directly.
GetChildObjects(ObjectCollection)
Gets a list of child objects.
Declaration
public void GetChildObjects(ObjectCollection list)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ObjectCollection | list | List to fill with values.  | 
      
GetChildOrder(Base)
Returns z-order of the specified child object.
Declaration
public int GetChildOrder(Base child)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | child | Child object.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Int32 | Z-order of the specified object.  | 
      
Remarks
This method must return the index of a specified child object in the internal child list.
GetData()
Gets the data from a datasource that the object is connected to.
Declaration
public override void GetData()
  Overrides
Remarks
This method is called by the report engine before processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should get the data from a datasource that the object is connected to.
GetDataAsync(CancellationToken)
Declaration
public override async Task GetDataAsync(CancellationToken cancellationToken)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | 
Overrides
InitializeComponent()
Initializes the object before running a report.
Declaration
public override void InitializeComponent()
  Overrides
Remarks
This method is used by the report engine, do not call it directly.
Load(String)
Loads a map from file.
Declaration
public void Load(string filename)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | filename | Name of file that contains a map.  | 
      
RemoveChild(Base)
Removes a specified object from this object's childs.
Declaration
public void RemoveChild(Base child)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | child | 
RestoreState()
Restores the object's state after printing it.
Declaration
public override void RestoreState()
  Overrides
Remarks
This method is called by the report engine after processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should restore the object properties that were saved by the SaveState() method.
SaveState()
Saves the object's state before printing it.
Declaration
public override void SaveState()
  Overrides
Remarks
This method is called by the report engine before processing the object.
Do not call it directly. You may override it if you are developing a new FastReport component. In this method you should save any object properties that may be changed during the object printing. The standard implementation saves the object's bounds, visibility, bookmark and hyperlink.
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FRWriter | writer | Writer object.  | 
      
Overrides
Remarks
Do not call this method directly. You should override it if you are developing a new component for FastReport.
This method is called when the object needs to save the state. It may happen when:
- saving the report to the file or stream;
 - saving the report to the designer's undo buffer;
 - assigning the object to another object using the Assign(Base) or AssignAll methods;
 - saving the object to the designer's clipboard;
 - saving the object to the preview (when run a report).
 
SetChildOrder(Base, Int32)
Sets the z-order of the specified object.
Declaration
public void SetChildOrder(Base child, int order)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Base | child | Child object.  | 
      
| System.Int32 | order | New Z-order.  | 
      
Remarks
This method must place the specified child object at the specified position in the internal child list.
UpdateLayout(Single, Single)
Updates the children layout when the size of this object is changed by dx, dy values.
Declaration
public void UpdateLayout(float dx, float dy)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Single | dx | X delta.  | 
      
| System.Single | dy | Y delta.  | 
      
Remarks
This method must update positions/sizes of child objects whose Dock or Anchor properties are set to non-default values.