Maptitude GISDK Help

Using COM Object Results in the Client Program

 

If COM Object results are written to a file on disk or returned as the result of a COM call, the client program can open, read, and make use of these results in any way it sees fit. If COM Object results are placed on the clipboard, the client program can make use of the information in any (or all) of these formats:

The client program can also choose to use the OLE object, either in linked or embedded form. Here is a quick summary of the advantages and disadvantages of each approach:

 

Method

Advantages

Disadvantages

Bitmap

Fast and simple

Map is not resizable by the client, and is unattractive when printed

JPEG compressed file

Much more compact than bitmap

Lossy compression, meaning that the output image will not be identical to the original

PNG compressed file

More compact than JPEG

Lossless compression, meaning that the output image will be identical to the original

Metafile

Map is fully resizable and printable

Can require slightly more complex client-side programming; not available for editors

Linked OLE Object

Relatively simple client side programming; automatic updating is possible

More complex than using metafiles or bitmaps

Embedded OLE object

Map information is stored in documents produced by the client program

Requires substantially more complex client and server programming

 

Here are some guidelines for which option to choose:

Using Bitmaps in the Client Program

The code fragments shown below illustrate how a VBA application would use a map in an Image Control

 

' create the GISDK object

Set Gisdk = CreateObject("Maptitude.AutomationServer")

 

' YSave the current map to a file

Gisdk.RunMacro "SaveMapToImage", Null, file_name, "JPEG", Null

 

' Dispaly the image in a Picture Object. Set the Stretch property to True.

My_Picture_Object.Picture =  LoadPicture(file_name)

 

 

Using OLE Linked Maps in the Client Program

When you place a map into a client program using an OLE link, you are actually putting in place a reference to a map file. When the contents of the map file changes, OLE detects that the link between your client program and the map needs to be updated. This update may occur automatically at the moment the file is changed, or only on the request of your client program, depending upon the properties of the link.

 

Normally, you specify automatic updates when using linked maps in a client program. Changes to the map file are made by the COM Object in response to a COM call to SaveMap(). When the COM Object saves the updated map, the update is detected by the client program and the link is refreshed automatically. This means that no special programming is required on the part of the client program to perform the update.

 

Note that changes to the map file can also be made by some process completely external to the client program and the server application. This can be useful in some cases, but problematic in others.

 

There is virtually no reason to specify manual updates when using linked maps in a client program. The metafile option produces essentially similar results, with faster updates and less programming.

 

Using OLE Embedded Maps in the Client Program

When you embed an OLE map in a document that is created by a client program, you are storing the contents of a map file as part of your document. When the document is opened again at a later date, the map is displayed as part of the document.

 

The principle advantage of this approach is that documents created with the client program can be distributed to other users of the client program. Note that map files (and OLE embedded maps) do not contain the geographic or attribute databases necessary to use a map. In order for an embedded map to be useful, all users of the client program must have access to the server application and the databases used in the map.

 

If you elect to use OLE embedded maps in a client program, you have two options for processing edit and update operations:

 

For more information, see...

Accessing Maptitude as a COM Object

 

 

 

 

©2025 Caliper Corporation www.caliper.com