MapWindow Developer's Guide
From MapWindow GIS
MapWindow 6.x
MapWindow 6.x is a project is a fully dot-net project in C# that was originally based on the Java Topology Suite ported into C#. The project also features DirectX powered 3D rendering. A single MapWindow.dll ensures that this library is very portable and easy to use by developers. We are still deciding how extensive interfaces should be. Classes will be entirely virtual so that other projects can inherit our classes and override or add functionality. A legend, 3D-map, thread-safe status bar, are all found in the MapWindow.dll, making it easier for developers to pick and choose which components they want to work with. It is currently in the alpha stage and it should be understood that MASSIVE restructuring is still ocuring throughout the library and a stable release is still a long way off. However, comments and suggestions are welcome and users are encouraged to download the project from the repository and check it out.
MapWindow 5.x
It was thought that Ted Dunsford would be continuing the MapWindow 5.x project originally started by Chris Michaelis, and the svn repository has reflected changes that appeared that way for some time. However Ted Dunsford's development has branched into an entirely different direction. MapWindow5.x featured web development tools and was a very thin wrapper for existing open source tools like GDAL. Ted Dunsford's project is now being re-named MapWindow 6.x and the web development tools will be stored in the MapWindow 5.x toolkit.
MapWindow 4.x Developer's Guide
This is the Developer's Guide for the MapWindow Application. This will cover the development of plugins for the MapWindow application through the MapWinInterfaces.DLL interface.
If you're looking for information on how to use the MapWindow application from an end user's point of view, please look at the MapWindow User's Guide.
FAQ (Frequently Asked Questions)
Sample Code for MapWindow Plug-ins
Getting Started
Plug-ins for the MapWindow application can be developed by implementing the MapWindow.Interfaces.IPlugin interface found in MapWinInterfaces.dll. Your project should be built as a class library, a .dll file. After building your plug-in, the .dll file and any necessary accompanying files should be placed in the MapWindow Plugins directory, most commonly C:\Program Files\Common Files\MapWindow\Plugins or C:\Program Files\MapWindow\Plugins. Note that MapWinInterfaces.dll should NOT be placed in the Plugins subdirectory along with your plugin.
NOTE: Visual Studio sets "Copy Local = true" as a default - this will result in placing a copy of MapWinInterfaces.dll in your Plugins\ directory if you are building directly into that directory. Set it to "false" (this can be done on a per-file basis).
The IPlugin interface consists of several functions which are all implemented. These functions are called by MapWindow to accomplish tasks. The first two, Initialize and Terminate, are called when MapWindow turns your plugin on or off, respectively. Other functions are called as things happen; i.e., Message() is called when a message is sent, ProjectLoading() is called when a project is loaded, and ItemClicked() is called when a menu item or toolbar item is clicked. Your plug-in may respond to whichever events are necessary.
The IPlugin interface also has several properties that must be implemented. One of these is Name; this is the name that your plug-in will display on the MapWindow plug-ins menu. Description is what will be displayed in the Plug-in Properties window, along with Author, Version and BuildDate.
In your plug-in's Initialize function, you will be passed a MapWindow.Interfaces.IMapWin object. This should be stored somewhere for later use - it is through this object instance that you will use other interfaces to work with MapWindow.
Enumerations
The following is a list of the enumerations in the MapWindow interface DLL. If you notice any item missing from this list, please feel free to add it.
ClickLocation Location of a click event within the legend.
eAlignment - Alignment of text
eLayerType - Enumeration of supported layer types.
UnitOfMeasure - Supported units of measure when requesting a Scalebar
vb6Buttons - Button constants for vb6 compatibility.
Interfaces
The following is a list of interfaces in MapWinInterfaces.dll. If you notice any item missing from this list, please feel free to add it.
AppInfo - The AppInfo interface allows access to MapWindow-related data like versions, whether to display splash screens, and the help file path.
ComboBoxItem - Object given back when a ComboBox is added to the Toolbar.
Draw - The draw interface is used to add custom drawing to the MapWindow view.
IdentifiedLayers - IdentifiedLayers is used to access the list of layers that contained any information gathered during an Identify function call.
IdentifiedShapes - This interface is used to access the list of shapes that were found during an Identify function call.
IMapWin - The IMapWin interface is the root interface for the MapWindow. All other interfaces can be accessed or used through this interface.
IPlugin - The IPlugin interface is the interface that must be implemented to create a plugin.
Layer - This interface is used to access properties and methods for a layer.
Layers - The layers interface manages all the layers in the MapWindow.
MenuItem - An object that represents a menu item within the Main Menu
Menus - Used for manipulation of the menu system for the application
PluginInfo - A collection of information about an available plugin
Plugins - Interface for manipulating plugins
PreviewMap - Interface for manipulating the PreviewMap
Project - The Project interface manages the project and configuration files in the MapWindow.
Reports - The Reports contains tools that are useful when generating a report from the data in the MapWindow.
SelectedShape - The SelectedShape interface is used to access information about a shape that is selected in the MapWindow.
SelectInfo - This interface is used to manage and access all selected shapes.
Shape - The shape interface contains the prperties and methods relating to a single shape in a shapefile.
Shapes - This interface is used to access individual shapes from a shapefile layer.
StatusBar - Used to manipulate the status bar at the bottom of Mapwindow.
StatusBarItem - The object given back when a panel is added to the status bar. This object can be used to manipulate the bar item itself, i.e. setting text.
Toolbar - Used to add/remove Toolbars, buttons, combo boxes, etc. to/from the application
ToolbarButton - Object given back when a button is added to a toolbar. This object can then be used to manipulate (change properties) for the button.
View - The View interface is used to manipulate or work with the main MapWindow display.
















