MapWindow Developer's Guide

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

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)

Online Script Directory

Plugin_Development_with_Visual_C-sharp

MapWindow Application Development Tutorial; VB.net (ActiveX and Plug-in examples)

Sample Code for MapWindow Plug-ins

Random Notes (collected from user Forum Postings and otherwise)

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.

Retrieved from "http://mapwindow.org/wiki/index.php/MapWindow_Developer%27s_Guide"

This page has been accessed 59,758 times. This page was last modified on 6 July 2010, at 07:12.