The core MapWindow component is the ActiveX control, "MapWinGIS.ocx".
This is an programming object that can be added to a form in Visual
Basic, Delphi, or other languages that support
ActiveX, providing a built-in GIS data map. We have tried to optimize
it for use as a fully functional model interface, not just as
a map viewer. This involved speeding up image and grid display,
limiting the amount of redrawing that the user sees, and including
application programmer interfaces (APIs) for low-level access
to grid, shape, table and image data.
Here is an example in Visual Basic 6 of the simplest MapWindow
project you can build:
The code that adds this shape file to the map
is:
With a shape file layer loaded in the map,
the user can navigate the map using the left and right mouse buttons
to zoom-in and zoom-out.
Note that although I said this is the simplest MapWindow project
you can build, I lied. Actually the simplest project would be
to just put the map on a form and compile with no code. Although
the program would start with an empty white box, a user could
grab any shape file or geo-referenced bitmap and drop it in the
map, and the map will display it.
The MapWindow core component can be more interesting when you
add a few layers of data to it and provide other means for navigation.
For example, with just a few lines of code, the project above
can be extended to display this:
The code for the above applicaton is:
Granted, these are very basic demonstrations,
but the idea is to let you get a taste for what the control can
do and how it can be used.
Additional functions of the core component ActiveX control include:
Open, create, edit, and save geo-referenced image, grid, shapefile,
triangulated irregular network (TIN), and dbf (shape attribute) data directly;
View, label, color, highlight, shape file data in the map;
Perform spatial queries on the data;
Search for features with specific attributes;
Dynamically edit the spatial data and immediately see the changes in the map;
Interact with the data through the map;
Build TINs from Grids, Images from Grids, Shape files from TINs and Grids,
Grids from Shape files, etc.
Much, much, more...
Using the MapWinGIS ActiveX Component in
Delphi
To Install the MapWinGIS.ocx ActiveX component in Delphi, you need
to follow these steps:
Click on the "Component" menu in Delphi, then select "Import ActiveX
Control..."
In the list of ActiveX components, find and select "MapWinGIS Components", then
click the "Install" Button.
It is recommended that you insert it into a new package by selecting the "Into
New Package" tab.
Enter the path where you wish to create this package. I used the same path as
the default package, but changed the filename to be MapWinGIS.dpk.
Give the package a description. I used "MapWinGIS ActiveX Control".
Press "OK".
Replace the MapWinGIS_TLB file in the "Imports" folder with the one supplied in
this Delphi sample code zip file.
In the package viewer, click on the MapWinGIS_TLB, then click the Install
button. That should be all you have to do. A new icon should be available in
the "ActiveX" component palette.
UPDATE: Paul Bailey from South Africa has built a good Delphi sample project
that illustrates use of many MapWinGIS functions. You can
download it here. Thanks, Paul!