DotNet Issues

I. Some aspects of interaction with .NET.

1. Interop libraries. In order to use MapWinGIS in .NET environment 2 interop assemblies (wrappers) must be generated: AxInteriop.MapWinGIS.dll and Interop.MapWinGIS dll. Visual Studio generates these assemblies automatically in the process of adding AxMap control on the form. Tlbimp.exe and Aximp.exe command line utilities can be used to do the same tasks manually.

2. Passing colors. The OLE_COLOR data type used by MapWinGIS is mapped to UInt32 in .NET, which doesn't provide immediate means for specification of colors using System.Drawing.Color class. The following 2 approaches can be used.

 Shapefile sf = new Shapefile();
 
 //1. ColorTranslator class can be used to do the job 
 sf.DefaultDrawingOptions.FillColor = Convert.ToUInt32(ColorTranslator.ToOle(Color.Red));
 
 //2. there is ColorByName method of the Utils class
 Utils utils = new Utils();
 sf.DefaultDrawingOptions.FillColor = utils.ColorByName(tkMapColor.Red);


3. Consuming the variant data type. .NET doesn't have data type equivalent to COM VARIANT. Therefore arguments of of variant type are converted to the object data type. Variant parameters can be used in the following scenarios:

Use the documenataion to find out the data type the output values should be cast to on the .NET side.

II. MapWindow 4

MapWindow 4 is the largest application build upon MapWinGIS (http://www.mapwindow.org).

  1. From version 4.8 (May 2011) MapWinGIS can load MapWindow 4 projects using AxMap.LoadMapState call. It provides the the fastest way to setup the visualization options for the layers and pass them to custom application.

  2. The functionality present in MapWindow can be more or less easily implemented in other custom application based on MapWinGIS. MapWindow 4 repository is here.
 All Classes Files Functions Enumerations Properties