MapX 50 DevGuide
MapX 50 DevGuide
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Document Conventions
The MapInfo MapX Developer Guide uses some of the typographic conventions in its syntax descriptions
similar to those found in the Visual Basic documentation. Consult the Microsoft Visual Basic
Programmer’s Guide or the Microsoft Visual Basic Language Reference for a listing of these conventions.
In the entries for methods, you will find a syntax section. For this version of MapInfo MapX, we have
standardized the convention used for displaying syntax as follows:
Part Description
[ Return Value= ] The return value of a property (if there is one) will always be on the
outer left of the syntax line in brackets with the assignment operator on
the right.
OBJECT This represents the object that the method is being used for.
Method This represents the method.
(parameter) Parameters will be in parentheses.
[optional parameter] Optional parameters will be in brackets within the parameter
parentheses.
New in MapInfo MapX
This section summarizes the improvements and enhancements made to MapX for versions 5.0.
• Layer Packing: Packing the data contained in a layer will remove deleted records and will
rebuild the index and graphics files. To implement this feature, two methods have been
added to the Layer object.They are:
• Layer.Pack method (Layer object) on page 393
• Layer.SupportsPack method (Layer object) on page 400
• Save Layer as native MapInfo table with .mdb data file: When creating a new table, MapX
offers a choice between MapInfo Native and MS Access format. Additionally, you have the
choice of which version of Access MDB MapX creates.
A new permanent table can be created by specifying a LayerInfo.Type (see TableStorageType
& AccessVersion on the parameter table of LayerInfo Object on page 412 under
miLayerInfoTypeNewTable).
• Cache Performance Improvements for Remote Database connectivity: Enhancements to
MapX’s caching ability have been made by expanding the Cache parameter of the LayerInfo
object, the addition of three new objects and three methods connecting them to the Layer
object. Specifically, the Cache dataset is used to cache records from a remote database dataset
to prevent return trips the remote database server for data that MapX recently fetched.
Previously in MapX, the cache maintained one MBR constraint for each layer. Now, a user/
programmer has the ability to dictate what is allowed to be stored in cache, how much is
stored, and when it should be removed. Please refer to the following for more specific
information:
• LayerInfo Object on page 412
• BoundsConstraint object on page 285
• FeaturesConstraint object on page 322
• AllFeaturesConstraint object on page 272
• Layer.CreateBoundsConstraint method (Layer Object) on page 382
• Layer.CreateFeaturesConstraint method (Layer Object) on page 382
• Layer.CreateAllFeaturesConstraint method (Layer Object) on page 381
• Double Stereographic Projection: For Double Stereographic projection the ellipsoidal data is
first mapped conformally on a conformal sphere. Then, a second conformal mapping of the
spherical data to the plane completes the process. This projection is used for Prince Edward
Island and New Brunswick in Canada. Please refer to, ”Chapter 13: Summary of Parameters
Used by Coordinate Systems” on page 199.
• Dynamic Selection for Radius and Rectangle Selection Tools: In the Map object, you will
find a new property called Map.DynamicSelectionSupport property (Map object) on
page 440. Previously in MapX, when you dragged your selected tool cursor and released the
mouse button, MapX highlighted all objects within the rubber band circle you drew. With
Dynamic selection mode turned on, you can select objects as you are dragging the mouse (i.e.
without having to release the mouse buttons so you can see your selection with out having
actually made it). This mode is optional and will be enabled by setting this boolean property
to true or false. It will affect only rectangle and radius selection tools.
• Labeling Enhancements: Previously in MapX, a programmer had control over labels on a per
layer basis, but not on an individual label basis. Until now, there was no ability to customize
the appearance and content of individual labels. With the addition of the Label object and
collection, the LabelChanged Event, AND two new properties in the LabelProperties object,
MapInfo has extended this functionality to MapX programmers.
MapX programmers can also allow users to edit labels manually with the MapX Select tool.
The Map.EditableLabels property controls whether the user can select and move labels with
the stock select tool. (see Map.EditableLabels property (Map object) on page 440
The new features are:
• LabelProperties.LabelPartialObjects property (LabelProperties object) on page 374:
The PartialSegment property has been deprecated (but will be supported for backward
compatibility) and replaced with the new property, LabelProperties.LabelPartialObjects.
Its behavior applies to all map objects (with the exception of points) rather than just
polylines. Therefore, if two dimensional GeoObjects are being labeled but their centroids
are outside the map, MapX will still label them. The behavior is the same when labelling
polylines.
• LabelProperties.LabelAlong property (LabelProperties object) on page 373: The
LabelAlong property replaces the old Parallel property, which we still support but have
deprecated to a hidden property. The parallel property dictated whether labels on lines
and polylines are not rotated or are drawn at the same angle as the line or polyline
segment to which they are anchored. With the LabelAlong property, you may indicate
that the label will follow the contour of what it is labeling if the object being labeled is a
polyline. LabelAlong has three states, represented by constants. (See
LabelAlongConstants on page 597). For objects other than polylines, if the property is set
to miLabelAlongMultiSegment, the property is ignored (i.e., for point and region
objects). For line objects, if the property is set to miLabelAlongMultiSegment, automatic
labels are drawn as if the property is set to miLabelAlongParallel.
• Label object and Labels collection on page 365: There is a new object accessed through
the Layer object (see the new property Layer.Labels property (Layer object) on page 391)
that represents a collection of labels.The collection is the set of labels that are currently
drawn AND those that were edited either through the user interface or programatically.
Please refer to the properties associated with the Label object.
• LabelChanged Event on page 557: MapX fires this event whenever a label is about to be
modified, hidden (labels cannot really be deleted), marked as hidden, or unhidden. The
MapX programmer has the opportunity to prevent the operation by setting the
EnableDefault value to False.
• Military Grid Reference System: MapX now includes the ability to convert to and from
MGRFS using the following methods of the Map object.
• Map.MilitraryGridReferenceFromPoint method (Map object) on page 447
• Map.MilitaryGridReferenceToPointV method (Map object) on page 448
• Map.MilitaryGridReferenceToPoint method (Map object) on page 449
• Snap to Node: When this feature is enabled, if there are any nodes present in the rectangle
around the current mouse position, the feature snaps to the closest node to the centroid of the
rectangle and draws cross hair. This mode can be turned on under all tools. Please refer to the
following new Map object properties and method:
• Map.SnapToNodeSupport property (Map object) on page 458
• Map.SnapTolerance property (Map object) on page 458
• JPEG2000 support: This Raster format has been added to this list of Raster formats MapX
supports.
Note: The MapX web site (www.mapx.com) offers developers the latest sample applications and
versions of the MapX Online Help System, plus a bulletin board to collaborate with other
MapX developers.
If you need assistance working with MapInfo MapX, our technical support specialists can help.
Technical support for MapX includes referrals to documentation, assistance with error messages and
suggestions for causes of error messages. (Telephone technical support for MapX is limited to
customers who have purchased MapX.) You can also arrange for MapX training, or obtain customized
assistance from MapInfo's Developer Services.
Introduction to MapX
1
Chapter
Welcome to the MapInfo family of products. As the field
of enterprise mapping continues to expand, MapInfo ➤ Mapping at a Glance
leads the way with new products that are designed to ➤ Making MapX Work for You
fulfill users’ desktop and enterprise mapping needs from
our flagship product, MapInfo Professional, to the most
➤ Overview of Key Features
specialized with MapMarker, our premier address- ➤ Learning About MapX
matching product.
MapInfo MapX is a mapping control that lets you easily
add powerful mapping capabilities to your applications.
With maps, you can display information in a format that's
easy for everyone to understand. Maps are more
informative than simple charts and graphs, and can be
interpreted more quickly and easily than spreadsheets.
MapX is based on the same mapping technology used in
other MapInfo products, such as MapInfo Professional. If
you have created or purchased MapInfo map data
(tables) for use with MapInfo Professional, you can use
those same files with MapX.
Chapter 1: Introduction to MapX
Mapping at a Glance
Huge quantities of information are available today, far more than ever before. Data abounds in
spreadsheets, sales records, and marketing files. Paper and disks store masses of information on
customers, stores, personnel, equipment, and resources.
Nearly all of it has a geographic component. An estimated 85 percent of all databases contain some
sort of geographic information such as street addresses, cities, states, ZIP Codes, or even telephone
numbers with area codes and exchange numbers.
MapX can help you sort through all of this information, and, using the geographic components in your
data, display your results on a map. This lets you see patterns and relationships in the mass of
information quickly and easily without having to pore over your database.
MapX Basics
In the Getting Started chapter, we created a simple MapX
map using the MapInfo MapX Control, and in the
Chapter
previous chapter we introduced you to some MapX
mapping concepts. This chapter is an overview of the ➤ Map Object
major components behind MapX map creation and
manipulation within an application. Selected topics will ➤ Property Page
be discussed in detail in subsequent chapters. ➤ Layers
➤ GeoSets
➤ Datasets
➤ Annotations
➤ Creatable Objects in MapX
Chapter 2: MapX Basics
Map Object
Looking at the MapX object hierarchy on the MapX Object Model (see the object model poster or click
the object model button on the online help window), you see that the map object itself is at the top.
Every MapX object, property, and method is derived from the Map object. Every property and method
shown underneath the map object will somehow contribute to building the overall Map object.
Primarily Datasets, Layers, and Annotations objects define each Map object.
The following table shows some of the Map object properties that are represented by numeric values.
These properties may be changed at design time, or at runtime using the following code samples:
Zoom Sets the number of miles (default unit of measure) Map1.Zoom = 500
displayed in the map.
Rotation Rotates the map a specified number of degrees. Map1.Rotation = 179
CenterX Sets the X coordinate of the center of the map. X Map1.CenterX = -79.4458
coordinates are associated with Longitude or Easting,
depending on map projection.
CenterY Sets the Y coordinate of the center of the map. Y Map1.CenterY = 44.9932
coordinates are associated with Latitude or Northing,
depending on map projection..
With the Map object, you can control how a map is displayed by manipulating several methods and
properties of the map. There are some properties represented by other objects. For instance, when you
see a MapX map, you are seeing a collection of individual layers, represented by the Layers collection.
The Layers collection is a property of the Map object.
Now let’s take a look at altering the properties of our map. The Property Page allows us to manipulate
many properties of the map object.
Property Page
The Property Page is an extremely useful place to alter the properties of the map while you are
designing and testing an application. To access the Property Page in your Visual Basic project:
Select View > Properties Windowlick on (Custom) from the Properties Window.
Additionally, the Property Page can be accessed during design time by right clicking on the Map object
within the form and selecting "Properties..."
You may also view the Property Pages during run time. To do this, add the following code to the
Map.MouseUp event.
Note: You should only use this code during designing and testing as it may give the user too
much control over the map. However, if you want your finished product to display a
dialog box for your end users, you may want to use the Layers.LayersDlg method instead
of the PropertyPage method, because the LayersDlg dialog is more user-friendly.
Layers
Let’s consider a database of points on a map represented by black stars. By itself, this map is not very
useful, but when you overlay the point map on top of a line map and a region map, you have a very
useful map. Each individual map is referred to as a layer, and MapX stores a map as a collection of
layers.
The layers may be altered at design-time through the MapX Properties dialog box, or
programmatically during run-time. The Properties dialog box allows the designer to manipulate the
layers simply by changing the settings. In ”Chapter 5: Mapping in Layers” on page 45, we will take a
look at the code that can be used to change the layers properties and methods at any time within the
program. Adding new layers, removing layers, and changing the visibility or style of a layer are
among some of the actions you can perform on a layer.
Layers Collection
The Layers collection is made up of (0 - n) Layer objects. The Layer object is made up of a collection of
features, with each feature having its own properties and styles. A collection of features is made up of
Feature objects, which correspond to a feature on the map such as a point, line, or region. You can
create stand-alone Feature objects, or you can obtain a collection of Feature objects. Features will be
discussed in ”Chapter 7: Features and Selections” on page 99.
GeoSets
A GeoSet is a collection of map layers and their settings. The GeoSet determines the collection of
MapInfo table(s) used within a Map object and their settings. A GeoSet can be specified at design time.
If this is set during run time, it will first remove all loaded layers and Datasets, then load the new
GeoSet. The default GeoSet that is loaded is US.GST. If you are familiar with MapInfo Professional, a
workspace is similar to a GeoSet in MapX.
Specifying an alternative GeoSet to load at run-time, adding a layer to the map object, or manipulating
the look of a layer can be done through the Property Page, as discussed earlier, or through the MapX
Geoset Manager program that ships with MapX and is found in the MapX Program Group.
Below is a map of the United Kingdom with specified Geosets.
When you are satisfied with your map, you may save it. This will write the GeoSet (*.GST) file to your
drive. When you open that GeoSet file, all of your map layers and settings will be returned as you
have saved them. The GeoSet Manager lets you modify layers, manage zoom levels, labels, and other
properties.
Datasets
Datasets enable you to bind data to your maps. For example, if you have an MSAccess database of
sales by county and a map of counties you could bind that data to the county map and spot trends in
sales patterns by county not easily highlighted in the tabular data. As indicated above, if MapX is
required to specify the match between your data and a map, the match is determined through a
process called automatching/autobinding. You must first register the map into the GeoDictionary to
take advantage of automatching/autobinding.
Once the data is bound to the map, you can view pertinent information geographically. The visual
representation of data enables the creation of a theme map. A theme is the color-coding of the map to
geographically represent trends in data.
Annotations
The Annotations collection is an easy way to get text and symbols onto a map. The annotations sit “on
top” of all other layers and are not linked to any data. If you are familiar with MapInfo software, the
annotations are similar in purpose to a map’s cosmetic layer.
Listed below are methods and properties for the Annotations collection object:
Notice that there is no property for position, symbol style, or text in the annotation object. The
annotation’s graphic property contains a graphic object containing this information. To modify the
annotation, modify the annotation’s graphic object.
The following code adds a symbol to a specified location:
'Add a symbol at location
Map1.Annotations.AddSymbol X1, Y1
The following examples show how to create a stand-alone style object, display a style-selection dialog
box, and use the new style to set the override style of a layer.
When using programming languages like Visual Basic, Delphi and you are required to specify the
MapX version number after the object name (e.g. "MapX.Style.5").
Note: In Visual Basic, specifying the MapX version number is only required if you do not have
MapX Object embedded in your form.
C++ Example
CMapXStyle style;
style.CreateDispatch(style.GetClsid());
// can also use style.CreateDispatch("MapX.Style.5"),
// but above is more portable between versions of MapX
style.PickRegion();
m_ctrlMapX.GetLayers().Item(1).SetStyle(style);
Delphi Example
Var
s : variant;
begin
s := CreateOleObject('MapX.Style.5');
s.PickRegion;
MapObject.Layers.Item(1).Style := s;
end
Mapping Concepts
Now that you have installed MapX and been enticed by
the wide variety of features and functionality, you are
Chapter
probably anxious to get mapping. However, first, take a
few minutes to read this chapter, especially if you are
➤ Organizing Your Data and
new to MapX. This chapter gives you a solid Maps: An Overview of Tables
understanding of the concepts for successful mapping
with MapX.
➤ What Are GeoSets?
➤ Map Features
➤ Putting Your Data on the Map
➤ The Power of MapX
Chapter 3: Mapping Concepts
Think of these layers as transparencies where each layer contains a different part of the map. The
layers are stacked one on top of the other and allow you to see all aspects of the map at the same time.
Map Features
We mentioned earlier that maps in MapX are made up of layers of map objects. These map objects are
accessed in MapX through the Feature object. There are four basic types of features:
• Regions: closed objects that cover a given area. These include polygons, ellipses, and
rectangles. For example, country boundaries, postal code boundaries, sales territories.
• Point objects: represent single locations of data. For example, customer locations, restaurants,
parking meters.
• Line objects: open objects that cover a given distance. These include lines, polylines, and arcs.
Examples are streets, rivers, power lines.
• Text objects: text that describes a map or another object, such as labels and titles.
You can have each type of object in a separate layer (most common), or you can combine objects in the
same layer. MapX lets you create, edit, customize, and display these objects to make maps that meet
your needs.
Standard Tools
With MapX, you can easily incorporate common tools into your application, without re-inventing the
wheel. MapX provides built-in support for several common mapping tools, including:
• Navigation tools (Zoom-In, Zoom-Out, Pan, Center) that let the user change the scale and
placement of the map.
• A Labeling tool that lets the user click a map feature to label it.
• A set of Selection tools that give the user various ways to select map features.
• Annotations (symbols and text).
Custom Tools
If you need a type of toolbar button that MapX does not provide, you can simply create a custom tool
by using the CreateCustomTool method.
What Is MapX?
MapX is a tool for application developers. It offers the easiest, most cost-effective way to embed
mapping functionality into new and existing applications. MapX is a DLL that can be quickly
integrated into client applications using object-oriented languages such as Visual Basic, Delphi, and
Visual C++.
System Requirements
MapX requires a 32-bit version of Windows 98 (2nd Edition), 2000 (Service Pack 2), Windows NT
4.0(Service Pack 6A, or Windows XP.
Note: If you clear options when installing MapX, some of these files will not be installed on your
system. By default, files are installed within or underneath the folder: Program
Files\MapInfo\MapX 5.0
Program Files
The MapX DLL, along with an assortment of other DLLs and support files.
Sample Maps
A collection of map files of different regions around the world. The formats included are:
• MapInfo TAB
• ImagePro
• GDT 2001
• StreetPro
• Military Grid Reference System (MGRS)
Sample Data
A Microsoft Access database containing sample demographic data, an Oracle database containing
spatial and non spatial data, and a SQL Server database.
Sample Applications
For the latest sample programs, visit the MapX web site: http://www.mapx.com
Utilities
The MapInfo Geodictionary Manager (GeoDictionaryManager50.exe), which allows you to
register tables for use with MapX, and the GeosetManager, which allows you to easily create
Geosets.
MapX Documentation
Customers who purchase MapX receive the MapX Developer’s Guide. It is a detailed work on
mapping concepts and how to use MapX effectively. (Not included with 30-day evaluation copy
of software.)
MapX’s comprehensive Online Help system is essentially an electronic version of “The MapX
Developer’s Guide” with the addition of numerous code samples in the “MapX Objects” book.
Note: Although MapInfo has made every effort to test the sample code that appears in the online
help for accuracy and usability, it is conceivable that for one reason or another, some of the
code samples may not work as designed in your MapX applications. Minor adjustment or
“tweaking” may need to be made to the existing code in order for it to work properly.
Note: We strongly recommend that you remove all previous versions of MapXand exit from all
Windows programs before beginning the installation.
Installing MapX
The MapX installation procedure is described below.
If your Windows configuration does not have a MapX program group, the installation process will
create such a group. If your Windows configuration already has a MapX program group, the
installation process will create a new MapX icon within that group.
To install MapX:
1. Place the MapX CD in the CD drive (such as D:). The CD should run automatically, but if it
fails, click on the Windows Start button and select Run, then type or select [ CD Drive Letter
]\Setup.exe (e.g., D:\Setup.exe) in the Open drop-down list and click OK.
2. A welcome screen appears with several options. Click the 'Install MapX' button.
3. The Welcome screen displays. Choose Next to continue the installation process.
4. The Software License screen displays. Choose YES to accept the terms of the agreement and
to continue the installation process.
5. The Choose Destination Location screen displays. Specify the directory where MapX will be
installed. If you do not have MapX currently installed, the default location is: Program
Files\MapInfo\MapX 5.0
If you already have MapX installed, the default is the current installation directory.
Note: We strongly recommend that you remove all previous versions of MapX and exit from all
Windows programs before beginning the installation.
To designate a different location, choose the Browse button, and specify the destination. Click
Next to continue the installation process.
6. Specify the product components you want to install. Disk space requirements for selected
components display. When you select a component, a description of that component
displays. If the Change button is enabled, the component has sub-components. Click the
Change button to display a list of those components and their space requirements. Check the
sub-components you wish to install. For example, if you select the Exporting/Importing
Formats component, five sub-components display (GIF, JPG, TIF, PSD, and PNG) with the
disk space required for each. You can choose to install any or all of these sub-components.
7. The Select Program Folder screen displays; designate the program folder.
8. The Start Copying Files screen displays. Check the information presented. If it is correct,
choose Next to install MapX. A progress bar indicates the status of the installation. If you
want to change information, choose Back to return to previous screens.
9. When the MapX Installer has finished, the MapX Data Set up Dialog will launch. Repete all
steps detailed above to complete this installation.
Note: Do not choose the Insert > Component command. Doing so would create a .cpp file, but it
would be incomplete.
Note: Do not choose Project > Components And Controls command. Doing so would create a
.cpp file, but it would be incomplete.
1. Select the Map control from the Visual Basic toolbox. (If the Map control does not
appear on the toolbox, see Adding the Map Control on page 31 in this chapter.
2. Draw a box on your form, representing the area where you want the map to appear. MapX
displays a preview of your map.
3. Right-click on the Map control, and choose Properties from the shortcut menu. The MapInfo
MapX Properties dialog box appears.
4. Locate the Current Tool option, which is near the bottom of the General tab. Set the Current
Tool to "1003 - Zoom In" and click OK.
5. Run your program to view the map. Notice that whenever the cursor is over the map, it
changes to a magnifying glass with a plus sign.
6. Click on the map. MapX zooms in on the map location where you clicked. You can click
repeatedly, to zoom in more and more. You can also draw a marquee to specify the exact area
that you want to zoom in on.
As you zoom in closer and closer, you will notice that more map features become visible. This
is because individual map layers have been set up with Zoom Layering (a feature that
automatically displays map layers within a preset zoom range ).
To zoom back out, hold down the CTRL key and click the map again. Note that while you're holding
down the CTRL key, the cursor changes to a magnifying glass with a minus sign.
One way to learn MapX is to study sample applications. Look for sample applications in the folder:
\Program Files\MapInfo\MapX 5.0\Samples50
Understanding ASIA.VBP
This project displays a simple form with a map. Buttons on the map allow the user to select various
tools—a Select tool, a Pan tool, Zoom In and Zoom Out tools. A TextBox at the upper right lets the user
read or set the map's zoom distance.
Highlights
The Main form contains a Map object (Map1). This object was placed on the form using the Map
control.
If the Visual Basic toolbox does not show you this control, you need to add the control to the
toolbox.
This application displays Asian data because the programmer chose the "Asia" geoset. You choose
the geoset at design-time, by right-clicking the Map object and choosing Properties. The
Properties dialog also allows you to set many other map properties.
When the user clicks one of the buttons at the upper left, the application uses the
Map.CurrentTool property to change which tool is in use. For example:
Private Sub Command4_Click()
map1.CurrentTool = miSelectTool
End Sub
The text box at the upper right allows the user to type in a desired zoom distance (distance across
the map), in miles. The application uses the Map.Zoom property to apply the new zoom distance:
Private Sub Text1_LostFocus()
map1.Zoom = Text1.Text
End Sub
When the user zooms in or out (using the Zoom In or Zoom Out buttons), the map's zoom
distance changes. The application automatically updates the text at the upper right by using the
MapViewChanged event.
Private Sub map1_MapViewChanged()
Text1.Text = map1.Zoom
End Sub
Understanding VBsample.VBP
This project displays another simple form with a map. However, it will only run if you are using Visual
Basic 5 or 6 with MapX. This map defaults to United States data, but it is designed to handle any
specified geoset. You may select a different geoset at design-time by right-clicking the map object and
selecting properties.
Tools
The tool bar is located on the left side of the screen. Drag the cursor over an icon to identify what
it is and click the desired tool. You may also access tools using the Tools menu.
Find Feature
The Find Feature command is located in the Map menu. When selected, the Find Dialog appears.
The user will define which layer, object, and value of object to use in the search. Optional
refinements are available. For more information on the Find feature, see Chapter 9:”Finding
Features on a Map” on page 129.
Query Selection
Use a selection tool to select the area for query. The Query Selection feature can access data
associated with a map. It is located in the Map menu.
Note: These topics assume that you are using Microsoft’s Document/View model (standard
MFC AppWizard app.) The sample application can be built in Developer Studio with
mapxsamp.mdp.
1. Select the MapX icon from the Tools palette, under the ActiveX tab.
2. Draw a box on the form representing where you want the Map to appear. Delphi will then
show a preview of the Map on the form.
3. Select Run from the Run menu to run the new application.
Note: Although MapInfo has made every effort to test the sample code that appears in the online
help for accuracy and usability, it is conceivable that for one reason or another, some of the
code samples may not work as designed in your MapX applications. Minor adjustment or
“tweaking” may need to be made to the existing code in order for it to work properly.
You can reach the information in several ways:
• Use the Help Contents screen to choose topics from books. Click on a book to display its
topics, and choose a topic from the list.
• Use the Find feature to search on a specific word. Select: Start menu > Programs > MapInfo
MapX > MapX Online Help. Then, click index and go to the Find Tab. Type the word you
want to search for, and click Rebuild. A list of words to help narrow your search. Click on a
word, and a list of topics displays that contain the selected word. Double-click on the topic
you want or click Display to display the topic. You my customize your search by clicking
Options to make your find more specific.
• Use the Index feature to find a topic quickly. Type the first few letters of the word you are
looking for. The topic that most closely matches what you typed is highlighted. Click the
index entry you wish to display.
• See Also information: Click on the green underlined text in any Help window to bring up
information on related tasks or key words and phrases.
Online Help has been designed to display in part of your window so that you can view your maps,
Browser windows, and dialogs alongside the Help window. Of course, you can always change the size
of the Help window to work the way you are most comfortable. Choose Help > Always On Top to
keep the Help window on your screen so you can continue to work in MapX. Or use Alt–Tab to toggle
between the Help screen and the MapX desktop.
Note: Although MapInfo has made every effort to test the sample code that appears in the online
help for accuracy and usability, it is conceivable that for one reason or another, some of the
code samples may not work as designed in your MapX applications. Minor adjustment or
“tweaking” may need to be made to the existing code in order for it to work properly.
Note: When using MapX with Visual Basic, you will find properties/methods in the MapX
Library that do not have help topics associated with them. These properties/methods are
inherited from Visual Basic. Consult Visual Basic documentation for information regarding
these properties.
Where to Go Next
This chapter has provided a very quick overview of MapX. Other sections of this documentation
describe specific features of MapX in greater detail.
Before you read any further, take a moment to view the MapX Object Model Diagram. This poster is
included with MapX and is useful for giving you the “big picture”. Use it as a reference as you learn
about MapX.
Mapping in Layers
This chapter presents the relationship between tables and
maps, and shows how they are layered to create the level
Chapter
of detail you want.
➤ Maps as Layers
➤ The Layers Collection:
Building Blocks of Your Map
➤ Some Properties of the Layers
Collection
➤ Some Methods of the Layers
Collection
➤ Creating Layers with the
LayerInfo Object
➤ The Layer Object
➤ Layer Order
➤ Examining Layers
➤ Checking the Feature Type
➤ Zoom Layering
➤ Generating Labels for a Layer
➤ Annotations 81
➤ Raster Images
➤ Animation Layers
➤ Drawing Layers
Chapter 5: Mapping in Layers
Maps as Layers
You have already been introduced to the concept of computer maps as a collection of layers in the
previous chapter. Each MapInfo table that contains graphic objects can be displayed as a layer in a
Map window. For example, you can display a table of customers, a table of streets, and a table of
county boundaries.
Think of these layers as transparencies where each layer contains a different part of the map. The
layers are stacked one on top of the other and allow you to see all aspects of the map at the same time.
For example, one layer may contain country boundaries, a second layer may have symbols that
represent capitals, and a third layer might consist of highways. Laying these transparencies one on top
of the other builds a complete map.
Now let’s get into the specifics of creating a map.
2. Click found in the Custom row. The Property Page will appear.
3. Click on the Layers tab to view a list of the Layers in the collection.
You can use this page to modify many properties of Layer objects in the collection, reorder Layers, or
add and remove Layers in the collection.
For example, you can make a layer of the map invisible when the map is displayed by highlighting the
layer and clearing the Visible check box. When the map is displayed, that layer will not be visible. Of
course, you can reset the layer to visible programmatically during run-time, for example:
Map1.Layers.Item(2).Visible = True
We’ll work a lot more with layers programmatically, in the following section.
Note: For a complete listing of Layers Collection methods and properties, see Layer Object and
Layers Collection on page 377.
Note: For a complete listing of Layers Collection methods and properties, see Layer Object and
Layers Collection on page 377.
If the user clicks OK, the changes made within the dialog will immediately be applied to the map.
Map1.Layers.LayersDlg
Display Mode
When a user first opens a map, boundaries, lines, points, and text are all displayed using defaults in
the map’s Geoset file. The user can change how objects display by using the Display Mode section of
the Display Options dialog.
For example, the user wants to change the display of streets to a dashed red line. In Layer Control the
user would choose the street layer and click the Display button. This brings up the Display Options
dialog. The user would check the Style Override box to activate the Style Override button (large gray
button). MapX displays the override buttons that are appropriate for the type of objects in the layer.
For example, if the layer contains streets, a line style override button displays. Clicking on it to will
access the Line Style dialog where the user can change the width, style, and color of the streets.
For boundary layers, the style override button brings up the Region Style dialog where the user can
change both the fill and borders of boundaries. The Symbol Style dialog displays when the user wants
to override the style for layers containing symbols or points. The Style Override is only in effect during
the current work session, as are the other display settings. To make them permanent,you would have
to modify the geoset.
Creating A Layer
You can create new MapInfo tables to add to your map. These tables can be permanent
(miLayerInfoTypeNewTable) which means the layer will be created on your hard drive and remain
after your application is done running, or temporary (miLayerInfoTypeTemp) which means the layer
will be created in memory and will not remain after your application is done running. The examples
below show the creation of new permanent and temporary layers.
'Create a new permanent layer that contains all features selected in the
'USA layer
Dim li as New MapXLib.LayerInfo
Dim ftrs as MapXLib.Features
Dim flds as MapXLib.Fields
Dim ds as MapXLib.Dataset
'the new table will have the same columnar structure as the USA layer
Set ds = Map1.Datasets.Add (miDatasetLayer, Map1.Layers("USA"))
Set flds = ds.Fields
'the new table will contain all features currently selected in the USA
'layer
Set ftrs = Map1.Layers.Item("USA").Selection.Clone
li.Type = miLayerInfoTypeNewTable
li.AddParameter "Name", "USA Selections"
li.AddParameter "FileSpec", App.Path & "\USA_Selections.tab"
li.AddParameter "Fields", flds
li.AddParameter "Features", ftrs
li.AddParameter "OverwriteFile", "1"
'The layer is created when added to the layers collection
Map1.Layers.Add li
'Create a new temporary layer that contains all features selected in the
'USA layer
Dim li as New MapXLib.LayerInfo
Dim ftrs as MapXLib.Features
'the new table will have the same columnar structure as the USA layer
Set ds = Map1.Datasets.Add (miDatasetLayer, Map1.Layers("USA"))
Set flds = ds.Fields
'the new table will contain all features currently selected in the USA
layer
Set ftrs = Map1.Layers.Item("USA").Selection.Clone
li.Type = miLayerInfoTypeTemp
li.AddParameter "Name", "USA Selections"
li.AddParameter "Fields", flds
li.AddParameter "Features", ftrs
'The layer is created when added to the layers collection.
Map1.Layers.Add li
li.Type = miLayerInfoTypeTab
li.AddParameter "FileSpec", "\My Documents\Maps\USA.tab"
li.AddParameter "Visible", False
li.AddParameter "AutoCreateDataset", True
li.AddParameter "DatasetName", "dsUSA"
Map1.Layers.Add li
Remove a Layer
The Remove method removes a specified layer from the map.
Map1.Layers.Remove 3
nLayers = Map1.Layers.Count
' remove all of the layers
Map1.Layers.RemoveAll
nLayers = Map1.Layers.Count
Reposition a Layer
The Move method repositions a layer in the Layers collection. The first parameter is From position (the
top layer = 1) and the second parameter is the To position.
Map1.Layers.Move 1,2
AutoLabel
Controls whether the layer is automatically labeled.
Map1.Layers(“States”).AutoLabel = True
Name
Name of the layer.
MsgBox Map1.Layers(4).Name
OverrideStyle
Whether to override this layer’s default display characteristics.
Map1.Layers(9).OverrideStyle = True
Selectable
Sets MapX to recognize when a user clicks on this layer.
Map1.Layers(“States”).Selectable = True
Style
The layer style to use if OverrideStyle is True.
Map1.Layers(9).Style = newstyleobject
Visible
Whether or not a layer is visible.
Map1.Layers.Item(2).Visible = False
ZoomLayer
Sets zoom layering on or off.
Map1.Layers(“States”).ZoomLayer = True
ZoomMax
Sets the maximum zoom level at which a layer will be visible.
Map1.Layers(“States”).ZoomMin = 580
ZoomMin
Sets the minimum zoom level at which a layer will be visible.
Map1.Layers(“States”).ZoomMin = 45
Layer Order
Map layers in a Layers collection display in increasing index order (i.e., Layers(1) is the top layer,
Layers(2) is the layer underneath Layer(1), etc.), with the bottom layer drawn first and the top layer
drawn last. It is important to order your layers correctly.
For example, suppose that you have a layer of customer points and a layer of census tracts. If the
layers are incorrectly ordered in the Layers collection, MapX will draw the customer points first and
then display the census tract layer second. Your points would be obscured by the census tract layer.
You can reorder how layers are displayed in a Map at design time. From the Layers tab of the Property
Page, select the layer(s) you want to reorder and choose either the Up or Down button to move the
layer(s) to a position above or below its current position.
To allow the user to reorder layers at runtime, use the LayersDlg method to present the Layer Control
dialog, as discussed elsewhere.
Layer order is also important when you use the Select tool. The Select tool selects objects from the
topmost Selectable layer. If you have several objects at the same location, it is difficult to select the
exact one you want. You can reorder your layers so that the layer you want to select from is the new
topmost layer.
Examining Layers
There are many instances where you might want to examine layers in a collection. Here’s a simple
code fragment to iterate through a Layers collection to determine what types of layers are present, and
to display a message in a dialog box indicating the layer type.
Dim lyr as Layer
For Each lyr in Map1.Layers
Select Case lyr.Type
Case miLayerTypeNormal
MsgBox “Layer ” & lyr.Name & “ is a normal layer”
Case miLayerTypeRaster
MsgBox “Layer ” & lyr.Name & “ is a raster layer”
Case miLayerTypeSeamless
MsgBox “Layer ” & lyr.Name & “ is a seamless layer”
Case miLayerTypeUnknown
MsgBox “Layer ” & lyr.Name & “ is an unknown layer”
Case miLayerTypeUserDraw
MsgBox “Layer ” & lyr.Name & “ is a user draw layer”
Case miLayerTypeDrilldown
MsgBox “Layer ” & lyr.Name & “ is a drilldown layer”
Next
In the code fragment we are using MapX-defined constants for all the layer types. These constants are
collectively known as LayerTypeConstants.
The Layers collection has a one based index, so we iterate from an index value of one through the
count of the Layers collection. We also evaluated the PredominantFeatureType property of each layer
in the collection, using the FeatureType constants for evaluating the PredominantFeatureType.
Zoom Layering
Sometimes you want a map layer to display only at certain zoom levels. Zoom layering allows you to
view a map layer when the map's zoom level falls within a preset distance. You can set a different
zoom layering level for each layer.
For example, if your map includes a street map layer, you may find that the streets become illegible
when the user zooms out too far.
Using zoom layering, you might set up your map so that MapX automatically hides the streets
whenever the user zooms out to show an area larger than 5 miles.
The follwing sample code adds a layer to the map using the Layers collection Add method and sets up
zoom layering by modifying the Layer object’s properties.
As attributes, labels are dynamically connected to their map objects. If the layer is closed or is made
invisible, the labels no longer display. If the data or geographic information changes, the labels change.
If you create an expression for your labels and change the expression, the current labels are
dynamically replaced with new ones.
Whether you label your map automatically, or interactively using the Label tool or the LabelAtPoint
method, the content of the label is determined by the data associated with the geographic object.
In addition to label content, you control the position, display, and look of automatic labels by using
properties in the LabelProperties object. You can set conditions for displaying labels, in the style in
which will display, and in what position for all the objects in the layer.
You can also cotrol the appearance of individual labels via the Labels Collection. There is a Labels
collection associated with each layer, and each item in the collection is a Layer Object. By
manipulating the properties of a Label Object you can control the display of a label independently
from the rest of the labels in that layer
number of labels you want to display on your map, set the LabelMax property. The Duplicate
property controls whether features with the same name can have separate labels on the map
simultaneously. The Overlap property controls whether labels are allowed to overlap; setting Overlap
to True can cause more features to be labeled, but you may find that overlapping labels are harder to
read.
Zoom-layering Labels
You can configure labels to display only within a specific zoom range, much the same way that
you display map layers within a certain zoom range. To specify a zoom range for labels, set the
LabelZoom, LabelZoomMax, and LabelZoomMin properties of the LabelProperties for the layer.
Label Position
To control label positions, set the Position property (which controls whether labels are above,
below, or to the side of the feature's centroid), and the Offset property (which controls how far the
label is offset from the feature).
The default anchor point depends on the layer's predominant feature type. For example, a layer of
region features defaults to having labels centered over region centroids.
For line/polyline features (such as street maps), you can make labels run parallel to the line
features—set the Parallel property to True.
Creating Callouts
Callouts are labels with lines pointing to the objects they are labeling. They are very useful when
there are many labels in a relatively small area. For example, you are labeling a map of Asia. There
are many small countries that are relatively close together. If you tried to label all the countries,
the labels would overlap and be difficult to read.
To display callout lines, set the LabelProperties.LineType property to miLineTypeSimple (1) or
miLineTypeArrow (2) for the layer that you want to label.
Label Styles
To make style changes for all the labels set the Style.
You can also set the appropriate style options. Make the style changes you want. When you return
to the map, the selected labels display with the style changes you specified.
There are also background options. Set the appropriate options to have no background, or halo to
create a halo effect around the text. This puts the text into relief from whatever it covers (e.g., part
of a region, or a street, etc.).
Interactive Labeling
Although you will probably do most of your labeling automatically, in some cases you may want
to create labels one at a time, using a Label tool. The Label tool is one of the standard tools built
into MapX. To activate the tool, set the Map.CurrentTool property to miLabelTool (1010); the user
will be able to label a map feature by clicking on the feature.
The easiest way to remove all labels in a layer is to use the Visibility setting. It will disable the
display of all the labels in that layer, both automatic and custom labels. To clear only the custom
labels (those labels placed using the Label tool), use the ClearCustomLabels method.
Labels can be moved interactively by selecting a label or labels with the select tool (miSelectTool
1007) then dragging the label(s) to a new location. A label that has been edited manually then
becomes an itemin that layer's Labels Collection. It can then be edited programatically by setting
properties of the Label Object.
Annotations
Although the labeling feature takes care of most of your text needs, you may still need to create text
objects to annotate your map. Unlike labels, text annotations are not connected to data— you can place
an annotation anywhere on the map, even if there are no features at that location.
To add text or symbol annotations to your map, use the methods and properties in the Annotations
collection and object or add text or symbols using the Symbol and Text tools (miSymbolTool 1005,
miTextTool 1006).
Each Map has a collection of Annotations (Map.Annotations property). Annotations are either symbol
or text objects, and are drawn on top of the map.
Annotations are typically used to add text messages to a map, or to put symbols on a map. These
annotations scale with the map as you zoom in and out. Annotations are not tied to a particular map
layer. Annotations are always on top.
Note that the Annotation object has no properties for setting the position, symbol style, or text. To
control these aspects of an annotation, you use the Annotation.Graphic property to obtain a Graphic
object, then modify the Graphic object.
Raster Images
Raster images are a type of computerized picture consisting of row after row of tiny dots (pixels).
Raster images are sometimes known as bitmaps. Aerial photographs and satellite imagery are
common types of raster data found in GIS.
Below are the raster image formats supported in MapX:
• TIFF (*.tif)
• MrSID (*.sid)
• ECW (*.ecw)
• Spot (*.bil)
• Jpeg (*.jpg)
• PCX (*.pcx)
• GIF (*.gif)
• Windows Bitmap (*.bmp)
• PNG (*.png)
• Photoshop (*.psd)
• Targa (*.tga)
• Windows Metafile (*.wmf)
• JPEG200 (*.jp2)
Note: When you display a raster image as a map layer, MapX automatically sets the rotation and
projection of all the vector map layers, so that they match the rotation and projection of the
raster image.
Animation Layers
The Animation layer is useful where map features need to be updated frequently, such as in real-time
applications. For example, you can develop a fleet-management application that represents each
vehicle as a point object. You can receive current vehicle coordinates by using GPS (Global Positioning
Satellite) technology, and then update the point objects to show the current vehicle locations on the
map. In this type of application, where map objects are constantly changing, the map redraws much
more quickly if the objects being updated are stored in the animation layer instead of a conventional
layer.
Initially AnimationLayer is set to null. You can assign a Layer object to the property to make that Layer
the animation layer (it can be a regular layer or user draw layer). When a layer is assigned to the
AnimationLayer property, it is drawn on top of all layers, including the Annotations layer and
selections. The layer is still in the same position in the Layers collection. Floating objects like legends
are still displayed on top of the animation layer, although they don't have to be re-drawn each time
because they are clipped out. If a normal layer is used as the animation layer, selections and labeling
will still work.
Example
Set Map1.Layers.AnimationLayer = Map1.Layers(3)
The property can be used to identify what layer is currently the animation layer (if any):
for each lyr in Map1.Layers
if Map1.Layers.AnimationLayer = lyr then ...
end if
next
To turn off the animation layer, you assign null to it:
Set Map1.Layers.AnimationLayer = nothing
Drawing Layers
Layers.Add with a LayerInfo object of type miLayerInfoTypeUserDraw gives developers the ability to
add UserDraw layers to a map. UserDraw Layers allow you to draw objects in a layer that are
independent of any map features. UserDrawLayers are used in conjunction with the DrawUserLayer
event, which is fired when the layer needs to get drawn. There can be any number of user draw layers.
How It Works
First, you add a user draw layer to your layers collection:
' this sets the UserDraw Layer to “My Layer”
Dim li as MapXLib.LayerInfo
Dim lyr as MapXLib.Layer
Set li = CreateObject("MapXMobile.LayerInfo.5")
li.Type = miLayerInfoTypeUserDraw
li.AddParameter "Name", "UserDraw"
Then you put the code to do the drawing on the layer in the DrawUser Layer event. When the
application creates a UserDraw layer using the Add method of the Layers collection,
an event is fired to the application when the window needs updating.
Example
A complete example is shown below.
' API DEFS should be declared in a separate module
Declare Function MoveToEx Lib "gdi32" Alias "MoveToEx" (ByVal hdc As
Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long,
ByVal x As Long, ByVal y As Long) As Long
Declare Function SetMapMode Lib "gdi32" Alias "SetMapMode" (ByVal hdc As
Long, ByVal nMapMode As Long) As Long
Type POINTAPI
x As Long
y As Long
End Type
Public Const MM_TWIPS = 6
dim PX as single
dim PY as single
X1 = -111.0542
Y1 = 45.0009
X2 = -104.0528
Y2 = 41.0018
if map1.ClipLine(X1,Y1,X2,Y2) then
map1.ConvertCoord(PX, PY, X1,Y1, miMapToScreen)
MoveToEx hDC , PX, -PY, pt ' win api call
map1.ConvertCoord(PX, PY, X2,Y2, miMapToScreen)
LineTo hDC, PX, -PY ' win api call
end if
End Sub
ADO This type of databinding uses the MS Active data objects ADO
recordset.
DAO A DAO Recordset object. You can get one from a Visual Basic data
control, an Access form, or by creating one in Visual Basic, Access, or
C++.
Delphi This type uses the Borland BDE datasources.
Global Handle This type of data binding lets you pass in a block of tab-delimited
data.
Layer This type of data binding lets you create a Dataset that uses fields
from a MapInfo table.
Notes View/ These types of data binding deal specifically with Lotus Notes.
NotesQuery
OCI MapX can use OCI to retrieve data from an Oracle data source.
ODBC MapX can use ODBC to retrieve data from any ODBC data source.
OLE Data This is for containers such as PowerBuilder.
Oracle Express Objects This allows access to the datacube as a Dataset.
RDO This uses MS Remote Data Objects and RDO Resultset object.
SafeArray A COM Dataset that allows static binding of data from a safe-array.
Unbound If you cannot support one of the other formats, MapX provides a
‘back door’. With this type of data binding, you can set up an event
loop whereby MapX asks the container for data values, one cell at a
time.
These custom, user-created types of data binding are discussed in detail, later in the chapter.
Type Parameter
This parameter is the type of Dataset being added. This parameter takes a DatasetTypeConstants
value.
DatasetType Constants
Type Description
miDatasetADO ADO
miDatasetDAO Data Access Object
miDatasetDelphi Borland Delphi Native
miDatasetDelphi4 Borland Delphi4
miDatasetDelphi5 Borland Delphi 5
miDatasetGlobalHandle Tab delimited data
miDatasetLayer MapInfo Table
miDatasetNotesQuery Lotus Notes Query
miDatasetNotesView Lotus Notes View
miDatasetOCI Oracle Call Interface Data Source
miDatasetODBC ODBC Database
miDatasetOLEData OLE data source
miDatasetRDO RDO
miDatasetSafeArray Safe Array
miDatasetUnbound MapX requests data from container.
SourceData Parameter
This parameter is a reference to the data, and is different depending on the Dataset Type. With most
types of data binding, the DataSource (the second parameter for Datasets.Add) is actually an OLE
interface. MapX uses the interface to access the data directly from the data source. The data isn’t
actually passed to Datasets.Add.
Name Parameter
This parameter is a string that uniquely identifies the Dataset. This is an optional parameter, and if not
specified, a name in the form of DatasetN is used where N is a unique number.
Geofield Parameter
This parameter is the name or index of the column in the data source that contains the geographic
information. If this parameter is not specified, MapX searches the fields to determine which column in
the data source contains the geographic information as specified in the GeoDictionary. This will not
necessarily be a geographic data field, as it could be a unique key column such as zip codes. However,
if you know which column in the data source contains the geographic information, you should specify
it.
If you plan to view the data as features on a map, the GeoField column in your data source must be
unique. The GeoField column will be used to name the features in the new point layer. Non-unique
values will result in a single point being added to the new point layer for the first occurrence of the
duplicate key value, and data values in the duplicate rows will be aggregated.
If a Fields collection is specified, the Geofield parameter refers to columns in the Fields collection
rather than in the source data.
BindLayer Parameter
This parameter specifies the map layer to attach your data to if you are binding attribute data, or, a
BindLayer Object if incoming data is to be georeferenced to a point reference file (such as Zip Codes)
or contains Long/Lat values. This is an optional parameter, and if not specified, MapX searches layers
in the GeoDictionary to attach to.
If you know which map layer should be bound to, you should specify it for performance reasons.
When doing BindLayer matching, the Geofields must be unique. Only the first item of a non-unique
set of data will be matched. The rest are ignored. The BindLayer is discussed in more detail later in
this chapter.
Note: When miBindLayerTypeXY is used within DataSets.Add a temporary table will be created
with one column named "GeoName" , in order for a fields collection to be recognized a new
Databind must be created on a permanent layer.
Fields Parameter
This parameter is a Fields object that is a collection of Field objects. The Field objects are used to
describe which fields from the data source to bring in, and which aggregation function to use if more
than one record for the data source matches a particular map feature. This will set up a collection of
fields (columns) you wish to bind to the map. This is an optional parameter, and if not specified, all
columns are brought in, and the data values are summed if more than one record is encountered per
feature. The Fields collection is discussed in more detail later in this chapter.
If a Fields collection is specified, the Geofield and SecondaryGeofield parameters refer to columns in
the Fields collection rather than in the source data.
Dynamic Parameter
This parameter is a boolean value that controls whether the data binding is dynamic. It is optional; if
omitted, it will default to False, meaning that the binding is static (i.e., MapX will copy needed data
when the database is opened). If you specify True, MapX accesses data in a live manner, only as data is
needed (e.g., when labeling). If you specify True but the Dataset does not support dynamic columns,
an exception will be thrown.
Data Aggregation
The Aggregate Function parameter of the Fields.Add method determines how MapX computes the
Field value when multiple matches are found.
For example, if the data looked like the following:
STATE SALES
CA 120
NY 100
CA 50
CA 110
Here there are three sales in California, and since only one data value will be attached to California, we
need to tell MapX to either sum the sales, average the sales, or count the sales.
The Aggregate Function parameter of the Fields.Add method defaults to miAggregationIndividual for
string columns, and miAggregationSum for numeric columns.
The following are the aggregates used to handle multiple matches:
Constant Description
Note: In previous versions of MapX MapInfo shipped a file for ZIP Code binding called
Zipcodes.cpf. We no longer ship that file. In place of Zipcodes.cpf we ship Us_zips.tab
To create and display a layer of point features through ZIP Code data binding, use a BindLayer object,
and set :
• Its LayerType property to be miBindLayerTypePointRef.
• Its RefColumn1 property to be the name or index(zero-based) of the column in your table
containing the zip code (or other point reference) data.
• Its ReferenceLayer as the name of the reference file to use. A reference file contains the x and
y coordinates that the data binding process will use to determine the geographical location
for your ZIP Code data on the map. The ReferenceLayer property can be set to a layer's
filename (a full file specification) or set to the layer's "friendly name" (the description that is
assigned to the layer through the geodictionary).
Note: The reference layer does not need to be displayed in the map, but it must be installed in
your geodictionary.
The RefColumn2 property is not used in ZIP Code data binding because US ZIP Codes are unique.
During "unbound" data binding, you use the RequestData event to set up a loop, so that the container
provides data to MapX one cell at a time.
Refreshing Datasets
Since the data from the data source is aggregated and stored in MapX, when the data changes in the
data source, MapX does not reflect the change. The Dataset.Refresh method can be used to have MapX
reread the source data and re-aggregate and store it. This, however, can be time consuming.
Dataset.Refresh does not work for Datasets that create new point layers. A workaround is to simply
remove the layer and re-add the Dataset, or to perform the following steps:
1. Create a new point layer using Datasets.Add with a BindLayer of type miBindLayerTypeXY.
Create the new layer with only the X and Y columns by passing a Fields object, with only
those two columns specified, in the Datasets.Add method.
2. Bind the rest of the data to this newly created layer. Use Datasets.Add with normal binding,
using the X field for the Geofield parameter and the Y field as the SecondaryGeofield
parameter. This second Dataset can be refreshed.
Note: This method will not add new features to the layer when new rows are added to the data
source.
where Field is a string value in quotes, or a numeric value without quotes; TAB is character 0x09; and
CRLF is a carriage-return line-feed sequence: 0x0D 0x0A.
miDatasetOLEData (PowerBuilder)
This is for containers such as PowerBuilder, that pass data to MapX in the format described in
miDataGlobalHandle when initializing the MapX control. Then a call to Datasets.Add with
miDatasetOLEData as the type tells MapX to build a Dataset using the previously passed in data.
miDatasetSafeArray (SafeArray)
This type of data binding lets you create a Dataset that uses fields from an array of data.
miDatasetXML
The MapX XML Dataset Driver is an implementation of the MapX Dataset Driver interface suite. The
MapX Dataset Driver interfaces are based on the Microsoft Component Object Model (COM)
architecture. Specifically, the MapX XML Dataset Driver provides a set of interfaces providing access
of XML data to MapX.For detailed information on using XML datasets with your MapX applications,
see help topic, XML Support on page 94
XML Support
The MapX XML Dataset Driver leverages the Microsoft XML Parser. There are several versions of
Microsoft XML Parser. Version 1.x is not supported. MapX XML Dataset Driver has been tested with
and supports Version 2.x. Additionally, the upcoming Version 3.0 of the Microsoft XML Parser may be
supported but has not been tested. No other parsers are currently supported.
On issues of standards conformance, the MapX XML Dataset Driver standards conformance is based
on the version of the Microsoft XML Parser registered with the system. For example, Version 2.5 of the
Microsoft XML Parser standards conformance includes:
• XML: Conformance is based on the Extensible Markup Language Version 1.0 specification.
• XSL: Conformance is based on the XML Stylesheet Language Working Draft (12.18.1998)
For more information refer to Microsoft support for the Microsoft XML Parser.
Version 2.0 of the Microsoft XML Parser is included as part of the installation. However, as of this
writing, Version 2.5 SP1 of the Microsoft XML Parser is available as a stand-alone redistribution and
included as part of the installations for Microsoft Windows 2000 SP1 and Microsoft Internet Explorer
Version 5.01 or higher.
document for transforming a specified XML Dataset based on an external schema into a MapInfo XML
Dataset. The following snippet is a simple example for Microsoft Visual Basic:
Dim XMLDataset As MapXLib.Dataset
DIM XMLResource As MXMLDatasetDriverConfiguration
' Set XMLResource SourceLink
XMLResource.SourceLink = "http://www.xml.com/DataSource.xml"
' Set XMLResource FilterLink – currently unsupported
XMLResource.FilterLink = "http://www.xml.com/DataFilter.xml"
' Assume MapObject exists within a form
Set XMLDataset = MapObject.Datasets.Add(miDataSetXML, XMLResource)
and defines the structure of the MapInfo XML Dataset. Each column is identified by name and type as
distinct attributes of a row element. The second document fragment contains the actual data.
Adhering to the data definition of the MapInfo dataset schema, the data fragment contains multiple
row elements representing the individual rows. Each of the following two samples provides an
example of a MapInfo XML Dataset, both exposing the same data. After the two samples, we break
down the XML document and study the individual pieces and fragments.
Sample A
<xml xmlns:s="urn:schema-microsoft-com:xml-data" xmlns:ds="urn:schemas-
microsoft-com:rowset" xmlns:dt="urn:schemas-microsoft-com:datatypes"
xmlns:x="#DatsetSchema">
<!-- schema -->
<s:schema>
<s:elementType name='row' content='eltOnly'>
<s:attributeType name='StateAbbr' dt:type='string'/>
<s:attributeType name='StateName' dt:type='string'/>
<s:attributeType name='StatePop' dt:type='14'/>
<extends type='rowbase'/>
</s:elementType>
</s:schema>
<!-- data -->
<ds:data>
<x:row StateAbbr ='AK'StateName='Alaska' StatePop='550043'/>
<x:row StateAbbr ='NY' StateName='New York' StatePop='17990455'/>
</ds:data>
</xml>
Sample B
<xml xmlns="#xmldataset">
<!-- schema -->
<schema>
<elementType name='row' content='eltOnly'>
<attributeType name='StateAbbr' type='string'/>
<attributeType name='StateName' type='string'/>
<attributeType name='StatePop' type='14'/>
<extends type='rowbase'/>
</elementType>
</schema>
<data>
<row StateAbbr ='AK'StateName='Alaska'StatePop=' 550043'/>
<row StateAbbr ='NY' StateName='New York' StatePop='17990455'/>
</data>
</xml>
First, we will break out the document root tag, the <xml> tag. The important points to notice in this
fragment is the namespaces:
SearchTypeConstants
Search Constant Description
Method Description
Feature Object
A Features collection is made up of a collection of Feature objects. A Feature object corresponds to a
feature on a map like a symbol, line, or region.
A Feature object corresponds to features (actual entities) in a layer, such as New York, Chicago,
Louisiana, Cortland County, or Highway I-10.
Stand-Alone Features
The Feature object methods allow you to create and manipulate stand-alone feature objects. When you
create a stand-alone feature object, you must attach that feature object to the map before you reference
any of its methods or properties. Attaching a feature to the map associates the map's coordinate
system with the feature.
SelectionTypeConstants
The following constants determine what to do with the results of your selection.
SelectionChanged Event
This event is called whenever the selection changes. It enables the container to react to a selection
made on the map. The selection can change as a result of a user using a selection tool, or by using one
of the Selection methods from the Layer object.
Feature Editing
MapX allows you to create, modify, or delete the features (points, lines, regions, etc.) that make up a
map layer. Any layer that is based on an ordinary MapInfo table (.tab) file can be edited.
Note: MapX does not provide transaction support. In other words, when you update the feature,
after you add/delete/change a feature, it happens immediately. You don't need to save any
changes later, and you can't undo the operation.
FeatureFactory Methods
The methods of the FeatureFactory object let you create new map features, or create features by
performing operations (such as buffering) on existing features.
Most of these methods return stand-alone feature objects. These feature objects are automatically
attached to the map (i.e., they already have an associated coordinate system). In other words, you do
not need to use the Attach method on the features returned by these methods.
To obtain a FeatureFactory object, reference the Map.FeatureFactory property.
The MapX Online Help provides extensive instructions on how to use the various FeatureFactory
methods.
• If you have modified a feature and want to commit the changes, use the Feature.Update
method.
• If you want to replace a feature with another feature, use the Layer.UpdateFeature method.
• When a feature is updated, both the old MBR and the new MBR are invalidated so that the
screen redraws correctly.
Note: Make sure you spell the font's name correctly if you assign the Name property. Any
misspelling of a font name—even specifying a lowercase letter where an uppercase letter is
needed—can cause problems.
Thematic Variables
The data that you display on your thematic map is called the thematic variable. Depending on the type
of thematic analysis you are performing, your map can show one or more thematic variables. Ranges
of values, grid shading, graduated symbols, dot density, and individual values maps all examine one
variable. With bar or pie charts, you can display more than one thematic variable at a time.
You can also create bivariate thematic maps, where one map object, such as a symbol, represents two
different pieces of data. The symbol color, for example, can represent one thematic variable, and the
symbol size can represent another.
Themes Collection
Each dataset has a collection of themes. A Themes collection creates, counts, adds, or removes a Theme
object from a collection of themes. For information on the methods of the Themes collection, please
refer to the Chapter 18:”Theme Object and Themes Collection” on page 526.
Creating a Theme
If you want to thematically shade a map using data from a dataset, you create a Theme object for the
dataset with the Themes.Add method. Once a dataset is added to your map, creating the theme can be
done with one line of code:
Map1.Datasets(1).Themes.Add miThemeRanges “TotPop”, _
“My Ranges Theme”
This creates a ranged theme for the first dataset in the Datasets collection using the field “TotPop” .
For information on the Themes.Add method, please refer to Chapter 18:”Themes.Add method
(Themes collection)” on page 530.
greater than 1 Points, Lines, Regions Default theme type is pie charts. If a multi-
variable theme already exists, try to create a
single-variable theme using the first field in
the collection of fields provided (see
algorithms below).
1 Points If the bound field is aggregated by individual
value, try to create an individual value theme.
If a ranged or individual value theme already
exist, cannot create a default theme. If the
bound field is not aggregated by individual
value, try to create a graduated symbol theme.
If an object thematic already exists, try create a
ranged theme. If a ranged or individual value
theme already exist, cannot create a default
theme.
1 Lines If the bound field is aggregated by individual
value, try to create an individual value theme.
If a ranged or individual value theme already
exist, cannot create a default theme. If the
bound field is not aggregated by individual
value, try to create a ranged theme. If a ranged
or individual value theme already exist, try to
create a graduated symbol theme. If an object
thematic already exists, cannot create a default
theme.
1 Regions If the bound field is aggregated by individual
value, try to create an individual value theme.
If a ranged or individual value theme already
exist, cannot create a default theme. If the
bound field is not aggregated by individual
value, try to create a ranged theme. If a ranged
or individual value theme already exist, try to
create a dot density theme. If a dot density
theme already exists, try to create a graduated
symbol theme. If an object thematic already
exists, cannot create a default theme.
Note: Pies, Bars, and Graduated Symbols are all object thematics.
Determination of a default theme type is layer specific. In other words, themes on Layer A are not
considered when attempting to determine a default theme type for a new theme on Layer B.
ThemeType Constants
These are the types of themes you can create are:
Type Description
Each has its own purpose and unique attributes. For example, using miThemeRanged, you could
thematically shade a map of the world according to population density. You could shade the countries
with graduated shades of red, the darkest red representing the most densely populated countries, and
the palest red representing the least densely populated countries. At a glance you can see the
distribution of the world’s population.
You are not limited to representing numeric values with thematic mapping. Nominal values also may
be shaded thematically. For example, you have a dataset of underground cables. Those cables that
haven’t been serviced in the past six months are labeled priority status. Using
miThemeIndividualValue, you can shade the cables according to their repair status. All records with
the same value will be shaded the same color. See the individual sections later in this chapter for more
information on each type of thematic map.
Once the Theme is added to a specified collection, the Theme object is created and you may
manipulate the properties of the object.
Theme Object
The Theme object sets the properties of the theme within the Themes collection. Modifying the Theme
object methods and properties determines how a theme is viewed, the type of theme, etc.
For a complete listing of all Theme object properties, please refer to the Chapter 18:”Theme Object and
Themes Collection” on page 526.
For example, a soft drink distributor maintains a table of the supermarkets that buy soft drinks from
him by Zip Code in Washington D.C. Each supermarket sells the distributor’s brand of soft drink for a
different price. If the distributor shades the Zip Code boundaries by price, using individual values, all
stores that sell the soft drink for 49 cents are shaded one color, all stores that sell the soft drink for 51
cents are shaded another color, and so on. Each unique value is assigned its own color. The distributor
is able to see the price distribution among the supermarkets and can determine where he should
increase his sales volume, based on the price.
If you are shading your points, lines, or boundaries using nominal data, you can shade only by
individual values. Nominal data is either non–numerical data (e.g., name, type of cuisine served, or
brand of autoMobile sold) or numeric data where the numbers represent non–numeric data. Dates are
considered numeric data and can be used in both ranged and individual values maps.
For example, you have the results from a consumer survey. One question on the survey reads “What is
your favorite Sunday afternoon activity?” The possible responses are:
1. Sleeping
2. Watching TV
3. Taking a drive
4. Reading
5. Playing or watching sports
6. Visiting museums or art galleries
7. Going to the movies
You want to shade each consumer point with the response for the favorite Sunday activity. The
SUNDAY field of your dataset contains the number that corresponds to the consumer’s favorite
activity. However, the numbers in this column do not represent quantitative values. Going to the
movies is not greater than playing or watching sports even though 7 > 5. When numbers are used as
names instead of values, you must shade your objects by individual values. The numbers are only
used to reference the pastimes so a color can be assigned to it.
An individual values thematic map's settings are exposed through the IndividualValueCategories
collection, which is a collection of IndividualValueCategory objects—one object for each unique value
in the theme. To obtain an IndividualValueCategories collection, reference the
ThemeProperties.IndividualValueCategories property.
Ranged Maps
When you create a ranged thematic map, MapX groups all dataset rows into ranges and assigns each
row’s object the color, symbol, or line for its corresponding range. For example, you have a dataset of
weather stations for your television viewing area, and you want to shade the locations according to
their reported snowfall amounts.
With the Ranged map feature, MapX groups the snowfall amounts into ranges. For instance all
weather stations that received between zero and five inches of snowfall in the past month are grouped
into one range. Stations receiving between five and 10 inches are in a separate range. Sites that
received between 10 and 15 inches are in a third range, while those stations reporting greater than 15
inch snowfall amounts are in a fourth range.
All records in the dataset are assigned to a range and then assigned a color based on that range. For
instance the weather stations reporting the 15 plus inches of snow are shaded red. The other ranges are
shaded in lighter shades of red with the last range in gray (default colors). When you display the map,
the colors make it readily apparent which locations received the most and least snow accumulation.
Ranges are also useful when the size of the region is not directly related to the magnitude of the data
values.
DistribMethodConstants
Equal Count (miEqualCountPerRange) has the same number of records in each range. If you want
MapX to group 100 records into 4 ranges using Equal Count, MapX computes the ranges so that
approximately 25 records fall into each range, depending on the rounding factor you set.
When using Equal Count (or any other range method), it’s important to watch out for any extreme
data values that might affect your thematic map (in statistics, these values are referred to as outliers).
For example, if you shade according to Equal Count with this database:
Ben and Miguel are grouped in the same range (since they have the two lowest values). This may not
produce the results you want since the value for Ben is so much lower than any of the other values.
Equal Ranges (miEqualRangeSize) divides records across ranges of equal size. For example, you have
a field in your table with data values ranging from 1 to 100. You want to create a thematic map with
four equal size ranges. MapX produces ranges 1–25, 26–50, 51–75, and 76–100.
Keep in mind that MapX may create ranges with no data records, depending on the distribution of
your data. For example, if you shade the following database according to Equal Ranges:
Penny 6 Kyle 1
Miguel 4 Angela 92
Linda 95 Elroy 89
Ben 10 Mark 10
MapX creates four ranges (1–25, 26–50, 51–75, and 76–100). Notice, however, that only two of those
ranges (1–25 and 76–100) actually contain records.
Natural Break and Quantile are two ways to show data that is not evenly distributed.
Natural Break (miNaturalBreak) creates ranges according to an algorithm that uses the average of
each range to distribute the data more evenly across the ranges. It distributes the values so that the
average of each range is as close as possible to each of the range values in that range. This ensures that
the ranges are well–represented by their averages, and that data values within each of the ranges are
fairly close together.
When you create ranges using Standard Deviation (miStandardDeviation), the middle range breaks at
the mean of your values, and the ranges above and below the middle range are one standard deviation
above or below the mean.
You can also define your own ranges using Custom (miCustomRanges). You specify your own ranges
in the RangeCategories collection (and MapX won’t compute ranges).
Or you can represent how much interest each customer has expressed in a given product by assigning
a symbol whose size is proportional to the customer’s interest.
Graduated symbols maps work best when you use numeric data. If you are working with a table of
restaurants, it makes no sense to create graduated symbols based on the type of cuisine each restaurant
serves. However, graduated symbols is appropriate when you want to show the number of
hamburgers sold at 20 different fast food restaurants.
There are two theme properties you can customize on a graduated symbols map: the DataValue and
SymbolStyle. The SymbolStyle property controls the symbol that is used, as well as the size of the
symbol drawn at the value specified by the DataValue property. All values between the high value and
zero have interpolated point sizes. The SymbolStyle property is a Style object which controls all the
stylistic aspects of the symbol such as color, font, rotation, etc. You can also supply your own bitmap to
be used as the symbol.
The Style object has a symbol picker (Style.PickSymbol) which displays the Symbol Style dialog. The
dialog enables a user to choose symbol style properties. The Style object is updated with the new
properties when the user clicks OK in the dialog.
Dot density is particularly useful for showing raw data where one dot represents a large number of
something: population, number of fast food restaurants, number of distributors who carry a brand of
soda, etc.
For example, if you have a table of population broken down into county boundaries, you could use the
dot density option to show the concentration of people in each county boundary. There are two theme
properties you control for dot density maps. You can specify the value of one dot. For example, you
have a table of population statistics, broken down by county. There are 20,000 high school students in
Rensselaer County, New York. If you shade Rensselaer County according to the number of high school
students using the dot density method, each dot could represent 200 students. In that case, there
would be 100 dots in Rensselaer County.
When you increase the value each dot represents, you decrease the number of dots that display on the
map. You could modify your dot density map so that one dot represents 400 students. In that case,
there would only be 50 dots in Rensselaer County.
Map1.Datasets(1).Themes(“My DotDensity _
Theme”).ThemeProperties.ValuePerDot = 400
A second option is to change the size of the dots according to your needs. If you are working with
large populations, or large counts of something, make the dot size smaller so that the distribution of
dots is easier to see. Conversely, if your working with a small data set, making the dot size larger
might illustrate your analysis more clearly.
Map1.Datasets(1).Themes(“My DotDensity _
Theme”).ThemeProperties.DotSize = miDotSizeLarge
Note: Distribution of dots is random within the region. For example, if you shade states
according to population, the dots for New York are spread throughout the state; they are
not concentrated in New York City, where the majority of the state’s population lives.
There are five theme properties you control for bar charts: DataValue, Size, Independent,
MultiVarCategories, and Width.
The DataValue property works in conjunction with the Size property to control how big the thematic
graphics are at particular values. The default value for this property is set to the largest data value of
the mapped features.
The Size property works in conjunction with the DataValue property to control how big the thematic
graphics are at particular values. It specifies the height of the thematic graphic in Paper units
(PaperUnit). This is a Double value, and defaults to .25 inches.
The Width property specifies the width of each bar of a Bar theme in Paper units (Map.PaperUnit).
This is a Double value, and defaults to .25 inches.
The Independent property controls whether the data values for the bars should be treated
independently (not comparable values such as Population and Avg Income). This is a Boolean value,
and the default is False. The developer should set this to True for multi-value Bar themes where the
data for each bar of a single feature is unrelated to a bar for a different field of the theme, or the
maximum values for a field of data differ greatly. An example of this would be a population bar theme
where one bar may represent the population of a state and another may be a ranking in exports. The
population data would be in the millions and the ranking would only be between 1 and 50. If the
Independent property is set to True, then the highest populated state’s population bar would be equal
in height to the highest ranking state in exports export bar. Were the Independent property left False,
it would be difficult to obtain any meaning from the export ranking bar because the state ranked first
would have an export bar the size of a state’s population bar if that state had 1 person in it.
A bar chart thematic map is exposed to OLE through the MultivarCategories collection, which is a
collection of MultivarCategory objects. The collection contains one object for each bar in the bar chart.
Both pie and bar charts are particularly useful for analyzing demographic data. For example, you have
a dataset of demographic information for the United States. Your dataset shows the populations of
several major demographic groups. Using pie charts, you can show the population of each
demographic group, and see what fraction of the pie it makes up in each pie. This enables you to see
the distribution of demographic groups on a per state basis, or across the entire United States. You can
also look at one demographic group and see how the population of the group varies in different states.
For best results, use no more than four to six pie wedges per pie chart in your analysis.
There are four theme properties you control for bar charts: DataValue, Size, Graduated and
MultiVarCategories.
The DataValue property works in conjunction with the Size property to control how big the thematic
graphics are at particular values. The default value for this property is set to the largest data value of
the mapped features.
The Size property works in conjunction with the DataValue property to control how big the thematic
graphics are at particular values. It specifies the height of the thematic graphic in Paper units
(PaperUnit).This is a Double value, and defaults to .25 inches.
The Graduated property controls whether the size of the Pie charts are graduated based on the total
value of the Pie. This is a Boolean value, and defaults to True.
A pie chart map is exposed to OLE through the MultivarCategories collection, which is a collection of
MultivarCategory objects. The collection contains one object for each wedge in the pie chart.
Displaying Attributes
To display two variables within one symbol, it is important to choose a different symbol attribute for
each variable. For example, you cannot choose color for both variables because one color will
overwrite the other. Choose from the following combinations:
• color and symbol type
• color and size
• size and symbol type
Symbol type should only be used for nominal or non-numeric data, as there is no inherent association
between a symbol type and a quantity.
ThemeDlg Method
The theme object has a method, ThemeDlg, which displays a dialog allowing a user to modify the
theme. The following line of code shows how simple it is.
Map1.Datasets(1).Themes(1).ThemeDlg
You will get a dialog box with the ability to change parameters appropriate for the type of theme from
which it was called.
There are two possible drawbacks to using this method. First, you’re stuck with the design. If these
dialogs don’t fit in with your color schemes, or you don’t like how they are laid out, you can’t change
them. Another problem to using these methods is that sometimes they are too powerful. Perhaps you
only want the user to change the color of the top range of a ranges theme or you want to keep the
colors, but not let the user choose the number of ranges. Using the ThemeDlg method, the user can
change any (and all) parts of the theme.
ThemeProperties Object
You also have the ability to change just the property of the theme by manipulating the
ThemeProperties object. This is easy to implement and gives you more control of what the user can
and cannot change. The ThemeProperties object is stored in the Themes collection. The
ThemeProperties object properties are used to define the thematic map’s appearance (colors, symbols,
etc).The ThemeProperties object actually contains the information about how the theme should look.
Some of the ThemeProperties object’s properties are represented by other objects.
For a complete listing of all ThemeProperties object properties, please refer to
Chapter 18:”ThemeProperties Object” on page 534.
Several of the ThemeProperties properties are actually other objects. Those objects include the
RangeCategory object, IndividualValue object, MultiVar object and the Style object. Look at the next
table to see the properties of the RangeCategory object. The other theme-related objects behave
similarly.
Legend Object
Each theme has a Legend object (Theme.Legend). The Legend object contains properties to control the
display of the legend.
It is easily modified using the LegendDlg method from the Legend object. See the following sample
and the dialog that it will bring up.
Map1.Datasets(1).Themes(1).Legend.LegendDlg
Label Thematics
Label thematics allows one to add themes to a layer dataset which modifies the layer’s label display
characteristics. There are two types of label themes. They are:
• Ranged Value
• Individual Value
Ranged Themes
For ranged themes, you may modify the label style by using the Style property of each range theme
category (or bin.) You can use the ApplyAttribute theme property to modify the label's foreground
color, size or all its font properties. In addition, you can automatically spread the font size or
foreground color between all range categories by using the SpreadBy theme property. When you apply
all the attributes and perform a spread by (either color or size), all attributes (except for the one being
automatically spread) come from what is called the model style. In MapX, the model style is the first
range category style. For example, to automatically spread the label font size and modify only the font
size do the following:
Theme.ThemeProperties.ApplyAttribute = miApplyAttributeSize
Theme.ThemeProperties.SpreadBy = miSpreadBySize
To add a new label theme, you can use the Themes.Add method using either one of the following
theme ThemeTypeConstants:
• miLabelRangedTheme
• miLabelIndividualValueTheme.
See Chapter 19:”ThemeTypeConstants” on page 603 for a complete listing of available theme types.
You may then use the Theme.ThemeProperties property to configure your themes.
➤ Find Object
➤ FindFeature Object
Chapter 9: Finding Features on a Map
Refining Boundary
A refining boundary in your Find.Search is used to distinguish between mulitple features with the
same name. For example, if you travel to Albany, you might end up in New York, California, or
Georgia. The State would be the refining boundary when you say “Albany, New York”
Result Codes
Returns information on the Find Object such as why it was or was not found. This is a numeric result
code. The chart below describes the numeric result codes.
**Ones Place**
xx1 Exact match.
xx2 A substitution from the abbreviations file used.
xx3 ( - ) Exact match not found.
xx4 ( - ) No object name specified; match not found.
**Tens Place**
x1x Side of street undetermined.
x2x ( + / - ) Address number was within min/max range.
x3x ( + / - ) Address number was not within min/max range.
x4x ( + / - ) Address number was not specified.
x5x ( - ) Streets do not intersect.
x6x ( - ) The row matched does not have a map object.
** Hundreds Place **
1xx ( + / - ) Name found in only one region other than specified region.
2xx ( - ) Name found in more than one region other than the specified region.
4xx ( - ) No region was specified, and multiple matches were found.
5xx ( + ) Name found more than once in the specified region.
Once the result code is determined, you can use the results for selected cases as shown in the example
below. The user input from a text box indicates a city and state to locate. The input is brought into the
Find.Search method. Once the city is located from the major or minor city table, an annotation is
added to the map and the map is re-centered at the location in which the feature was found.
Note: There is no need to register every .tab file that an application uses in the Geodictionary,
and in fact there is some overhead in having unnecessary files registered.
The Geodictionary Manager Applications allows manipulation of the Geodictionary. The
Geodictionary Manager executable (GeoDictionaryManager50.exe) can be run with a graphical user
interface or with command line parameters. The command line options are useful for calling
GeoDictionaryManager40.exe from install programs to register the tables that a MapX application may
need to match against into the Geodictionary.
Background Information
Previous versions of MapX used the MapInfo Data Installer developed for Microsoft Map to manage
the Geodictionary. The Data Installer also managed geosets (groups of MapInfo tables that can be
displayed together), which was overkill for the Geodictionary Manager and caused confusion. There is
now a Geoset Manager application which should be used to create and manage geosets. The
Geodictionary Manager will not modify geosets in any way, nor will it delete files from a user’s disk.
In MapX 5.0 (or later versions), a permanent Geodictionary file is no longer required for MapX to run.
Note: There has been a change to the command line options that requires that file or path names
with spaces in them require that they be enclosed in double quotes. This may make some
command lines that worked previously fail now.
the Geodictionary file may have existed before the install (from an earlier version of
MapX), or may be shared by other apps.
MapX applications can share the same Geodictionary file, or use their own. In order for a MapX
application to use its own Geodictionary file (or to not use one at all), the Map.GeoDictionary
property can be changed at design time to point to a different registry entry. Then, when the map
control is initialized at runtime, MapX will query the following registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX 5.0\<value of Map.GeoDictionary>
The value of this registry entry will be interpreted as detailed above. The default value of
Map.GeoDictionary is "GeoDictionary" so that MapX will use the default registry entry.
The Geodictionary Manager always reads and updates the default Geodictionary file, referred to by
the registry key HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX 5.0\GeoDictionary. If you
change the location of the Geodictionary file in the user interface, then the registry key is updated to
point to that new location.
The Geodictionary contains an entry for each registered table (mapinfo .tab file). The data stored with
each entry is:
• A user-friendly name to refer to the table and to display in the layer control dialogs. This
defaults to the ‘Description’ tag in the .tab file, or the file name if none exists. It can be edited
through the user interface.
• A list of indexed fields. The user interface allows you to check which of the indexed fields
you want MapX to consider as possible columns to match against during automatic
databinding. Fields that are not checked are ignored. When a table is first registered, all
indexed fields are initially checked by default.
• A refining table name. Some tables, e.g., US Counties, contain indexed columns that are not
unique. In that situation, a refining table is necessary to determine an exact match for data. If
the table has non-unique indexed columns, the refining column combo box will be enabled
and the user will be able to pick a refining table.
• A list of Geoset file names. When a table is selected during automatic databinding, the list of
geosets for that table is passed to the ResolveDataBind event for the MapX program to choose
one. MapX will pick the first one by default if the event is not handled. Note: The table that
was matched is always loaded, even if it is not in the geoset that gets loaded. Also, it is not an
error to have no geosets listed for a table in the Geodictionary. In that case, only the table is
loaded. Finally, only geoset files that are located in the same directory as the Geodictionary
file can be added to the list.
Part Description
Geodictionary The Geodictionary edit box is a read-only edit box containing the full
path to the Geodictionary that's being managed. This information is
found by looking at the MapX key in the registry. The button (to the
right of the Geodictionary edit box) allows the user to browse for
another Geodictionary to manage. Browsing to another Geodictionary
changes MapX's registry key so that all subsequent MapX sessions will
use the new dictionary. The button also lets you change the default
MapX search path which is stored in the registry key
"HKEY_LOCAL_MACHINEOFTWAREapInfoap X.0earchPaths".
Part Description
Registered tables The Registered Tables list box contains a list of the friendly names for all
tables registered in the Geodictionary.
Register This displays the common file open dialog, with the Files of Type
combo box set to "MapInfo Tables (*.tab)". Copy the table to the data
directory (the directory containing the Geodictionary), or add the
directory containing the table to the data search path. After the table has
been assimilated (either by copying or by adding the directory to the
search path), the Table Properties dialog displays. Users can select
multiple files to register by holding Ctrl/Shift key down while clicking.
In cases of multiple tables being selected, the properties button is
disabled. See the Table Properties Dialog.
Unregister Remove the selected table from the Geodictionary. The Unregister
button will not remove the files from the disk. Users can select
multiple files to unregister by holding Ctrl/Shift key down while
clicking.
Properties Display the Table Properties dialog for the selected table. See the Table
Properties dialog below.
Set the Geodictionary fields for a given table using the Table Properties Dialog.
MapInfo Table Read-only edit box containing the file name of the MapInfo table if it is
located in the same directory of the Geodictionary, or the full pathname
to the file if it is not.
Description Provides a mechanism for changing the friendly name for the table.
This control is defaulted to the Description tag in the .TAB file, or the
filename if the Description tag is not found, but can be changed by the
user. Note that changes to the description in the Geodictionary
Manager will only be stored in the Geodictionary and will not be
reflected in the table. This allows the Geodictionary Manager to easily
work with read-only data, e.g., data on CD-ROMs.
Geometry The Geometry static text control displays the type of entities stored in
the table.
Field Information Contains a list of the indexed columns in the table. If the box for a given
column is checked, the field will be searched during the matching
process.
Refining Table Some tables, e.g., US Counties, contain indexed columns that are not
unique. In that situation, a refining table is necessary to determine an
exact match for data. If the table has non-unique indexed columns, the
refining column combo box will be enabled and the user will be able to
pick a refining table.
Candidate Geosets List of the geoset file names that are possible candidates to load if the
MapInfo table was selected during databinding. Zero or more geoset
filenames can be listed. When the table is selected during automatic
databinding, the list of geosets for that table is passed to the
ResolveDataBind event for the MapX program to choose one. MapX
will pick the first one by default if the event is not handled.
Please note:
The table matched is always loaded, even if it is not in the geoset that
gets loaded.
It is not an error to have no geosets listed for a table in the
Geodictionary. In that case, only the table is loaded.
Only geoset files that are located in the same directory as the
Geodictionary file can be added to the list.
Multiple candidate geosets can be added or removed
Add This displays a list box containing a list of the geoset file names that are
in the same directory as the Geodictionary file. Selecting one adds it to
the list of candidate geosets.
Remove Deletes the selected geoset file name from the list of candidate geosets.
geosetpath The path to a geoset file containing a list of tables. Currently a path is
required; just specifying the filename is considered an error.
• Use the geosetpath option to register all of the valid .tab files in the geoset
with the Geodictionary. (Raster, Seamless, and View tables in the geoset
will be ignored.)
• Use the geosetpath /remove option to unregister all of the valid tab files
in the geoset from the Geodictionary.
tablepath The path to a MapInfo table to add to the Geodictionary (the option with no
arguments).
• Use the tablepath option to register a file with the Geodictionary.
• Use the tablepath /remove option to unregister a file from the
Geodictionary.
geosetfile The file name only of a geoset file located in the same directory as the
Geodictionary file.
• Use the tablepath /geoset=geosetfile option to register a file with the
Geodictionary and add geosetfile to its list of candidate geosets to match.
• Use the tablepath /geoset=geosetfile /remove option to remove geosetfile
from its list of candidate geosets to match.
commandfilepath The full pathname of a text file that contains a valid migm30 command line
on each line of the file.
• Use the /file=commandfilepath option to process a text file of command
lines, with 1 command line on each line of the file. Do not include
‘migm30.exe’ on each line of the file.
• Use the /file=commandfilepath /remove option to process a text file of
command lines, with 1 command line on each line of the file. The /remove
option will be added to each command line before it is executed. Do not
include ‘migm30.exe’ on each line of the file.
Paths or filenames with spaces must be enclosed in double quotes. Wherever possible, the command
line usage of the Geodictionary Manager will run silently.It is not an error to attempt to register a file
more than once. It is not an error to unregister a table that is not currently registered.
Note: In the trial version of MapX, the Geoset Manager will only function on the developer’s
machine.
2. Select the geoset you want and click Open. That geoset displays.
From here you can alter a variety of layer settings using items in the Map Menu or View Menu. You
can also insert other geosets to display with the current geoset. Then, save these new settings to the
existing geoset or SaveAs to create a new geoset. We will discuss these items in detail in the following
sections.
Creating a Geoset
1. Choose File > New Geoset. The Layer Control dialog displays.
2. Click Add to display the Open dialog.
3. Select the layers you want to use as a part of your geoset. Hold down the Ctrl key while
selecting to mark several layers. The selected layers display in the Layer Control dialog.
From here you can set display and label properties, reorder the way in which layers display,
remove or add additional layers and set whether layers are visible, contain automatic labels,
or are selectable. See the description of Layer Control in a following section, below. You can
edit these properties later after displaying the initial geoset.
4. Click OK to display the geoset. Your newly created geoset displays.
Use the information in the sections that follow to manipulate and customize the layers in your geoset.
When you have finished creating your geoset you'll need to save it.
To save your geoset:
1. Choose File > Save. The Save As dialog displays.
2. Enter a name and click Save to save the layers with the attributes you specified.
Zoom In
Use the Zoom In tool to get a closer area view of a map or a layer.
1. Choose Map > Zoom In, or click the Zoom In button on the menu bar, or right click the mouse
in the Geoset Manager window and choose Zoom In.
The Zoom In mouse icon appears.
2. Click the Zoom In cursor on the center of the area you want to zoom in on, magnifying the
area by a linear factor of two. This point will be at the center of the map in the zoomed in
view. Repeat this procedure until you have the appropriate level of enlargement.
To zoom in on a rectangular area:
1. Choose Map > Zoom In, or click the Zoom In button on the menu bar, or right click the mouse
in the Geoset manager window and choose Zoom In.
The Zoom In mouse icon appears.
2. Draw a marquee in the map or layout by diagonally dragging the Zoom In mouse icon. The
area within the marquee is enlarged.
Zoom Out
Use the Zoom Out tool to get a wider area view of a map or a layer.
1. Choose Map > Zoom Out, or click the Zoom Out button, or right click the mouse in the
Geoset Manager window and choose Zoom Out.
The Zoom Out mouse icon appears.
2. Click the Zoom Out mouse icon on the center of the area you want to zoom out on, enlarging
the area by a linear factor of two. This point will be at the center of the map in the zoomed-
out view. Repeat this procedure until you have the appropriate level of magnification.
To zoom out from a rectangular area:
1. Choose Map > Zoom Out, click the Zoom Out button, or right click the mouse in the Geoset
Manager window and choose Zoom Out.
The Zoom Out mouse icon appears.
2. Draw a marquee in the map or layout by diagonally dragging the Zoom Out mouse icon. The
area within the marquee is reduced, allowing more of the map to display.
Pan
Use Pan to reposition a map within its window.
To move or adjust the map display:
1. Choose Map > Pan, or click the Pan button, or right click the mouse in the Geoset Manager
window and choose Pan.
The Pan mouse icon appears.
2. Click an area of the map.
3. While holding down the left mouse button, drag the map in the appropriate direction. When
you release the mouse button, Geoset Manager redraws the map in its new location.
Zoom To
Zoom to a particular X and Y coordinate on the map and set a zoom level.
Choose Map > Zoom To.
The Zoom To dialog displays.
2. Choose a specific layer or All layers to display. Click OK to view the layer(s).
Layer Control
Use the Layer Control dialog to:
• Change the display of map layers in the active window
• Determine which layers are displayed, removed, added, selectable, zoom layered, labeled
and set
• Change the order of map layers.
To access Layer Control:
• Choose Map > Layer Control, click the Layer Control button, right click the mouse over the
map and choose Layer Control or create a new geoset.
The Layer Control dialog controls how maps display. Some important information includes:
• The Layer Control dialog displays the list of layers in the current map window and indicates
whether each is displayed, selectable, or labeled automatically.
• Layers include data tables, raster images, or thematic maps stacked in a map window.
• The order of layers in the Layer Control dialog is the order of the layers in the map window.
For example, when boundary layers are placed below point layers, the points remain visible.
• To work with a layer, choose it by clicking on it. Control its settings by checking or clearing
the appropriate box to make the layer display, selectable, or label automatically.
Part Description
Display Mode
Part Description
Zoom Layering
Part Description
Display within zoom range Check to activate zoom layering. Zoom layering allows you to set the
minimum and maximum distances at which the selected layer will be
visible. For example, if you only want to see particular streets on a map
when you are closer than 3 miles, set the minimum zoom to 0 and the
maximum to 3.
Min Zoom Specify the minimum distance at which the selected layer is visible.
Max Zoom Specify the maximum distance at which the selected layer is visible.
Automatic Labeling
To automatically label a layer in a map using information from that layer:
1. From the Layer Control dialog, choose the layer you want to label; check the Automatic
Labels check box.
2. Click OK.
The map redisplays with labels from the table column designated in the Label with section of the Label
Options dialog if a dataset is loaded and a field from that dataset is specified.
Only one column per table displays at one time.
Access the Label Properties dialog to change the visibility, content, font, text color, line style, and
position of labels.
Part Description
Label With: Choose the Dataset and Field name that you want to be reflected in the
label.
Visibility:
On Check to allow display of labels.
Off Check to prevent display of labels.
Display within range Check to activate zoom labeling. Zoom labeling allows you to set the
minimum and maximum distances at which the labels will be visible.
For example, if you only want to see particular labels on a map when
you are closer than 3 miles, set the minimum zoom to 0 and the
maximum to 3.
Label size does not change with zoom or scale changes.
Min Zoom Specify the minimum distance at which labels are visible.
Max Zoom Specify the maximum distance at which labels are visible.
Allow duplicate text Check to place the same label on a map more than once.
Allow overlapping text Allow more than one object with the same text to be displayed.
Maximum labels Enter the maximum number of labels that will display; labels are
selected from the designated table in the order in which they are
entered in the table. For example, if the designated table is the States
table, and you enter 10, the first ten states listed in the table, which are
in view, will be labeled.
Styles:
Text Style button Click the Text Style button to display the Text Style dialog. See Text
Style Dialog.
Label Lines Select a line type, or no line type, to attach the label to the anchor point.
None Do not display a line with the label.
Simple Create a callout by using a simple line that connects the label to the
object's centroid. Label lines display after you move the label from
where it was originally created.
Part Description
Arrow Create a callout by using an arrow line that connects the label to the
object's centroid. Label lines display after you move the label from
where it was originally created.
Position:
Anchor Point Click an icon to select the label position relative to the label anchor. The
diamond character represents the label anchor; the rectangle represents
the label. The border of the selected box is bold.
Rotate label with line Check to rotate text to run parallel with line segments. This setting is
ignored for points regions.
Label Offset Designate number of points (a measurement of text size) label should
be placed from the anchor point.
Projection
How do you flatten the curved surface of the earth so that you can draw maps on flat pieces of paper
and (nearly) flat computer screens? You use a projection. A projection is a system that defines how to
flatten objects. You can display your maps in many different projections.
When you transfer objects from the spherical world to the relatively flat computer screen, there is
bound to be some distortion.
A projection is a method of reducing the distortion that occurs when objects from a spherical surface
are displayed on a flat surface. There are many different types of projections, each designed to reduce
the amount of distortion for a given area.
To choose a projection:
Choose Map > Projection, or right-click the mouse over the map and choose projection.
Toolbar Displays
To show or hide the Map Toolbar, Geoset Name Toolbar, or the Status Bar, check or clear the menu
options as appropriate.
Options
Use the Options dialog to set the distance units and the numeric coordinates used by the map.
To set options choose View > Options. The Options dialog displays.
Part Description
Distance Units Choose the measure of distnace used for the map.
Numeric Coordinates Choose the numeric coordinates the Geoset Manager will use to find
the X and Y coordinates. A coordinate system is a set of parameters that
tells you how to interpret the locations coordinates for objects. Each
point in a geometric object is represented by a pair of numbers. Those
numbers are the coordinate for those points.
When a map first appears on the screen, the Drilldown layer looks like an ordinary map layer. For
example, this Drilldown layer shows sales territories.
If the user selects a Drilldown tool and clicks on a feature in the map, that feature is replaced by
numerous smaller regions. For example, if you click on a sales territory, the territory feature is replaced
by the state boundaries that make up the territory. Clicking is basically a way of requesting, “Show me
more detail about this part of the map.”
Depending on how the application and the Drilldown layer were set up, the user might be able to drill
down repeatedly. With each successive click, the map can display more detail about the area where the
user clicked. Clicking on a state boundary might reveal the county boundaries that make up the state.
To reduce the amount of detail displayed, the user can select a different tool (a "roll up" tool), and click
on the detailed area. The smaller, detailed regions are replaced with a larger region—essentially,
undoing the drill-down action.
A Drilldown layer is built from a set of tables. You need to provide one table for each “level” in the
drill-down hierarchy, plus one special table that defines how the various levels are related
hierarchically. However, the complexity of a Drilldown layer is hidden from the user. The Drilldown
layer appears in a MapX map as a single layer. If the user displays the Layer Control dialog box, a
Drilldown Layer appears as a single item in the list of layers.
Note: The Drilldown table is "empty" in that it contains no permanent data of its own (except for
metadata). When you display a Drilldown layer in a map, MapX creates a temporary table,
and then copies features from the component table(s) into the temporary table. The features
that appear in a Drilldown layer are actually copies of features in the component table(s).
When the MapX application terminates, the temporary table is discarded, and all that
remains of the Drilldown table is the .tab file.
• The Drilldown table must include the \IsDrilldown key, and this key's value must be True.
• Every key begins with the character "\" (backslash).
• Metadata keys can be nested hierarchically. Each level in the hierarchy is marked by a
backslash (\) character. Key values are limited to 239 characters.
• The Drilldown table includes a \DDMap\ComponentMaps\ key hierarchy. Within this
hierarchy, you specify four metadata keys for each component table:
File A required key that identifies the path and filename of a component
table.
LevelID A required key that defines an identifier for this component table.
Example: You might use “States” as the key value if this table contains
state boundaries. When calling a method such as DrilldownReset, pass
“States” as the level argument.
FeatureIDCol Identifies the number of the column in the component table that
contains unique drill-down keys. Optional key; if omitted, column
number 1 is used.
FeatureCaptionCol Identifies the number of the column in the component table which
should be used for labeling. Optional key; if omitted, column number 1
is used.
For example, the “Sample Drilldown Table” includes key hierarchies such as
“\DDMap\ComponentMaps\One\LevelID” and “\DDMap\ComponentMaps\Twox\LevelID”.
Note that DDMap, ComponentMaps, and LevelID are standard, required portions of the key
hierarchy, while One and Twox are customizable. You can use any key names you like instead of One,
Twox, Twoxx, etc.; those key names serve no purpose other than to differentiate each component
table's set of keys.
Within the \DDMap\HierarchyManager\ key hierarchy, there are three additional keys:
Key Description
IsDLL Not used in version 4; reserved for future use. Boolean indicator;
“TRUE” means that this Drilldown layer uses a DLL as the hierarchy
manager.
ID Not used in version 4; reserved for future use. The name of the DLL, or
the GUID to CoCreate.
InitialLevel The initial component table to display when first loading/displaying
the Drilldown layer. Optional key; it is acceptable to have an empty
Drilldown layer.
Related Constants
The set of CursorConstants includes two constants (miDrilldownExpandCursor and
miDrilldownContractCursor) specifically designed for Drilldown/RollUp tools. Use these constants
with the Map.CreateCustomTool method.
Note: MapX 5.0 does not support opening SpatialWare 3.0 (or lower tables).
You may upload a MapInfo point table like CITY_125 to MSAccess or SQL Server using MapInfo
Professional in the MI Upload MBX (located in the Tools directory of MapInfo Professional).
Oracle Support
You can install Oracle8i Spatial in addition to the MapX ODBC Connectivity component. Oracle8i
Spatial is a relatively new implementation of a spatial database from Oracle Corporation. Although it
has some similarities to the previous Oracle SDO implementation, it is significantly different. Oracle8i
Spatial maintains the Oracle SDO implementation via a relational schema. However, MapInfo does not
support the Oracle SDO relational schema. MapX does support simultaneous connections to Oracle8i
via OCI and to other databases through ODBC. MapX does not support Oracle8i spatial geometry
tables via ODBC using the current ODBC drivers from Merant.
Note: If Oracle 8.16 is Installed, all inserts/updates to any Oracle Spatial table will be in Oracle
8.16 format. Therefore, all tables should be migrated to version 8.16 format using the
Oracle 8.16 Spatial data migration utility before any MapX edits are made.
Geometry Conversion
The table below describes the translation from MapInfo Spatial Objects to Oracle8i Spatial
(SDO_Geometry).
The table below describes the translation from Oracle8i (GTYPES) to MapInfo Spatial objects.
Centroid Support
MapX will use the SDO_POINT as the centroid value for polygons. This centroid feature is used
to position labels, and also affects the tool selection of the object. The Oracle
SDO_GEOMETRY.SDO_POINT_TYPE field (if not NULL) will be interpreted as the feature
centroid if the point exists inside the region. If the point exists outside of the region, its centroid
will be calculated as always.
Note: There is currently no method or tool in MapX to set the centroid of a region feature, but
one may read and use a stored centroid.
Additional Information
The following sdo_geometry values are not translateable to/from MapInfo objects format
without data loss and therefore some geometry details can be lost if updated.
• GTYPE 0 - User defined/unknown geometry
Keyword Description
DLG= A number that controls the display of the connection dialog box:
0 – Suppresses the connection dialog (required for MapX Theme).
1 – Displays the connection dialog.
2 – Displays the connection dialog, but only if needed (i.e., if not all
required information was provided) [default].
Note: Does not apply to Oracle Spatial
DSN= Specifies the ODBC data source name.
Caution: If you use the DSN= syntax key, the name that you specify must
match the data source name in use on the user’s system. Note that
different users might use different names to refer to the same data source.
If you cannot know in advance what data source name to use, use the
DRIVER= syntax key instead of the DSN= syntax key.
Note: Does not apply to Oracle Spatial
DRIVER= Specifies the exact driver name of the installed SpatialWare or IUS/UDO
driver. Used instead of the DSN= syntax key. Examples:
DRIVER={SpatialWare 32 Bit Driver}
Note: Informix 2.80.0861 does NOT support DRIVER=.
Also, it does not apply to Oracle Spatial.
UID= Specifies the desired UserId for the data source, if required.
PWD= Specifies the user’s password for the data source, if required.
Passwords do not need to be in the connection string for the two strings to match. If two tables are in
the same database, the connection string will be the same.
Note: Connection attributes/parameters no longer have to be in order and one may use a dialog
to get a connection from an existing connection pool to avoid redundant connections. That
is, in previous versions of MapX, if you used a dialog each time to connect to the same
database, or if you did not order the connection keywords in the connection string in the
documented order, the connection would not be shared and you would get multiple
connections.
Keyword Description
SRVR= Reflects a value the service name for the server set in the Oracle8i Net8
EasyConfig utility. This is required for Oracle8i connectivity, but does not
apply to ODBC connections.
UID= Specifies the desired UserId for the data source, if required.
PWD= Specifies the user’s password for the data source, if required.
Example
Select OBJECT from rdbsdata
Select sw_geometry from rdbsdata
select sw_member, ST_Buffer(geometry, 66.0, 0.1) from rdbsdata a
geometry function
Select st_geometry(st_point(72.5, 42.5.)) from rdbsdata a geometry
constructor
Note: The key column does not need to be specified in the query in most cases.
MapX will look up and determine the best key column(s) to use in order to uniquely reference a row in
the result set, and then add them to the query if they are not present. In most cases. This will be the
primary key/unique index.
Example
Select customer_id prinx, object, from customer_view
The column alias “prinx” is used to identify and use the customer_id column as the key column for the
layer. You can alternately alias the desired key column in the create view statement to identify the key
column automatically for any query on that view.
Example
Create view customer_view as select customer_id prinx, geloc from
customer
In general, if a column name or column alias of prinx, or mi_prinx is found in the result set, that
column is used as the key column for the layer. This enables the application/query writer to specify
the key column they desire.
Note: You can use any server side expression/function to specify a column. Also, avoid select *
from tab in a real application.
The following code example will open a MapInfo *.tab file, then access the remote data and tie it to the
layer. You now can label or place themes based on the columns.
Dim Lay As Layer
Dim dsname As String
Set Lay = Map1.Layers.Add(filename)
dsname = Lay.Name
Map1.Datasets.Add miDataSetLayer, Lay, dsname
Performance Issues
Establishing a connection with the database server may take several seconds. This is a one-time cost,
incurred when the table is first opened.
An ’open’ operation may take several seconds as well. This one-time cost is incurred every time a new
table is opened.
The map-display speed depends on how much data is retrieved from the server. In some cases,
displaying a map from a server is noticeably slower than displaying a map from a local file. Speed also
depends on whether MapX has already cached the map features that are being displayed.
Parameter Description
OFF A value of 'Off' means that the layer will not use the cache at all. All data operations
will go directly to the database server.
Parameter Description
ON A value of 'ON' for the LayerInfo CACHE parameter means that MapX will maintain
the record cache in a fashion that best improves standard MapX operations. The
cache is maintained to contain, at a minimum, all the records displayed for the layer,
which appear in the MBR of the current map window. Once the initial map window
MBR has been cached, pan and zoom operations which fall entirely within the initial
extents of the cache will access the cached records and will not need to query the
database. If a pan/zoom operation falls outside the cached region, MapX will add the
new map window MBR (view) to the cache and obtain the missing records from the
database server and add them to the cache.
The old map view is not initially discarded; rather, an internal history of previous
map views is maintained. To avoid having a cache that grows excessively large, there
are controls that can be placed on MapX to determine when to discard old cached
views (map window MBR regions). These controls are parameters of the LayerInfo
object which can be set at the time the layer is initially added and allow the developer
to set limits on the maximum amount of memory or disk space used by the cache, the
maximum number of previous map window views to maintain in the history, the
maximum number of records to maintain in the cache, and/or the maximum amount
of time old map window views are allowed to remain in the cache history. These
limits can be used individually or in combination to provide the cache management
that best suits the application's needs.
See the LayerInfo Object on page 412 for specific parameter names, default values,
and available settings.
NOTE: The default values for these limits are set to provide consistent behavior with
older versions of MapX, that is, the maximum number of previous map views
maintained in the cache's history (not including the current map view) is defaulted to
zero.
Parameter Description
USER A value of USER for the LayerInfo CACHE parameter means that MapX will create a
cache, but the only records that will be placed in the cache are those specified by the
application developer. The mechanisms available for specifying which records are
placed in the cache are BoundConstraint, FeaturesConstraint, and
AllFeaturesConstraint objects. The word constraint implies that these objects are
constraining the cache to include the specified records. The BoundsConstraint object
(see BoundsConstraint object on page 285) can be used to place all records into the
cache for which the MBR of the feature intersects the MBR of the constraint.
A FeaturesConstraint object (see FeaturesConstraint object on page 322) can be used
to add specific records to the cache. For example, if an analysis is going to be
performed that involves multiple steps and/or reads of the Feature or RowValues of
the feature, possibly on a set of features returned from a Layer.Search,
Layer.SearchWithinDistance, etc, it may be advantageous to place these records into
the local cache for the duration of the analysis and remove them when finished. The
FeaturesConstraint provides this capability. If an application is going to perform an
analytically intensive operation that may hit every record, it may be desirable to
temporarily cache the entire set of data for the layer. This may be accomplished by
using the AllFeaturesConstraint (see AllFeaturesConstraint object on page 272).
These cache constraint objects may also be used when the cache is set to ON. In this
case, they may add records to the cache but have no effect on the cache's history of
previous map window views. The constraint objects may be used when the cache is
set to OFF or ALL in which case they have no effect.
NOTE: The constraint objects have no effect on non-server layers.
ALL ALL means that MapX will cache the entire table one time and not need to add and
remove records on a draw-by-draw basis. Small tables that are accessed very
frequently are good candidates for this type of option.
*TIP: The entire cache can be refreshed from the database through the use of the Layer.Refresh method
[see Layer.Refresh method (Layer object) on page 395]. This will refresh the data in the current view
and any currently allocated constraint objects and will eliminate all other cache history.
Note: If you try to cache too much data or too many layers, virtual memory usage may be forced,
and performance gain could be lost.
Note: MapX supports the storage of style informaton for individual features in remote
databases. Therefore, layers get their styles from the Map Catalog.
2. Create the table MAPINFO_MAPCATALOG in the database. The Create Table statement
needs to be equivalent to the following SQL Create Table statement:
Create Table MAPINFO_MAPCATALOG (
SPATIALTYPE Float,
TABLENAME Char(32),
OWNERNAME Char(32),
SPATIALCOLUMN Char(32),
DB_X_LL Float,
DB_Y_LL Float,
DB_X_UR Float,
DB_Y_UR Float,
COORDINATESYSTEM Char(254),
SYMBOL Char(254),
XCOLUMNNAME Char(32),
YCOLUMNNAME Char(32),
RENDITIONTYPE INTEGER,
RENDITIONCOLUMN CHAR(32),
RENDITIONTABLE CHAR(32)
)
Note: It is important that the structure of the table is exactly like this statement. The only
substitution that can be made is for databases that support varchar or text data types; these
data types can be substituted for the Char data type.
3. Create a unique index on the TABLENAME and the OWNERNAME, so only one table for
each owner can be made mappable.
4. Grant Select, Update, and Insert privileges on the MAPINFO_MAPCATALOG. This allows
users to make tables mappable. The delete privilege should be reserved for database
administrators.
Per-Record Styles
Per-record style support brings a feature to spatial database implementations that has long been
available in MapInfo TAB files. Specifically, it allows each geometry in a single layer to have its own
style. For example, a single 'public institution' layer in Oracle8i Spatial can have schools, town halls,
libraries and police departments and each point type would be represented with its own symbol (i.e. a
school symbol for all the schools). Similarly, a single road layer in SpatialWare SQL Server may have
different road types such that streets are shown as a single pixel black line, secondary roads as a
double pixel red line and interstates as parallel red lines.
Note: If these columns are not present, object styles will continue to work as before (e.g. the
table’s default style will be applied to all objects) with one exception which is discussed
below. If these columns are present in the Map Catalog, they will be used as follows:
Known Limitations/Requirements
When using layers that specifically request the style column, you may experience difficulty updating
existing features (or other row data values) and inserting new records. The reason for this is that MapX
automatically adds the style column to the INSERT/UPDATE statements as necessary, and may, for
layers which do not have a hidden style column, generate SQL statements which specify the column
name twice.
Troubleshooting
If you encounter problems with your MapX SpatialWare applications, use the following table to help
analyze and solve the problem.
The MapX "Layer is not Data binding was attempted Data binding is not currently
matchable." against a SpatialWare layer. supported for SpatialWare layers.
No object was found using the A query was made against a Check that the table name is correct
index that you specified. table that does not exist. and in the proper case. Also, the
No spatial object is contained table may need to be mappable.
in the result of the spatial Use the EasyLoader Upload utility
query. to make the table a mappable table.
A query was made against a Check the query for possible syntax
non-spatial table. errors. Also make sure that the result
of the query includes the field
specified in the spatial column in the
MapInfo_MapCatalog.
MapX datasets.rowcount has The dataset was created from a MapX datasets.rowcount will
the value of zero. DBMS server. always have a value of zero for
datasets created from a DBMS
server. Use the layer’s
AllFeatures.Count property
Map appears to have incorrect The MBR for a DBMS layer is Edit the extents (DB_X_LL,
zoom level. For example, the determined by the DB_X_UR, DB_Y_LL, DB_Y_UR) in
map may be zoomed out too MapInfo_MapCatalog table. the MapInfo_MapCatalog using the
far to identify any geography. The table extents in the MapInfo Professional MDX tool,
MapCatalog result in a MISETMBR.MDX.
different zoom level than the
one you desire for your output.
The dialog is automatically initialized, so that the highlighted description describes the CoordSys
object. If the user clicks OK in the dialog, the method returns True, and the CoordSys object is updated
to match the coordinate system chosen by the user.
To display the dialog box at design time:
1. Right-click the Map control.
2. Choose Properties from the shortcut menu.
3. On the General tab, click the Projection button.
MapX displays the same Choose Projection dialog, which is invoked by the PickCoordSys method.
Example (PickCoordSys)
The following statement displays the Choose Projection dialog at run time, allowing the user to change
the coordinate system in which the map is displayed.
Map1.DisplayCoordSys.PickCoordSys
Projection Datum Units Origin Origin Std. Std. Azim. Scale False False Range
Long. Lat. Par. 1 Par. 2 Fact. East. Nor.
Albers Equal- X X X X X X X X
Area Conic
Azimuthal X X X X* X
Equidistant
Cylindrical Equal X X X X
Area
Double X X X X X X X
Stereographic
Eckert IV X X X
Eckert VI X X X
Equidistant X X X X X X X X
Conic
Gall X X X
Hotine Oblique X X X X X X X X
Mercator
Lambert X X X X* X
Azimuthal
Equal–Area
Lambert X X X X X X X X
Conformal Conic
Longitude– X
Latitude
Mercator X X X
Miller X X X
Mollweide X X X
New Zealand X X X X X X
Map Grid
Robinson X X X
Sinusoidal X X X
Stereographic X X X X X X X
Projection Datum Units Origin Origin Std. Std. Azim. Scale False False Range
Long. Lat. Par. 1 Par. 2 Fact. East. Nor.
Swiss Oblique X X X X X X
Mercator
Transverse X X X X X X X
Mercator
Regional X X X X
Mercator
Polyconic X X X X X X
Cassini - Soldner X X X X X X
* MapX supports the Azimuthal Equidistant and Lambert Azimuth Equal-Area projections in the
polar aspect only. The Origin Latitude for these projections must be either 90 or -90.
Part Description
Description A string that describes the coordinate system. This description appears in
dialog boxes.
Type A number that usually matches one of the CoordSysTypeConstants
exactly. Users may have customized this number in two ways: To specify
an Affine Transformation, the user adds 1000 to this number; to specify
bounds, the user adds 2000 to this number.
Datum A number representing one of the Datums supported by MapX, or a
special number (999 or 9999) indicating a custom datum.
Units [Set of 4 Custom Optional; applies only if the Datum number is 999.
Datum Arguments]
[Set of 9 Custom Datum Optional; applies only if the Datum number is 9999.
Arguments]
Set of Projection From zero to 8 parameters, depending on which Type is specified. Refer to
Parameters Summary of Parameters Used by Coordinate Systems", to see which
parameters are used by this Type.
[Set of 7 Affine Optional; applies only if the Type number is exactly 1000 or 3000 greater
Transformation than a CoordSysTypeConstant.
Parameters]
[Set of 4 Bounds Optional; applies only if the Type number is exactly 2000 or 3000 greater
Parameters] than a CoordSysTypeConstant.
MAPINFO.PRJ Example
Open MAPINFOW.PRJ in a text editor, or in a word processing package.
Note: MapX uses this file when interpreting and setting the map coordinate system. Make a
back up of this file prior to making any changes.
Within MAPINFOW.PRJ, search for the name of a MapInfo projection, such as "Robinson". The
line that you find contains the definition for the Robinson projection:
"Robinson", 12, 62, 7, 0
This line tells us several things about the Robinson coordinate system:
• The string at the start of the line is a description. The first number after the description, 12 in
this example, tells you what type of coordinate system applies. Check the number 12 against
the table of MapX CoordSysType constants, and you'll see that type 12 matches the MapX
constant, miRobinson. (In this case, the description made it obvious that the coordinate
system uses a Robinson projection; but in other cases, the projection might not be obvious.)
• Refer to "Summary of Parameters Used by Coordinate Systems" to see which parameters
are used by Robinson maps. Robinson maps use only three parameters: datum, units, and
origin longitude. Now you know how to interpret the rest of the numbers on the line: 62 is
the datum number, 7 is the unit number, and 0 is the Origin Longitude. From the list of
datums supported by MapX, you can determine that datum 62 represents NAD 27 for the
continental US.
• From the table of MapUnit constants, you can determine that unit type number 7 matches the
value of the MapX constant, miUnitMeter.
You can use this set of values (12, 62, 7, 0) as the parameters when calling the CoordSys.Set
method. For example:
objCoordSys.Set 12, 62, 7, 0
Note: If you simply want to rotate the map, you do not need to specify an affine transformation.
Instead, set the Map object's Rotation property.
An affine transformation has the following form:
x' = Ax + By + C
y' = Dx + Ey + F
In these equations, the base coordinates (x, y) are transformed to produce the derived coordinates (x',
y'). The six constants A through F determine the effect of the transformation, as follows:
What Is a Datum?
A datum is a mathematical description of the earth’s shape and orientation. Because the earth’s shape
is not uniform, there are many different local datums used in different parts of the world. These local
datums provide a close approximation to the earth’s surface in a particular area.
Each Earth coordinate system uses a specific datum to approximate the earth’s surface. If two
coordinate systems use different datums, then mapping software must perform a datum
transformation when it converts coordinates from one coordinate system to the other. MapX and
MapInfo use the Bursa-Wolfe datum transformation method, which is generally accurate to within 10
meters. (When MapInfo converts between two coordinate systems that use the same datum, no datum
transformation is performed, and the results are generally accurate to within 0.1 meter.)
Datum Conversion
When converting coordinates from one datum to another, MapX has used the Molodensky (3-
parameter) and Bursa-Wolfe (7-parameter) methods. These are general-purpose methods that can
convert coordinates from any datum to any other datum.
After the NAD 83 datum was introduced, NOAA developed a program called NADCON, which
stands for North American Datum CONversion. This is a very specialized program that converts
coordinates only from NAD 27 to NAD 83 and vice versa. For this specialized task, it’s much more
accurate than the Molodensky general-purpose method; NADCON is accurate to about 0.1 meter, and
Molodensky is accurate to only 10-30 meters. Most U.S. government agencies, including the Census
Bureau, have standardized on NADCON for converting between NAD 27 and NAD 83.
Beginning with MapX 3.5, the NADCON algorithm is used to convert coordinates between NAD 27
and NAD 83 if those coordinates lie within the areas covered by NADCON (United States, Puerto
Rico, and the Virgin Islands). If the coordinates lie outside those areas, or if they use datums other
than NAD 27 or NAD 83, MapX uses the Molodensky or Bursa-Wolfe conversion methods.
Due to the file access required, the NADCON method can be slightly slower than the Molodensky
method. If you want to turn off the NADCON method, add a “NADCON” entry to the registry. The
registry entry should have this path:
• HKEY_LOCAL_MACHINE\Software\\MapInfo\\MapX\\3.0\NadCon
If this entry is set to zero, then the Molodensky conversion method will be used instead of NADCON.
To enable NADCON, set the entry to 1 (default). MapX reads this entry when it is loaded, and all maps
use the same setting. You can't turn NADCON on or off for a particular map.
Related Pamphlets
• American Cartographic Association. Choosing a World Map—Attributes, Distortions,
Classes, Aspects. Falls Church, VA: American Congress on Surveying and Mapping. Special
Publication No. 2. 1988.
• American Cartographic Association. Matching the Map Projection to the Need. Falls Church,
VA: American Congress on Surveying and Mapping. Special Publication No. 3. 1991.
• American Cartographic Association. Which Map is Best? Projections for World Maps. Falls
Church, VA: American Congress on Surveying and Mapping. Special Publication No. 1. 1986.
To obtain these pamphlets, please contact:
American Congress on Surveying and Mapping
5410 Grosvenor Lane, Suite 100
Bethesda, MD 20814–2212
301–493–0200
Related Books
• John P. Snyder. Map Projections—A Working Manual. Washington: U.S. Geological Survey
Professional Paper 1395. 1987.
• John P. Snyder and Philip M. Voxland. An Album of Map Projections. Washington: U.S.
Geological Survey Professional Paper 1453. 1989.
To obtain these books, please contact:
Earth Science Information Center
U.S. Geological Survey
507 National Center
Reston, VA 20192
1.800.ASK.USGS -or- 1.703.648.6045
Properties
The Properties of a MapX object are implemented by member functions in the C++ classes. A Read/
write property like the 'Name' property of the Dataset object will have 2 member functions in
CMapXDataSet—one to set the property value, and one to get the value of the property. The member
function names will have 'Get' or 'Set' prepended to the property name.
CString GetName();
void SetName(LPCTSTR);
A read-only property will only have a 'Get' member function, and not a 'Set' member function.
Methods
The methods of a MapX object are implemented by a member function with the same name as the
MapX object's method. You will notice that the types of many of the parameters will be 'const
VARIANT &'. This means the member function is expecting a variable of type VARIANT to be passed
to it.
Optional Parameters
Many methods have parameters that are considered 'optional' in Visual Basic or other scripting
languages. In C++ all parameters must be specified when calling these methods. All optional
parameters are implemented as VARIANTs. To call a MapX method with an optional parameter, you
must set up the variant as follows:
VARIANT vtOptional;
vtOptional.vt = VT_ERROR;
vtOptional.scode = DISP_E_PARAMNOTFOUND;
The MapX.h file includes a helper class COptionalVariant that does this in its constructor. You can use
this whenever you want to call a method with an optional parameter.
Note: Do not choose the Insert > Component command. Doing so would create a .cpp file, but it
would be incomplete.
if (cx != 0 && cy != 0)
m_ctrlMapX.MoveWindow(0,0,cx,cy,TRUE);
}
Create a new message header for the WM_SETFOCUS message as you did for the WM_CREATE
message.
In our example, we want to make sure that MapX gets the focus whenever the window is active:
void CMapxSampleView::OnSetFocus(CWnd* pOldWnd)
{
CView::OnSetFocus(pOldWnd);
m_ctrlMapX.SetFocus();
}
AddDocTemplate(pDocTemplate);
Add handlers for the MapX menu items. In the sample, these menu items are defined in the menu
section in mapxsamp.rc. Note that in this example, we use menu commands as a quick demonstration
of the map interaction tools (Zoom In tool, Radius Select tool, etc.). In a more polished application, you
would probably use toolbar buttons as the user interface, rather than menu commands.
"Previous &View", ID_CONTEXT_PREVIOUSVIEW
"View &Entire Map", ID_VIEW_VIEWENTIREMAP
SEPARATOR
"&Properties...", ID_VIEW_PROPERTIES
"&Arrow", ID_MAP_TOOL_ARROW
SEPARATOR
"Zoom &In", ID_MAP_TOOL_ZOOMIN
"Zoom &Out", ID_MAP_TOOL_ZOOMOUT
"&Pan", ID_MAP_TOOL_PAN
"&Center", ID_MAP_TOOL_CENTER
SEPARATOR
"&Select", ID_MAP_TOOL_SELECT
"&Radius Select", ID_MAP_TOOL_RADIUSSELECT
"R&ectangle Select", ID_MAP_TOOL_RECTANGLESELECT
Once these menu item IDs are defined, handlers can be added via Class Wizard. In your class
containing the MapX control, create handlers for ID_MAP_TOOL_ARROW,
ID_MAP_TOOL_ZOOMIN, etc.
// tell MapX what the current tool is
void CMapxSampleView::OnMapToolArrow()
{
m_ctrlMapX.SetCurrentTool(miArrowTool);
}
void CMapxSampleView::OnMapToolZoomin()
{
m_ctrlMapX.SetCurrentTool(miZoomInTool);
}
// switch to the previous view
void CMapxSampleView::OnContextPreviousview()
{
m_ctrlMapX.ZoomTo(m_dPrevZoom, m_dPrevX, m_dPrevY);
}
Once the tool is selected, built-in MapX functionality handles the zooming, selecting, etc.
The ON_EVENT macro in the EVENT_SINK also specifies an ID for the MapX control (IDC_MAP in
the example), the parameters to the event, and the name of the event handler method.
In the View header file (her, MapXSampView.h), put the line "DECLARE_EVENTSINK_MAP ()"
below the "DECLARE_MESSAGE_MAP" line.
From mapxsampview.cpp:
BEGIN_EVENTSINK_MAP(CMapxSampleView, CView)
ON_EVENT(CMapxSampleView, IDC_MAP, DISPID_MOUSEMOVE,
OnMouseMoveInMap,VTS_I2 VTS_I2 VTS_XPOS_PIXELS VTS_YPOS_PIXELS)
ON_EVENT(CMapxSampleView, IDC_MAP, MAPX_DISPID_MAPVIEWCHANGED,
OnMapViewChanged, VTS_NONE)
ON_EVENT(CMapxSampleView, IDC_MAP, DISPID_MOUSEUP,
OnMouseUpInMap, VTS_I2 VTS_I2 VTS_XPOS_PIXELS VTS_YPOS_PIXELS)
ON_EVENT(CMapxSampleView, IDC_MAP, MAPX_DISPID_TOOLUSED,
OnToolUsed, VTS_I2 VTS_R8 VTS_R8 VTS_R8 VTS_R8 VTS_R8 VTS_BOOL
VTS_BOOL VTS_PBOOL)
ON_EVENT(CMapxSampleView, IDC_MAP,
MAPX_DISPID_THEMEMODIFYREQUESTED, OnThemeModifyRequested,
VTS_DISPATCH)
END_EVENTSINK_MAP()
The event handler code for the OnToolUsed event follows. The declaration, from mapxsampview.h:
void OnToolUsed(short ToolNum, double X1, double Y1, double X2,
double Y2, double Distance, BOOL Shift, BOOL Ctrl, BOOL*
EnableDefault);
…and the implementation from mapxsampview.cpp (we just output the parameters to the debug
window using the TRACE macro):
void CMapxSampleView::OnToolUsed(short ToolNum, double X1, double Y1,
double X2, double Y2, double Distance, BOOL Shift, BOOL Ctrl, BOOL*
EnableDefault)
{
CString str;
str.Format("Tool=%d, [%f,%f] [%f, %f], dist=%f, %s %s\n",
ToolNum, X1,Y1,X2,Y2,Distance,
(Shift)?"Shift":"",(Ctrl)?"Ctrl":"");
TRACE(str);
}
You would normally handle custom tools in this function, or override MapX's default behavior for
built-in tools. For an example, see “Using Custom Tools”.
Note: For events in which objects are passed as parameters, the event handler should not change
the reference count of the object. For an example, see," Handling MapX Exceptions Using
C++".
style.SetRegionBackColor(255);
// update the feature in the layer
ftr.Update();
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
// place a new symbol at the point clicked on
else if (ToolNum == MAP_TOOL_NEWPOINT) {
try {
CMapXLayers layers = m_ctrlMapX.GetLayers();
CMapXFeatureftr;
// Need the dispatch id to use the feature
if (ftr.CreateDispatch(ftr.GetClsid())) {
// Symbol feature
ftr.SetType(miFeatureTypeSymbol);
// Get the point object from the feature
// and call the Set method
ftr.GetPoint().Set(X1, Y1);
// Add it to the layer
layers.Item("USA").AddFeature(ftr);
}
else {
AfxThrowOleException(CO_E_CLASS_CREATE_FAILED);
}
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
}
//COptionalVariant SecondaryGeoField;
// instead
SecondaryGeoField.vt = VT_ERROR;
SecondaryGeoField.scode = DISP_E_PARAMNOTFOUND;
SetMenuDefaultItem(pMenu->m_hMenu, ID_VIEW_PROPERTIES,
FALSE);
pMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
pt.x, pt.y, this, NULL);
e->Delete();
}
}
/////////////////////////////////////////////////////////////
// CSampleDlg dialog
// Dialog Data
//{{AFX_DATA(CSampleDlg)
enum { IDD = IDD_MAPXDLG };
//}}AFX_DATA
.
:
CMapX m_ctrlMapX;
.
:
};
try {
m_ctrlMapX.SetZoom(1000); // zoom in to 1000 miles
MapX Tools
15 Chapter
Most mapping applications provide an assortment of
tools to aid with common drawing tasks (such as
➤ Overview of Standard Tools
drawing a line on the map) and navigation tasks (such as ➤ Object Editing Tools
zooming in). MapX provides several common mapping
➤ Node Selecting and Editing
tools, plus you can also create your own custom tools.
➤ Creating a Custom Tool
➤ Creating Polygon Drawing
Tools (Polytools)
Chapter 15: MapX Tools
Note: To set which tool is being used, set the Map.CurrentTool property.
The object editing tools add the new feature to whichever layer is specified in the
Layers.InsertionLayer property. There can only be one insertion layer, and the default is none. Setting
the current tool to an object creation tool when there is no insertion layer results in an error.
MapX also supports modification of existing map features. To edit features, the Layer.Editable
property must be set to true for any layers that you wish to change. Then, the built-in Arrow tool can
be used to move or resize features in the current selection. To move the selected feature(s), simply click
and drag in the selection. To resize the selected feature(s), click and drag in the edit handles. To delete
the selected feature(s), press the Delete key.
Note: Currently, there is NO TRANSACTION SUPPORT in node editing. Be very careful not to
unintentionally hit the delete key while nodes are selected. At this time, there is no
"Undo".
The table below displays what objects work in Node Edit Mode:
Moving Nodes
When one or more nodes have been selected, they can be moved. To do this, click on a previously
selected node and drag it to a new location. While dragging, a dashed line connecting all of the
currently selected nodes in their new location is drawn. When the mouse button is released, all of
the selected nodes are moved to the new location. If ESC is pressed during the dragging, the
operation is aborted and all nodes return to their original position.
After the move, all of the nodes that were moved remain selected.
Note: If any of the modified objects are poly-polygon and has it's polyids reordered, all of the
nodes will be deselected. For example, if the relative size of the polygons change, then
their order could change, which in turn will deselect all nodes.
Deleting Nodes
When one or more nodes have been selected, they may be deleted by pressing the Delete key.
After the nodes are deleted, there will not be any selected nodes. After nodes have been deleted, if
there are not enough nodes remaining to define an object of its type, the object will be deleted. For
example, a polygon requires 3 or more nodes. If 4 nodes are deleted from a polygon containing 6
nodes, that polygon will be deleted because the 2 remaining nodes can not define a polygon.
A map must stay in "focus" in order to delete nodes. That is, if a user selects a noded object from
an editable layer while the map is in "Node Edit Mode" (one or more nodes are selected) and then,
the user clicks a control (such as a checkbox which toggles the state of delete duplicate nodes), the
map will lose focus. Therefore, when the user presses the delete key (even though the select point
tool is active and the node(s) are selected), the node(s) will not be deleted. In order to make the
delete key function correctly, the application must set the focus to the map (call setFocus) AFTER
the control is activated.
Adding Nodes
To add nodes, the map must be in "Node Edit Mode" and "Add Node Mode". Nodes can only be
added to lines, polylines and polygons. If a node is added to a line, it is automatically promoted to
a polyline. A node can ONLY be added to a selected, editable object. The user must click on the
edge of a line, polyline or polygon object, between 2 nodes. The location of the mouse cursor
when the mouse button is clicked determines which two dashed lines the new node will be
inserted between. The mouse move will display two dashed lines representing the shape of the
new object. The location of the mouse cursor when the mouse button is released determines the
location of the new node. Pressing ESC during the dragging (before the mouse button is released)
will abort the operation and the node will not be added.
Snap To Node
To make node selection and editing easier you can enable MapX Snap To Node functionality. Two
properties of the Map object are used to enable and define this feature. Map.SnapToNodeSupport is
used to turn the feature on or off. Map.SnapTolerance is used to determine the distance in pixels
within which Snap To Node operates i.e. how close or far from a node the cursor must be before it
moves automatically to the closest node.
Constant Behavior
Now that the Ruler custom tool is created, we have to write the code for what the tool actually does.
coordinates, and stores it in the global variable Xdown and Ydown. Xdown and Ydown represent the
start point of our distance measurement.
To capture the end point when the user moves the mouse across the map and stops at another spot, we
write code in the MouseMove event:
Private Sub Map1_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
ToolUsed Event
There are many times when you may want to execute a tool’s code after the tool is used. An example
of this is to allow the user to draw a circle and when the mouse button is released, compute the
number of customers inside that radius. If this is the functionality the tool needs, use the ToolUsed
event of the Map object to place your code.
Standard Polytools
MapX provides a standard polygon selection tool. This tool allows the user to draw a polygon, then
selects all features whose centroids fall within the polygon. Only selectable layers are searched.
Seamless, Raster, and Userdraw layers are ignored.
To activate this tool, set the CurrentTool property to miPolygonSelectTool (value: 1010).
When this tool is used, the PolyToolUsed event is fired. If the user ends the polygon (miPolyToolEnd)
with a double-click, space, or return, the search is performed, and miPolyToolEnd (1) is passed to the
PolyToolUsed event. If the user ends the polygon with the ESC key, the search is cancelled;
miPolyToolEndEscaped (2) is passed to the PolyToolUsed event. The user can delete all nodes of a line
(backspace Delete). When the last node is deleted, it will send a (2) flag.
Custom Polytools
To create a custom polytool, call the CreateCustomTool method, and specify a ToolTypeConstants
value of miToolTypePoly.
To make your custom polytool the active tool, set the CurrentTool property.
Whenever the user selects your custom polytool and uses it on the map, MapX calls the PolyToolUsed
event. Therefore, you need to add code to the PolyToolUsed event procedure to make your tool have
an effect.
Exporting Maps
Often, the user may need to print out a map or
incorporate the visual image of the map in another
Chapter
application. MapX has methods which allow you to send
the contents of a map to the clipboard, to the printer, or to
➤ Methods for Exporting Maps
a graphics file.
➤ ExportSelection Property
➤ Printing Maps
Chapter 16: Exporting Maps
See Also
Map.ExportMap method (Map object) on page 440
Map.MapPaperHeight property (Map object) on page 445
Map.MapPaperWidth property (Map object) on page 446
miFormatWMF Metafile
miFormatBMP Bitmap
miFormatJPEG JPEG image
miFormatTIF TIF
miFormatGIF GIF Image
miFormatPNG Portable Network Graphics
miFormatPSD PhotoShop
ExportSelection Property
Utilizing the ExportSelection property of the map will allow you to control whether the selection
pattern will export with the map. Look at the code sample to how this property property is used:
'Export a jpg image for display and include the selection highlighting
in the image
Map1.ExportSelection=True
Map1.ExportMap "c:\temp\map.jpg", miFormatJPEG
Printing Maps
To print a map, use the PrintMap method. For additional information, please refer to Map.PrintMap
method (Map object) on page 453
Note: The current map is drawn to fit the rectangle given. Best results are obtained when the
aspect ratio of width to height is maintained. This method only prints out the contents of
the MapX map; it doesn’t show any icons, toolbars, or menu items. You may want to print
the form that contains the MapX control if you need to see additional controls on your
output.
Note: If you are using MapX in a dialog with Visual C++, VisualBasic, Delphi, or PowerBuilder
they will take care of creating MapX with the correct license string and therefore you can
skip this section. If you are creating the MapX control using the CMapX::Create() method
in Visual C++ you do need to take this extra step.
The files that are installed with MapX can be divided into the following categories:
Required files:
• MapX DLL and its dependent DLLs
• Windows system files: including fonts, MFC, and OLE dlls
Optional files:
• Dataset drivers (used for databinding)
• Import/Export raster handlers
• Maps and Geosets
Installing MapX
If you have installed MapX on your own computer, it’s easy to get a rough idea of how many files are
used by MapX. MapX v4.x installs the program files under the following path “\Program
Files\Common Files\MapInfo Shared\MapX Common”. MapX v5.0, by default, stores all of the
required files in "\Program Files\MapInfo\MapX 5.0". This directory should be used for the MapX
required files, whereas all of the files necessary for your application should go under a directory
meaningful to the end-user and your specific application.
Note: MapX uses some files that are not located in the MapX program directory. For example,
MapX uses MFC and OLE dlls that reside in the Windows System directory.
We also recommend that the MapX Program directory be: "\Program Files\MapInfo\MapX 5.0".
The following table describes what files need to be installed and where they should be installed to.
Installing Fonts
MapX also uses some TrueType fonts. These font files (*.ttf) must be copied to Window’s Font Folder.
Fonts must also be registered with Windows. If you are using a third-party software package to create
your installer, that package might handle font registration for you. Otherwise, you can register fonts
manually, by calling the Win32 AddFontResource routine. Once a font is properly registered, the
registry contains a corresponding key under:
• HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts
-or-
• HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Note: All of these dataset drivers should be installed in the same directory as MapX.
This table illustrates the various options for data binding and what the installation requirements are.
All of the files below must be registered with ressup32.exe.
Note: All of these raster handlers should be installed in the same directory as MapX.
Here is a table of handlers included with MapX:
Key Description
Note: The GeoDictionary path is used when adding a geoset to the MapX object without
specifying the full path of the Geoset and when using autobinding. In addition, the
SearchPaths key is not necessary if not using the GeoDictionary. See “Installing Maps and
Geosets” to determine whether or not these keys are necessary for your application.
Note: If you are using MapX in a dialog with Visual C++, VisualBasic, Delphi, or PowerBuilder
they will take care of creating MapX with the correct license string and therefore you can
skip this section. If you are creating the MapX control using the CMapX::Create() method
in Visual C++ you do need to take this extra step.
Visual C++
Again, if using MapX in a dialog in Visual C++, you do not need to perform this step.
In order to successfully create the MapX object, you must pass the license string as the bstrLicKey
parameter to CMapx::Create().
Object Properties
• AffineTransform.A, B, C, D, E, F properties
Object Methods
• AffineTransform.Set method
• AffineTransform.Units method
Remarks
All properties are read-only. To modify the AffineTransform object, use the Set method.
To obtain an AffineTransform object, reference the CoordSys object's AffineTransform property, or
declare a new, stand-alone Affine Transform object.
See Also
For an introduction to affine transformations, see ”Chapter 13: Using Coordinate Systems” on
page 191.
Remarks
An affine transformation has the following form:
x' = Ax + By + C
y' = Dx + Ey + F
In these equations, the base coordinates (x,y) are transformed to produce the derived coordinates (x',
y'). The six constants A through F determine the effect of the transformation, as follows:
These properties are all read-only; to set the properties, use the Set method.
Syntax
OBJECT.Set UNITS [A, B, C, D, E, F ]
Part Description
Remarks
All arguments are required.
An affine transformation has the following form:
x' = Ax + By + C
y' = Dx + Ey + F
In these equations, the base coordinates (x,y) are transformed to produce the derived coordinates (x',
y').
AllFeaturesConstraint object
This object allows the programmer to specify that all features in a remote map layer should be stored
in the cache. An AllFeaturesConstraint object is created by calling the
Layer.CreateAllFeaturesConstraint method. A layer can have more than one AllFeaturesConstraint
object associated with it. The Enable and Disable methods of the AllFeaturesConstraint object can be
used to add and remove this constraint after it is created. The Enabled property can be used to
determine the current state of the constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
• AllFeaturesConstraint.Enabled property
Object Methods
• AllFeaturesConstraint.Disable method
• AllFeaturesConstraint.Enable method
Example
• Example in Visual Basic
See Also
LayerInfo Object on page 412
Working with the Cache on page 178
Layer.CreateAllFeaturesConstraint method (Layer Object) on page 381
BoundsConstraint object on page 285
FeaturesConstraint object on page 322
Syntax
OBJECT.Disable
OBJECT – An AllFeaturesConstraint object
See Also
Working with the Cache on page 178
AllFeaturesConstraint.Enabled property (AllFeaturesConstraint object) on page 273
AllFeaturesConstraint.Enable method (AllFeaturesConstraint object) on page 273
Syntax
OBJECT.Enable
OBJECT – An AllFeaturesConstraint object
See Also
Working with the Cache on page 178
AllFeaturesConstraint.Enabled property (AllFeaturesConstraint object) on page 273
AllFeaturesConstraint.Disable method (AllFeaturesConstraint object) on page 272
See Also
Working with the Cache on page 178
AllFeaturesConstraint.Enable method (AllFeaturesConstraint object) on page 273
AllFeaturesConstraint.Disable method (AllFeaturesConstraint object) on page 272
Object Properties
• Annotation.Graphic property
• Annotation.Type property
Collection Properties
• Annotations.Count property
• Annotations.Editable property
• Annotations.Item property
Collection Methods
• Annotations.ActiveAnnotation method
• Annotations.AddSymbol method
• Annotations.AddText method
• Annotations.Remove method
• Annotations.RemoveAll method
See Also
Map object on page 427
See Also
Graphic Object on page 361
Syntax
OBJECT.ActiveAnnotation
Syntax
Annotations.AddSymbol [X, Y]
Part Description
X X coordinate of the symbol to add. This is a double value, and specifies the map coordinate
(longitude).
Y Y coordinate of the symbol to add. This is a double value, and specifies the map coordinate
(latitude).
See Also
Map.DefaultStyle property (Map object) on page 438
Graphic.X property (Graphic object) on page 362
Graphic.Y property (Graphic object) on page 362
Syntax
OBJECT.AddText ( Text, X, Y, [Position] )
Part Description
See Also
Map.DefaultStyle property (Map object) on page 438
Graphic.Caption property (Graphic object) on page 361
Graphic.Position property (Graphic object) on page 361
Graphic.X property (Graphic object) on page 362
Graphic.Y property (Graphic object) on page 362
See Also
Annotations.Count property (Annotations collection) on page 276
Note: If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
Syntax
OBJECT.Remove (Index)
Part Description
See Also
Annotations.Count property (Annotations collection) on page 276
Syntax
OBJECT.RemoveAll
Part Description
BindLayer Object
The BindLayer object is used as a parameter to the Datasets.Add method. It is used to specify
information on how to perform the data binding. This is required when binding data that has X and Y
coordinates or data like ZIP codes, and you want points created at these locations in a new layer.
Object Properties
• BindLayer.CoordSys property
• BindLayer.Filespec property
• BindLayer.KeyLength property
• BindLayer.LayerName property
• BindLayer.LayerType property
• BindLayer.OverwriteFile property
• BindLayer.RefColumn1 property
• BindLayer.RefColumn2 property
• BindLayer.ReferenceLayer property
• BindLayer.ReferenceLayerField property
See Also
Datasets.Add method (Datasets collection) on page 300
Remarks
When you perform x/y or pointref data binding to create a layer of points, the BindLayer.CoordSys
property specifies the coordinate system in which the layer will be created. Furthermore, in the case of
x/y data binding, MapX uses this coordinate system to interpret the data source's x- and y-
coordinates. For example, if you know that a data source contains x- and y-coordinates in state plane
coordinates, set the BindLayer.CoordSys to use a state plane coordinate system.
If you do not set this property, the current Map.NumericCoordSys property is used as the coordinate
system.
Remarks
This property applies to x/y data binding and pointref data binding (i.e. the BindLayer.LayerType
property is miBindLayerTypeXY or miBindLayerTypePointRef).
If you assign a file path and name to this property, the Datasets.Add method creates a permanent
layer, stored at the path that you specified. If you do not assign this property, the layer is temporary.
Remarks
If you do not assign a value to this property, the default key length is 254. In other words, the resulting
layer will include a column 254 characters wide.
See Also
BindLayerTypeConstants on page 589
BindLayer.ReferenceLayer property (BindLayer object) on page 281
BindLayer.LayerType property (BindLayer object) on page 279
BindLayer.RefColumn1 property (BindLayer object) on page 281
BindLayer.RefColumn2 property (BindLayer object) on page 281
Discussion
If set to miBindLayerTypeNormal, that means you are binding (adding) data to a layer in the
GeoDictionary.
If set to miBindLayerTypeXY, this indicates that the data has X and Y coordinates in it, and you want a
new layer of points to be created. When this is used, you need to specify the name of the newly created
point layer (BindLayer.LayerName), the field in the data that contains the X coordinate
(BindLayer.RefColumn1), and the field that contains the Y coordinate (BindLayer.RefColumn2).
If set to miBindLayerTypePointRef, this indicates that your data contains values that you want to
match to information in a point reference file. A new layer is created containing a point for each row in
the source data that matches an entry in the point reference file. For example, if your source data
contains ZIP Code information, and you have a point reference file containing U.S ZIP Code Centers
installed in your GeoDictionary, you can create a new layer containing a point for each ZIP Code
contained in your source data (or multiple points if a ZIP Code appears more than once). When this is
used, you need to specify the name of the newly created point layer (BindLayer.LayerName), the field
in the data that contains the reference data, (BindLayer.RefColumn1), and the name of the point
reference file—the file that has the ZIP Code locations in the above example
(BindLayer.ReferenceLayer). The point reference file must be installed in the GeoDictionary.
See Also
Datasets.Add method (Datasets collection) on page 300
BindLayerTypeConstants on page 589
BindLayer.ReferenceLayer property (BindLayer object) on page 281
BindLayer.LayerType property (BindLayer object) on page 279
BindLayer.RefColumn1 property (BindLayer object) on page 281
BindLayer.RefColumn2 property (BindLayer object) on page 281
Remarks
This property applies to the X/Y and point-ref data binding (i.e. the BindLayer.LayerType property is
miBindLayerTypeXY or miBindLayerTypePointRef).
This property is used in conjunction with the BindLayer.FileSpec property AND by the Datasets.Add
method to create a permenant layer, stored at the path specified. If this property is set to false, but the
file specified by the BindLayer.Filespec property DOES exist, exception #1230 is thrown.
See Also
BindLayer.LayerType property (BindLayer object) on page 279
BindLayer.Filespec property (BindLayer object) on page 278
Datasets.Add method (Datasets collection) on page 300
See Also
BindLayerTypeConstants on page 589
See Also
BindLayer.LayerType property (BindLayer object) on page 279
BindLayerTypeConstants on page 589
PointReference binding (data binding of type miBindLayerTypePointRef), can be done using any table
as a reference layer, not just CPF files. Specify the reference layer as the ReferenceLayer property of the
BindLayer object provided to the Datasets.Add method when doing a PointReference bind.
See Also
BindLayer.LayerType property (BindLayer object) on page 279
BindLayerTypeConstants on page 589
Remarks
This property is optional (does not need to be set). It is only valid for BindLayerTypeNormal and is
only valid when the layer to bind to is specified in the LayerName property.
Remarks
The symbol bitmap sizes range from 1 - 48 points. If a BitmapSymbol is less than 1 point size then the
Size property is set to 1. If a BitmapSymbols size is greater than 48 points then the Size property is set
to 48.
Please be aware that 2, 16 and 256 bit color bitmaps ARE supported and 24 bit color is NOT.
Object Properties
• BitmapSymbol.Name property
Collection Properties
• BitmapSymbols.Count property
• BitmapSymbols.Item property
Collection Methods
• BitmapSymbols.Refresh method
• BitmapSymbols.Unload method
Remarks
The Name property is read-only. Use this property to determine the name of a bitmap symbol file
(*.bmp); you can assign that name to a Style object's SymbolBitmapName property.
Note: Please be aware that 2, 16 and 256 bit color bitmaps ARE supported and 24 bit color is
NOT.
Syntax
[ BitmapSymbol= ]OBJECT.Item (index)
Part Description
Remarks
The BitmapSymbols collection represents the set of .bmp files found in the CUSTSYMB directory.
However, if you add .bmp files while MapX is running, MapX does not update the collection
automatically. To guarantee that the BitmapSymbols collection is current, use the Refresh method.
Syntax
OBJECT.Refresh ()
Remarks
When the BitmapSymbols collection goes out of scope, resources are not freed automatically. When
you are done using a BitmapSymbols collection, use the Unload method to explicitly free the
associated resources.
If you do not use this method to explicitly free the collection's resources, the resources are freed when
MapX libraries are unloaded.
Syntax
OBJECT.Unload ()
BoundsConstraint object
This object allows the programmer to specify which features is cached for a remote database layer by
specifying the bounds of a rectangle. Any features for which the MinimumBoundingRectangle (MBR)
of the feature intersects the MBR of the rectangle used to define this constraint will be saved in the
cache. A BoundsConstraint object is created by calling the Layer.CreateBoundsConstraint method. A
layer can have more than one BoundsConstraint object associated with it. The Enable and Disable
methods of the BoundsConstraint object can be used to add and remove this constraint after it is
created. The Enabled property can be used to determine the current state of the constraint. The
Bounds property can be used to set or check the MBR that defines this constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
• BoundsConstraint.Bounds property
• BoundsConstraint.Enabled property
Object Methods
• BoundsConstraint.Disabel method
• BoundsConstraint.Enable method
Example
• Example in Visual Basic
See Also
LayerInfo Object on page 412
Working with the Cache on page 178
Layer.CreateBoundsConstraint method (Layer Object) on page 382
Rectangle Object on page 480
FeaturesConstraint object on page 322
AllFeaturesConstraint object on page 272
Syntax
[ Rectangle= ] OBJECT.Bounds
[Rectangle=] – A returned MapX Rectangle object
OBJECT – A BoundsConstraint object
See Also
Rectangle Object on page 480
Working with the Cache on page 178
Syntax
OBJECT.Disable
OBJECT – A BoundsConstraint object
See Also
Working with the Cache on page 178
BoundsConstraint.Enabled property (BoundsConstraint object) on page 287
BoundsConstraint.Enable method (BoundsConstraint object) on page 286
BoundsConstraint.Disabel method (BoundsConstraint object) on page 286
Syntax
OBJECT.Enable
OBJECT – A BoundsConstraint object
See Also
Working with the Cache on page 178
BoundsConstraint object on page 285
BoundsConstraint.Enabled property (BoundsConstraint object) on page 287
BoundsConstraint.Disabel method (BoundsConstraint object) on page 286
See Also
Working with the Cache on page 178
BoundsConstraint.Enable method (BoundsConstraint object) on page 286
BoundsConstraint.Disabel method (BoundsConstraint object) on page 286
CoordSys Object
A CoordSys object represents a coordinate system.
Object Properties
• CoordSys.AffineTransform property
• CoordSys.Azimuth property
• CoordSys.Bounds property
• CoordSys.Datum property
• CoordSys.FalseEasting and CoordSys.FalseNorthing properties ()
• CoordSys.OriginLatitude, OriginLongitude properties
• CoordSys.Range property
• CoordSys.ScaleFactor property
• CoordSys.StandardParallelOne, StandardParallelTwo properties
• CoordSys.Type property
• CoordSys.Units property
Object Methods
• CoordSys.Clone method
• CoordSys.PickCoordSys method
• CoordSys.Set method
Remarks
All properties are read-only. To modify a coordinate system, use the Set method or the PickCoordSys
method, or assign it to equal another CoordSys object.
To obtain a CoordSys object, reference the Map.DisplayCoordSys property, Map.NumericCoordSys
property, or Layer.CoordSys property.
See Also
”Chapter 13: Using Coordinate Systems” on page 191
Map.DisplayCoordSys property (Map object) on page 438
Map.NumericCoordSys property (Map object) on page 451
Layer.CoordSys property (Layer object) on page 383
See Also
Affine Transform object on page 270
Syntax
[ CoordSys= ]OBJECT.Clone ()
See Also
Datum Object on page 304
Remarks
The units are determined by the CoordSys.Unit property.
Syntax
[Boolean=]OBJECT.PickCoordSys ([HelpFile], [ID])
Part Description
Remarks
The dialog box is automatically initialized, so that the highlighted description matches the CoordSys
object.
If the user clicks OK on the dialog box, the method returns True, and the CoordSys object is updated to
match the coordinate system that the user chose. If the user clicks Cancel, the method returns False,
and the CoordSys object is left unchanged.
MapX initializes the list of available coordinate systems by reading the contents of the file
mapinfow.prj, which is located in the same directory as mapx50.dll.
Syntax
OBJECT.Set (Type, [Datum], [Units], [OriginLongitude], [OriginLatitude],
[StandardParallelOne], [StandardParallelTwo], [Azimuth], [ScaleFactor],
[FalseEasting], [FalseNorthing], [Range], [Bounds], [AffineTransform] )
Part Description
Remarks
The Type argument is always required. All other arguments are variants; these arguments may be
required, depending on which projection/coordinate system you select.
If an argument is not required, you may pass in any value or omit it entirely.
Data Binding
Data Binding is the process of bringing data from a data source into MapX. The data source might be a
Visual Basic data control, or an ODBC data source. In MapX, the data is represented as a Dataset
object.
Data binding can be done two ways. If you have Visual Basic for bound data controls, at design time
you can use the Dataset property of the Map object. Or, bind data programmatically by using the
Datasets.Add method. This method requires you to tell MapX which data source to use, some
information about it, and which map layer to bind it to.
The binding process results in the creation of a Dataset object. This Dataset, which is added to the
Datasets collection, contains computed values for features in the map layer that the data is bound to.
For example, if data is bound to US_States map, each state would have a new data value that could
then be used to control how the states are drawn. If the data source had multiple records for a state, the
values could be summed, averaged, or counted. The Dataset has a Value method you can use to access
the computed value for each row (or feature) of the map.
A DataSource (the second parameter for Datasets.Add) is actually an OLE interface. MapX uses the
interface to access the data directly from the data source. The data isn't actually passed to
Datasets.Add.
For an in depth information on datatypes supported by MapX, see ”Chapter 6: Putting Your Data On
The Map” on page 73 .
Object Properties
• Dataset.Fields property
• Dataset.GeoField property
• Dataset.Layer property
• Dataset.Name property
• Dataset.ReadOnly property
• Dataset.RowCount property
• Dataset.SecondaryGeoField property
• Dataset.SourceRows property
• Dataset.Themes property
• Dataset.Type property
Object Methods
• Dataset.AddField method
• Dataset.Refresh method
• Dataset.RowValues method
• Dataset.Value method
Collection Properties
• Datasets.BuildSourceRows property
• Datasets.Count property
• Datasets.Item property
Collection Methods
• Datasets.Add method
• Datasets.Contains method
• Datasets.Remove method
• Datasets.RemoveAll method
• Datasets.Restore method
Syntax
OBJECT.AddField (Name, Expression)
Part Description
Remarks
The new field will have a type that is either miTypeNumeric or miTypeString depending on the return
type of the expression. Though the aggregation type is set to miAggregationSum, the new field will
not hold the aggregated value of any field.
The new field will have an aggregation type of miAggregationSum for numeric fields and
miAggregationIndividual for string fields.
The field is added to the end of the fields collection for the Dataset and is temporary. That is, when the
application terminates, the field will disappear. Also, the added field is not updateable. If you try to
update the added field, an exception will NOT be thrown.
Exceptions are thrown for invalid expressions, an invalid name parameter, or a non-unique field
name.
See Also
See “Creating Expressions” on page 605
Remarks
A given Dataset either supports or does not support the Datasetset.SourceRows method throughout
its lifetime. Changing the property on the Datasets collection will not effect Dataset object(s)
previously created from that Datasets collection.
See Also
Field object and Fields collection on page 340
Remarks
When a Dataset is added, the data is always attached to a layer. This points to the layer.
A layer may have more than one Dataset bound to it. When a layer is deleted, any Datasets bound to it
are also deleted.
Remarks
The name is a way to refer to this Dataset when using methods such as Datasets.Item or
Datasets.Remove. The name must be unique across all Datasets in the Dataset collection.
Syntax
Dataset.Refresh
Remarks
This method is used to update the map if there are changes in the data.
When the Refresh method is invoked, the data is re-read from the original data source and re-
aggregated using the aggregation methods defined by the fields in the Dataset.
Any themes based on the Dataset will be updated to reflect the new data.
Note: This method will not work for Datasets of type miBindLayerTypeXY
Syntax
[RowValues=]OBJECT.RowValues(Row)
Part Description
Remarks
Since data is bound to a layer, Dataset.RowCount actually returns the number of features in the layer.
Items in a Dataset can have NULL values if no data is bound to the feature.
Dataset.RowCount will return a value of zero when the dataset was created from a DBMS server.
See Also
Layer.AllFeatures method (Layer object) on page 380
Features.Count property (Features collection) on page 320
See Also
RowValue Object and RowValues Collection on page 485
Layer.UpdateFeature method (Layer object) on page 401
Feature.Update method (Feature object) on page 317
Syntax
[ Dataset= ]OBJECT.Restore ( Name, SourceData )
Part Description
See Also
Datasets.Add method (Datasets collection) on page 300
See Also
SourceRow Object and SourceRows Collection on page 497
Feature.KeyValue property (Feature object) on page 312
See Also
Theme Object and Themes Collection on page 526
See Also
DataSetTypeConstants on page 594
Syntax
[value=] OBJECT.Value (Row, Column)
Part Description
Remarks
The values returned are from the MapX Dataset, not the original source data. Since the original source
data is aggregated and bound to a layer to form the MapX Dataset, the Row numbers correspond to
the features in the Layer, and not the original source row numbers. Therefore, cells in the Dataset can
have NULL values if no data was bound to the feature. A NULL value is returned in the variant by
setting the type of the variant to VT_NULL.
You can use a Feature object as the Row parameter, since a feature object uniquely identifies a single
row in the Layer that the dataset is bound to.
If you are working with remote tables, you MUST use the FeatureKey or Feature object. You may NOT
use FeatureID.
See Also
Feature.KeyValue property (Feature object) on page 312
'Feature.Name property (Feature object) on page 314
Syntax
OBJECT.Add ( Type, SourceData, [Name], [Geofield], [SecondaryGeofield], [BindLayer], [Fields],
[Dynamic] )
Part Description
Part Description
Fields This is a Field object which is in a collection of Field objects. The field
objects are used to describe which fields from the data source to bring
in, and which aggregation function to use if more than one record for
the data source matches a particular map feature. This is an optional
parameter, and if not specified, all columns are brought in, and the
data values are summed if more than one record is encountered per
feature.
Dynamic Variant: A Boolean value that controls whether the data binding is
dynamic. Optional; if omitted, defaults to false, meaning that the
binding is static (i.e., MapX will copy needed data when the database
is opened). If you specify True, MapX accesses data in a live manner,
only data needed (e.g. when labeling). If you specify True but the
Dataset does not support dynamic columns, an exception will be
thrown.
Note: If ambiguity exists (like multiple geosets), the user can specify an event handler to pick
one. If no event handler is specified, MapX will pick the first one.
Note: Dataset type: miDatasetLayer—used to create a dataset that references fields from a
MapInfo table. The SourceData parameter is a Layer object.
Note: When doing BindLayer matching, the geofields must be unique. Only the first item of a
non-unique set of data will be matched. The rest are ignored.
Remarks
If the automatic detection logic is being used, more than one match may be found. If you want to
handle this case, you can implement the ResolveDataBind event handler. Otherwise, MapX picks the
first match.
A SecondaryGeofield is required when the layer that a Dataset is being bound to has a key column that
is not unique by itself. The secondary geofield is then used to uniquely match an object (row) in the
layer.
When miBindLayerTypeXY is used within DataSets.Add a temporary table will be created with one
column named "GeoName", in order for a fields collection to be recognized a new databind must be
created on a permanent layer.
The GeoField column must be unique if a new layer of points is to be created (BindLayer.LayerType is
miBindLayerTypeXY or miBindLayerTypePointRef). The GeoField column will be used to name the
features in the new point layer. Non-unique values will result in a single point being added to the new
point layer for the first occurrence of the duplicate key value, and data values in the duplicate rows
will be aggregated.
If a Fields collection is specified, the Geofield and SecondaryGeofield parameters refer to columns in
the Fields collection rather than in the source data.
If dynamic data binding is being used, the Field.AggregationFunction property is ignored for all field,
and all fields are aggregated individually. In the case of multiple matching records, the first will be
taken.
See Also
Field object and Fields collection on page 340
Syntax
OBJECT.Contains(Index)
Part Description
See Also
State Object on page 499
Note: If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
Syntax
Datasets.Remove (index)
Part Description
Remarks
All themes based off this Dataset are removed as well.
Syntax
Datasets.RemoveAll
Datum Object
A Datum object represents the datum used by a CoordSys object. A datum is a singular mathematical
description of the earth's shape and orientation.
Object Properties
• Datum.Eccentricity property
• Datum.Ellipsoid property
• Datum.Flattening property
• Datum.PrimeMeridian property
• Datum.RotateX, RotateY, RotateZ properties
• Datum.ScaleAdjust property
• Datum.SemiMajorAxis, SemiMinorAxis properties
• Datum.ShiftX, ShiftY, ShiftZ properties
Object Methods
• Datum.Set method
• Datum.SetFromList method
Remarks
All properties are read-only. To modify a Datum object, use the Set method or the SetFromList method.
To obtain a Datum object, reference a CoordSys object's Datum property.
Remarks
In equations, eccentricity is usually represented by the letter "e".
Remarks
In equations, flattening is usually represented by the letter f.
Remarks
The PrimeMeridian property is usually zero, because most datums use Greenwich as the prime
meridian. However, some datums use a different location as the prime meridian. For example, the
NTF datum uses Paris as its prime meridian, which is 2.33722917 degrees east of Greenwich. If you use
the NTF datum in a coordinate system, all longitudes in that coordinate system are relative to Paris
instead of Greenwich.
Remarks
In equations, the scale adjustment is usually represented by the letter m.
Remarks
In equations, semi-major axis is usually represented by the letter a, and semi-minor axis is usually
represented by the letter b.
Syntax
OBJECT.Set (Ellipsoid, ShiftX, ShiftY, ShiftZ, RotateX, RotateY, RotateZ, ScaleAdjust, PrimeMeridian)
Part Description
Remarks
All arguments are required.
See Also
Datum.SetFromList method (Datum object) on page 306
Syntax
OBJECT.Set DatumNumber
Part Description
Note: If a map feature is selected that exists over another object in another layer that also gets
selected, the original feature does not appear to be selected. For example, in the "World
Countries" geoset, select the United States and then, holding down the control key, select
the ocean. The United States does not appear to be selected. Both items, however, will be in
the Selection collections for their respective layers.
The Features collection object represents a collection of Feature objects from a layer. All features in a
collection must be from the same layer. You can get a features object by calling one of the Layer Search
methods, which return a Features collection. The Features object contains the features that were in the
layer when the Search method was called. Adding or removing features from the layer do not affect
any Feature collections that you may already have.
Object Properties
• Feature.Area property
• Feature.Bounds property
• Feature.Caption property
• Feature.CenterXproperty, CenterYproperty
• Feature.FeatureID property
• Feature.FeatureKey property
• Feature.HasMultipoint property
• Feature.HasPolyline property
• Feature.HasRegion property
• Feature.KeyValue property
• Feature.LabelPoint property
• Feature.Layer property
• Feature.Length property
• Feature.Multipoint property
• Feature.Name property
• Feature.Nodes property
• Feature.Parts property
• Feature.Perimeter property
• Feature.Point property
• Feature.Polyline property
• Feature.Region property
• Feature.Smooth property
• Feature.Style property
• Feature.Type property
Object Methods
• Feature.Attach method
• Feature.Clone method
• Feature.Offset method
• Feature.Update method
Collection Properties
• Features.Bounds property
• Features.Count property
• Features.Item property
Collection Methods
• Features.Add method
• Features.AddByID method
• Features.Clone method
• Features.Common method
• Features.Remove method
• Features.RemoveByID method
• Features.Replace method
See Also
Selection Collection on page 489
Layer.Search method (Layer object) on page 395
Remarks
To control the units in which the area is returned, set the Map.AreaUnit property.
This is valid for the Region. The value is in area units. If you modify a feature in a layer, and you have
not yet performed an Update to save the changes, then this property returns a value based on the
"modified" version of the object (the object as it exists in memory).
See Also
Map.AreaUnit property (Map object) on page 429
Syntax
OBJECT.Attach (Map)
Part Description
Remarks
When you create a stand-alone feature object, you must attach that feature object to the map before
you reference any of its methods or properties. Attaching a feature to the map associates the map's
coordinate system with the feature. However, if you create a stand-alone feature by calling methods of
the FeatureFactory object, you do not need to call the Attach method.
Syntax
[=Feature]Feature.Clone
Remarks
In earlier versions of MapX, this property was called MBR.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes, then
this property returns a value based on the "modified" version of the object (the object as it exists in
memory).
See Also
Rectangle Object on page 480
Syntax
[= string] OBJECT.Caption
Part Description
Part Description
See Also
Feature Object and Features Collection on page 308
Remarks
When you need to access a feature's centroid, you may find it easier to use the LabelPoint property,
instead of using CenterX and CenterY.
Note: Although this property is still a functional part of MapX, it is recommended that you use
the Feature.FeatureKey. The FeatureKey property is used to identify a unique record in a
table. In previous versions, the FeatureID property was used for this purpose, but it did
not work correctly for seamless and remote layers. The FeatureKey property works for all
layer types
Note: The Key of a feature can be used as a parameter wherever FeatureID could be used. The
FeatureKey property is used to identify a unique record in a table. In previous versions,
the FeatureID property was used for this purpose, but it did not work correctly for
seamless and remote layers. The FeatureKey property works for all layer types.
See Also
Selection.SelectByRegion method (Selection collection) on page 495
Dataset.Value method (Dataset object) on page 299
Remarks
The field value that is set or retrieved is determined by the value of the KeyField property of the Layer
that the feature is from. Although the property is a string property, the string will be converted to the
proper type of the column when updating or inserting.
Only the most recent value of the KeyValue property is used when adding or updating a feature. That
is if you set the KeyValue, change the layer's keyfield property to a different field and then set the
keyvalue again, only the second value will be updated in the MapInfo table for that feature.
See Also
Layer.KeyField property (Layer object) on page 391
Layer Object and Layers Collection on page 377
Syntax
[bool= ] OBJECT.HasMultipoint
Syntax
[bool= ] OBJECT.HasPolyline
Syntax
[bool= ] OBJECT.HasRegion
See Also
Point Object and Points Collection on page 472
See Also
Layer Object and Layers Collection on page 377
Note: The length calculation does not take into account the curvature of the Earth, so it will
generally be inaccurate for line segments spanning long distances. Length is determined
using a modified Cartesian calculation: longitude/latitude coordinates are converted to X,
Y coordinates in MapX's current map units, taking into account the number of miles per
degree of longitude at each line segment's centroid. The distance between the resulting
points is then calculated using the Pythagorean Theorem.
Remarks
To control the units in which the length is returned, set the Map.MapUnit property.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes, then
Feature.Length returns a value based on the "modified" version of the object (the object as it exists in
memory).
See Also
Feature.Perimeter property (Feature object) on page 315
Map.MapUnit property (Map object) on page 445
Remarks
Reading from this property returns the multipoint part of a collection feature (if it exists). This feature
is returned as a stand-alone feature, if editing is done on this feature, in order to have edits saved in a
table, user need to update the parent feature.
Writing to this property makes a copy of a feature passed in and sets it into an existing collection
feature.
See Also
LabelProperties.DataField property (LabelProperties object) on page 372
Syntax
[ SafeArray= ] OBJECT.Nodes ([CSys])
Part Description
Syntax
OBJECT.Offset (deltaX, deltaY)
Part Description
See Also
Parts Collection on page 470
Remarks
To control the units in which the perimeter is returned, set the Map.MapUnit property.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes, then
this property returns a value based on the "modified" version of the object (the object as it exists in
memory).
See Also
Feature.Length property (Feature object) on page 313
See Also
Point Object and Points Collection on page 472
Remarks
Reading from this property returns the Polyline part of a collection feature (if it exists) and is returned
as a stand-alone feature. If editing is done on this feature, in order to have edits saved in a table, the
user needs to update parent feature.
Writing to this property makes a copy of the feature passed in and sets it into existing collection
feature.
Remarks
Reading from this property returns the region part of a collection feature (if it exists) and is returned as
a stand-alone feature. If editing is done on this feature, in order to have edits saved in a table, the user
needs to update parent feature.
Writing to this property makes a copy of the feature passed in and sets it into existing collection
feature.
See Also
Style Object on page 507
Remarks
Style object default is '0' for each property of style object.
See Also
FeatureFactory.CreateText method (FeatureFactory object) on page 334
Syntax
OBJECT.Update ( [UpdateFeature] , [RowValues] )
Part Description
Part Description
RowValues RowValues represents the new values of the attribute data, for one row
of data. Each value in the RowValues collection corresponds to one
column of attribute data. This parameter is ONLY applicable to a
Dataset of type miDatasetLayer.
Note: The object column stores the geographic data for the Feature object.
Remarks
If the RowValues collection points to fields added via the Dataset.AddField method, then these fields
will not be not updateable.
Syntax
OBJECT.Add (Source)
Part Description
See Also
Feature Object and Features Collection on page 308
Syntax
OBJECT.AddByID(FeatureKey)
Part Description
was used for this purpose, but it did not work correctly for seamless and remote layers.
The FeatureKey property works for all layer types.
See Also
Feature.KeyValue property (Feature object) on page 312
Syntax
OBJECT.Bounds
The OBJECT placeholder represents a Features collection.
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in the
collection.
Syntax
OBJECT.Clone (source)
Part Description
Syntax
OBJECT.Common (source)
Part Description
Syntax
OBJECT.Remove (source)
Part Description
Syntax
OBJECT.RemoveByID (*FeatureKey)
Part Description
Syntax
OBJECT.Replace (source)
Part Description
FeaturesConstraint object
This object allows the programmer to specify which features will be cached for a remote database layer
by specifying a MapX Features collection. A FeaturesConstraint object is created by calling the
Layer.CreateFeaturesConstraint method. A layer can have more than one FeaturesConstraint object
associated with it. The Enable and Disable methods of the FeaturesConstraint object can be used to
add and remove this constraint after it is created. The Enabled property can be used to determine the
current state of the constraint. The Features property can be used to set or check the Features
collection that defines this constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
• FeaturesConstraint.Enabled property
• FeaturesConstraint.Features property
Object Methods
• FeaturesConstraint.Diasable method
• FeaturesConstraint.Enable method
Example
• Example in VB
See Also
LayerInfo Object on page 412
Working with the Cache on page 178
Feature Object and Features Collection on page 308
Layer.CreateFeaturesConstraint method (Layer Object) on page 382
AllFeaturesConstraint object on page 272
BoundsConstraint object on page 285
Syntax
OBJECT.Disable
OBJECT – A FeaturesConstraint object
See Also
Working with the Cache on page 178
FeaturesConstraint.Enabled property (FeaturesConstraint object) on page 323
FeaturesConstraint.Enable method (FeaturesConstraint object) on page 323
See Also
Working with the Cache on page 178
FeaturesConstraint.Enable method (FeaturesConstraint object) on page 323
FeaturesConstraint.Diasable method (FeaturesConstraint object) on page 322
Syntax
[Rectangle=] OBJECT.Bounds
Rectangle – A MapX Rectangle object
OBJECT – A FeaturesConstraint object
See Also
Feature Object and Features Collection on page 308
Working with the Cache on page 178
FeaturesConstraint object is used to determine which records are stored in the Cache. When
instantiated a FeaturesConstraint object is enabled by default, this method need only be used when the
FeaturesConstraint has been disabled via the FeaturesConstraint.Disable method.
Syntax
OBJECT.Enable
OBJECT – A FeaturesConstraint object
See Also
Working with the Cache on page 178
FeaturesConstraint object on page 322
FeaturesConstraint.Enabled property (FeaturesConstraint object) on page 323
FeaturesConstraint.Diasable method (FeaturesConstraint object) on page 322
FeatureFactory Object
This object lets you create new map features, or create features by performing operations (such as
buffering) on existing features.
Object Methods
• FeatureFactory.BufferFeatures method
• FeatureFactory.CombineFeatures method
• FeatureFactory.CreateArc method
• FeatureFactory.CreateCircularRegion method
• FeatureFactory.CreateCollectionFeature method
• FeatureFactory.CreateEllipticalRegion method
• FeatureFactory.CreateLine method
• FeatureFactory.CreateMultipoint method
• FeatureFactory.CreateRegion method
• FeatureFactory.CreateSymbol method
• FeatureFactory.CreateText method
• FeatureFactory.EraseFeature method
• FeatureFactory.IntersectFeatures method
• FeatureFactory.IntersectionPoints method
• FeatureFactory.IntersectionTest method
Remarks
Most of these methods return stand-alone feature objects. These feature objects are automatically
attached to the map (i.e. they already have an associated coordinate system). In other words, you do
not need to use the Attach method on the features returned by these methods.
To obtain a FeatureFactory object, reference the Map.FeatureFactory property.
Syntax
[Feature = ] OBJECT.BufferFeatures ( Source, Distance, [Units] , [Resolution] )
Part Description
Part Description
Units Variant: A MapUnitConstants value, such as miUnitMile (0), that identifies the
unit of measure for the distance argument. If omitted, the MapUnit property is
used as the default.
Resolution Variant: A positive integer indicating the number of nodes used in creating a
buffer. This is the number of nodes per circle in a buffer operation, not the total
number of nodes for the entire region (see below). If omitted, the resolution is
controlled by the DefaultConversionResolution property.
Remarks
This method returns a single buffer region, regardless of whether you base the buffer on one Feature or
a Features collection. If you want to create a separate buffer region for each feature in the collection,
you must loop through the collection and use the BufferFeatures method on one feature at a time.
If you are creating a buffer for the sole purpose of performing a search within the buffer, you can use
the SearchWithinDistance method instead of the BufferFeatures method.
The resolution argument controls how many nodes are
in the buffer region. Resolution is specified in terms of
the number of nodes per circle; this is best illustrated by
example. This picture shows two features: A black, L–
shaped polyline, and a gray buffer region. The region
was produced by creating a buffer around the polyline.
In this illustration, a small square marks the location of
each node in the buffer region. This buffer was produced
using a resolution of 12 nodes per circle. Note that each
end of the polyline is capped with a semi–circle, and
each semi–circle consists of six segments. If a larger
resolution had been used, there would be more nodes in
each semi–circle.
The resolution does not necessarily represent the total
number of nodes in the feature. Resolution is specified in terms of nodes per circle, and a given feature
can contain many semi–circles. For example, the buffer region shown above has more than 12 nodes,
although the resolution specified 12 nodes per circle. Specifying a large resolution produces a
smoother looking region, but it takes longer to generate, and the resulting object requires more storage
space.
A zero width buffer is allowed on closed objects: Region, Rect, RoundRect, IsEllipse, & Text. An "error
creating buffer" exception will be thrown for other object types.
See Also
FeatureFactory.CreateCircularRegion method (FeatureFactory object) on page 330
Syntax
[Feature = ] OBJECT.CombineFeatures( feature1, [ feature2 ] )
Part Description
Remarks
If feature1 is a Features collection, then the feature2 argument is optional. If feature1 is a Feature
object, then the feature2 argument is required. You cannot combine a line feature with a region feature.
The following combinations are supported:
• You can combine two or more line features (features whose Type property is
miFeatureTypeLine), in which case the result is a line feature.
• You can combine two or more region features (type: miFeatureTypeRegion), in which case the
result is a region feature.
Syntax
[Feature = ] OBJECT.CreateArc( Point1, Point2, [Angle] , [Distance] , [Resolution] , [Style] )
Part Description
Part Description
Resolution Variant: A positive integer indicating the number of nodes to use in creating
the ellipse; maximum number is 32,763. Optional; if omitted, the
defaultConversionResolution property controls the resolution.
Style Variant: A Style object that defines the appearance of the feature. Optional; if
omitted, no style is set.
Remarks
This method returns a line feature (a feature whose Type property is miFeatureTypeLine) that is
shaped like an arc. Note: If the current DisplayCoordSys does not match the current
NumericCoordSys, the arc may appear distorted.
To calculate the path of the arc, imagine a line that connects Point1 and Point2 (the horizontal line in
the diagram at the left).
Next, imagine a second line (the vertical line in the diagram) that begins at the center point of the first
line. The length of the second line is determined by the Offset argument, and its angle relative to the
first line is determined by the Angle argument. To make the second line perpendicular, as shown in the
diagram, specify 90 degrees or 270 degrees. A triangle is defined by Point1, Point2, and the end point
of the second line. This triangle acts as a ”control polygon” in that it controls the shape of the arc. The
arc fits inside the triangle, and it is tangential to the sides of the triangle at Point1 and Point2. The arc
falls on one side of the line between Point1 and Point2. To make the arc fall on the opposite side of the
line, use a different Angle argument (e.g. instead of 90 degrees, specify 270 degrees). Each combination
of Angle and Offset values produces a unique, characteristic shape. If you always use the same
combination of Angle and Offset values, the arcs produced will always have the same shape,
regardless of the distance between Point1 and Point2. Some samples are shown below:
30 1
30 0.5
90 1
90 0.5
90 0.25
165 1
165 0.5
270 0.5
See Also
FeatureFactory.CreateEllipticalRegion method (FeatureFactory object) on page 332
Syntax
[Feature = ] OBJECT.CreateCircularRegion( Type, Point, Distance, [Units] , [Resolution] , [Style] )
Part Description
Remarks
If the Type is miCircleTypeScreen, MapX creates a region that appears circular on the screen. However,
different points on the circle might not be the same geographic distance from the center of the circle.
MapX calculates a point along the x-axis that is Distance units from the center. That distance is
converted to screen units (pixels) and used as the radius to calculate the rest of the nodes in the circle.
Note: If you change the map's display coordinate system after creating the region, the region may
appear lop-sided, rather than circular.
If the Type is miCircleTypeMap, MapX creates a region whose points are all the same geographic
distance from the center. However, due to the curvature of the earth, and due to the way that
coordinate systems and map projections work, such a circle might appear lop-sided, rather than
circular.
See Also
FeatureFactory.BufferFeatures method (FeatureFactory object) on page 325
FeatureFactory.CreateEllipticalRegion method (FeatureFactory object) on page 332
Syntax
[Featurel= ] OBJECT.CreateCollectionFeature ([feature1], [feature2], [feature3])
Remarks
This method creates a stand-alone Feature object. You can pass up to three features objects as
parameters to this method. At most, you can pass one region feature, one polyline feature and one
multipoint feature. If no parameters are passed then an empty feature of type
miFeatureTypeCollection is created. You can't pass feature of the same type to this method.
Part Description
Syntax
[Feature = ] OBJECT.CreateEllipticalRegion( Rectangle, [Angle] , [Resolution] , [Style] )
Part Description
Remarks
If the current DisplayCoordSys does not match the current NumericCoordSys, the ellipse may appear
distorted.
See Also
FeatureFactory.CreateArc method (FeatureFactory object) on page 327
FeatureFactory.CreateCircularRegion method (FeatureFactory object) on page 330
Syntax
[Feature = ] OBJECT.CreateLine( [Points] , [Style] )
Part Description
Part Description
Points Variant: A Points collection, representing the set of points to use to define
the line. Optional; if omitted, no points are added to the line feature.
Style Variant: A Style object that defines the appearance of the feature. Optional;
if omitted, no style is set.
Syntax
[Featurel= ] OBJECT.CreateMultipoint ([Points], [Style])
Part Description
Syntax
[Feature = ] OBJECT.CreateRegion( [Points] , [Style] )
Part Description
Syntax
[Feature = ] OBJECT.CreateSymbol( [Point] , [Style] )
Part Description
Syntax
[Feature = ] OBJECT.CreateText( [Point] , [Caption] , [Position] , [Style] )
Part Description
Remarks
You control the location of a text feature by specifying the Point and the Position. Note, however, that
the Position property can only be used for specifying the initial position of the text; the Feature object
does not provide a Position property that allows you to reset the text orientation. Once this method
creates a text feature, there is no way to toggle the feature's orientation relative to the anchor point.
Syntax
[Feature = ] OBJECT.EraseFeature( SourceFeature, EraserFeature )
Part Description
Remarks
This method creates a Feature object by subtracting the EraserFeature from the SourceFeature. If the
two features do not intersect, then nothing is erased, and the feature returned by this method is
identical to the SourceFeature.
Example
This picture shows a circular region, created through the BufferFeatures method. In this example, the
circular region covers a coastal area; the gray area represents land, and the white area represents water.
To erase part of the circular region, use the EraseFeature method. If you make the circular region your
SourceFeature, and make the gray region your EraserFeature, you will erase the portion of the circle
that overlaps the gray region.
This picture shows what is left of the circular region after calling the EraseFeature method. The
EraseFeature method removes the portion of a feature that overlaps another feature. To perform the
opposite task (to remove the portion of a feature that does not overlap), use the
FeatureFactory.IntersectFeatures method.
Syntax
[Feature=]OBJECT.IntersectFeatures( feature1 [feature2] )
Part Description
Remarks
This method intersects a Feature or Features object with another Feature or Features object, and
returns the resulting object as a stand-alone feature.
You cannot use point or text features with this method. Only the following combinations of feature
types are supported:
• You can intersect regions with other regions. If regions overlap, the feature returned by this
method is also a region.
• You can intersect regions and lines. Assuming that the region covers at least part of the line,
the intersection is the portion of the line that is covered by the region.
• You can intersect lines with other lines. If two lines cross, IntersectFeatures will return a
polyline feature with one point.
Note that two features might not intersect at all. In the case of one line and one region– or– two lines,
the value returned by this method is a POLYLINE FEATURE with zero points. However, when two
region features do not intersect, the value returned is a REGION FEATURE with zero points. In any
case, a "zero point feature" cannot be inserted into a layer.
When working with multiple polylines, the intersection of the features collection returns the point or
points where ALL lines intersect. Therefore, if any of the lines within the feartures collection does
NOT intersect the others, a polyline with 0 points is returned.
The IntersectFeatures method returns the portion of a feature that overlaps another feature. To obtain
the portion of a feature that does not overlap, use the EraseFeature method.
Syntax
[Points collection=]OBJECT.IntersectionPoints( feature1, feature2, [flag] )
Part Description
Remarks
If the two features do not intersect, the Points collection produced by this method is empty.
The flag argument can be any of the three IntersectionPointConstants values, described below.
miIntersectCrossings 9 This returns the set of points where a line segment from one
feature crosses a line segment from the other feature, but the
features do not have nodes at the point of crossing.
miIntersectCommon 10 This returns the set of points where a line segment from one
feature intersects a line segment from the other feature, and
both features have a node at the point of intersection.
miIntersectAll 11 This returns all points where the features cross or intersect,
regardless of whether there are common nodes at the point
of intersection. In other words, retrieves all of the
miIntersectCommon points and all miIntersectCrossings
points.
Syntax
[Boolean=]OBJECT.IntersectionTest( feature1, feature2, [flag] )
Part Description
Remarks
This method tests two features to determine whether they intersect. There are three types of
intersection test; the flag argument controls which type of test is performed.
Object Properties
• Field.AggregationFunction property
• Field.Decimals property
• Field.Indexed property
• Field.Name property
• Field.Type property
• Field.TypeEx property
Note: If the user tries to get a property that isn't available for that type Field object, MapX throws
ERR_PROPERTY_NOT_AVAILABLE (1295).
Collection Properties
• Fields.Count property
• Fields.Item property
Collection Methods
• Fields.Add method
• Fields.AddDateField method
• Fields.AddFloatField
• Fields.AddIntegerField
• Fields.AddLogicalField
• Fields.AddNumericField method
• Fields.AddSmallIntField method
• Fields.AddStringField method4
• Fields.Count property
• Fields.Item property
• Fields.Remove method
• Fields.RemoveAll method
See Also
LayerInfo Object on page 412
Dataset object and Datasets collection on page 293
See Also
Fields.Add method (Fields collection) on page 343
Note: The Field.TypeEx property has been added to MapX in order to return ALL of the
FieldTypeConstants.
Remarks
The table below describes what data types are returned when using Field.Type and Field.TypeEx.
Field Type MapX returns Using Field.Type MapX returns Using Field.TypeEx
See Also
Field.TypeEx property (Field object) on page 342
Remarks
The table below describes what data types are returned when using Field.Type and Field.TypeEx.
Field Type MapX returns Using Field.Type MapX returns Using Field.TypeEx
Field Type MapX returns Using Field.Type MapX returns Using Field.TypeEx
See Also
Field.Type property (Field object) on page 342
Syntax
[Field=]OBJECT.Add (DataSourceCol, [Name], [AggregateFunction], [Type])
Part Description
Remarks
A Fields collection is built to use with the Datasets.Add method. The Fields parameter takes a Fields
collection, and is built using this Add method.
The Type parameter is used only with Unbound Datasets. It is ignored for all other Dataset types.
The aggregate function defaults to miAggregationIndividual for string columns, and
miAggregationSum for numeric columns.
The Add method can not be used on a Dataset's fields collection once the Dataset has been created.
All field names should be unique in a given fields collection.
See Also
Datasets.Add method (Datasets collection) on page 300
Dataset.Fields property (Dataset object) on page 295
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddDateField (Name, [Indexed])
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddFloatField (Name, [Indexed])
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddIntegerField (Name, [Indexed])
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddLogicalField (Name, [Indexed])
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddSmallInt(Name, [Indexed])
Part Description
Note: This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddStringField(Name, Width, [Indexed])
Part Description
Note: If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
Syntax
OBJECT.Remove (index)
Part Description
Syntax
OBJECT.RemoveAll
Find object
Purpose
The Find object allows you to enter the name of a feature and MapX finds it. You may refine by using a
second polygon table, using street maps, and interpolate positions on the street and side of the street
using an algorithm.
Object Properties
• Find.Abbreviations property
• Find.CloseMatchMax property
• Find.ClosestAddr property
• Find.FindDataset property
• Find.FindField property
• Find.OtherBoundary property
• Find.RefineDataset property
• Find.RefineField property
• Find.RefineLayer property
Object Methods
• Find.Search method
• Find.SearchEx method
Note: The methods above do not work with remote database layers. Use the Layer.Search
method as an alternate means of locating a feature or features collection on a remote
database layer.
Remarks
The abbreviations file contains pairs of items such as "STREET ST" and "AVE AV". If the address to
search for contains "STREET" MapX will change it to "ST" and search again.
default for this property is eight and takes an integer value which must be >= 0 or MapX throws an
error.
See Also
Find.FindDataset property (Find object) on page 350
Note: This method does not work with remote database layers. Use the Layer.Search method as
an alternate means of locating a feature or features collection on a remote database layer.
Syntax
[ FindResult= ]OBJECT.SearchEx (Address, [Boundary] )
Part Description
Part Description
Address A string, which is the name of the object or street address that you want to
find. For example, “Rensselaer, 6 Georgian Ct,”, “London”, or “3 Elm
Street”.
Boundary A string, which is the name of the refining boundary object. Used when a
refining layer is specified. For example, “NY”, “12211”.
If a refine layer has been set, this argument is required; otherwise it is
optional.
See Also
FindResult Object on page 357
FindMatch Object and FindMatches Collection on page 355
See Also
Find.RefineLayer property
Find.Search method
See Also
Find.RefineField property (Find object) on page 351
Find.RefineDataset property (Find object) on page 351
Note: This method above does not work with remote database layers. Use the Layer.Search
method as an alternate means of locating a feature or features collection on a remote
database layer.
Syntax
OBJECT.Search (Address, [ Boundary ] )
Part Description
See Also
Find object on page 349
FindFeature object on page 353
FindFeature object
The FindFeature object is a super class of the Feature with the addition of a result code (FindRC).
FindFeature is returned by the search method of the Find object and contains all the properties of a
Feature object and the FindRC property.
Object Properties
• FindFeature.FindRC property
See Also
Feature Object and Features Collection on page 308Feature object
”Chapter 9: Finding Features on a Map” on page 129
**Ones Place**
xx1 Exact match
xx2 A substitution from the abbreviations file used
xx3 ( – ) Exact match not found
xx4 ( – ) No object name specified; match not found
**Tens Place**
x1x Side of street undetermined
x2x ( + / – ) Address number was within min/max range
x3x ( + / – ) Address number was not within min/max range
x4x ( + / – ) Address number was not specified
x5x ( – ) Streets do not intersect
x6x ( – ) The row matched does not have a map object
**Hundreds Place**
1xx ( + / – ) Name found in only one region other than specified region
2xx ( – ) Name found in more than one region other than the specified region
3xx ( + / – ) No refining region was specified, and one match was found
4xx ( – ) No region was specified, and multiple matches were found
5xx ( + ) Name found more than once in the specified region
See Also
FindFeature object on page 353
Object Properties
• FindMatch.FeatureID property
• FindMatch.FeatureKey property
• FindMatch.Name property
Collection Properties
• FindMatches.Count property)
• FindMatches.Item property
See Also
FindResult Object on page 357
Find.SearchEx method (Find object) on page 350
Purpose
This property returns the matching score for close matches or zero for no match—100 (exact match).
Syntax
[FindMatch=]OBJECT.Item (index)
Part Description
FindResult Object
The FindResult object returns information about the FindRC in the form of properties that make it
easier to access the result of the find. FindResult contains a collection of features that contain either the
multiply matched features, or the closest matched features in priority order of how they scored in the
find. If an exact match is found, then the feature collection will only contain the ExactMatch feature.
Object properties
• FindResult.AddressOutOfRange property
• FindResult.ExactMatch property
• FindResult.FindRC property
• FindResult.IntersectionNotFound property
• FindResult.MatchedFeature property
• FindResult.Matches property
• FindResult.MultipleMatches property
• FindResult.RefineRegion property
• FindResult.Substitute property
See Also
Find.SearchEx method (Find object) on page 350
See Also
FindResult.MatchedFeature property (FindResult object) on page 358
FindResult.Matches property (FindResult object) on page 358
FindResult.MultipleMatches property (FindResult object) on page 358
See Also
Find.SearchEx method (Find object) on page 350
See Also
Find.SearchEx method (Find object) on page 350
See Also
Find.SearchEx method (Find object) on page 350
Object Properties
• Geoset.Centroid property
• Geoset.PathName property
• Geoset.UserName property
Collection Properties
• Geosets.Count property
• Geosets.Item property
See Also
Map object on page 427
See Also
Point Object and Points Collection on page 472
Graphic Object
Purpose
Each Annotation contains a Graphic object (Annotation.Graphic property) in which the symbol or text
style and location is stored.
Object Properties
• Graphic.Caption property
• Graphic.Position property
• Graphic.Style property
• Graphic.X property
• Graphic.Y property
See Also
Annotation Object and Annotations Collection on page 274
See Also
Annotation.Type property (Annotation object) on page 275
AnnotationTypeConstants on page 588
See Also
Annotation.Type property (Annotation object) on page 275
See Also
Style Object on page 507
Annotation.Type property (Annotation object) on page 275
See Also
Annotation.Type property (Annotation object) on page 275
AnnotationTypeConstants on page 588
Graphic.Position property (Graphic object) on page 361
See Also
Annotation.Type property (Annotation object) on page 275
AnnotationTypeConstants on page 588
Graphic.Position property (Graphic object) on page 361
Object Properties
• IndividualValueCategory.NumItems property
• IndividualValueCategory.Style property
• IndividualValueCategory.Value property
Collection Properties
• IndividualValueCategories.AllOthersCategory property
• IndividualValueCategories.Count property
• IndividualValueCategories.Item property
See Also
Legend Object on page 418
ThemeProperties.IndividualValueCategories property (ThemeProperties object) on page 537
Note: This property is only valid when MapX generates the theme (Theme.ComputeTheme =
TRUE). If you are manually calculating the theme (Theme.ComputeTheme = FALSE), then
NumItems will NOT reflect the number of items in the category and is undefined as a
result.
See Also
Style Object on page 507
Note: Setting the Value property does not affect the Legend.LegendTexts collection for the theme
because it has to be updated separately.
Syntax
IndividualValueCategory.Value property (IndividualValueCategory object) on page 364
See Also
Layer.Labels property (Layer object) on page 391
LabelProperties.LabelAlong property (LabelProperties object) on page 373
LabelProperties.LabelPartialObjects property (LabelProperties object) on page 374
See Also
Label.AnchorX property (Label object) on page 366
Label.AnchorY property (Label object) on page 366
See Also
Label.Angle property (Label object) on page 366
See Also
Label.Caption property (Label object) on page 366
See Also
Label.Style property (Label object) on page 370
See Also
Label.LineType property (Label object) on page 369
See Also
Label.MultiSegment property (Label object) on page 370
See Also
Label.Offset property (Label object) on page 370
See Also
Label.Position property (Label object) on page 370
See Also
Label.Visible property (Label object) on page 371
See Also
Layer.GetFeatureByKey method (Layer object) on page 390
See Also
Layer Object and Layers Collection on page 377
See Also
LineTypeConstants on page 597
See Also
LabelProperties.Offset property (LabelProperties object) on page 375
See Also
PositionConstants on page 601
See Also
Style Object on page 507
LabelProperties Object
The LabelProperties object contains properties that control how labels are drawn for the layer.
Object Properties
• LabelProperties.DataField
• LabelProperties.Dataset
• LabelProperties.Duplicate
• LabelProperties.LabelAlong
• LabelProperties.LabelMax
• LabelProperties.LabelPartialObjects
• LabelProperties.LabelZoom
• LabelProperties.LabelZoomMax
• LabelProperties.LabelZoomMin
• LabelProperties.LineType
• LabelProperties.Offset
• LabelProperties.Overlap
• LabelProperties.Parallel
• LabelProperties.PartialSegments
• LabelProperties.Position
• LabelProperties.Style
• LabelProperties.Visible
See Also
Layer Object and Layers Collection on page 377
See Also
LabelProperties.Dataset property (LabelProperties object) on page 372
Field object and Fields collection on page 340
Dataset causes the features to get labeled with the feature name. This is the default behavior. This takes
a Dataset object.
See Also
LabelProperties.DataField property (LabelProperties object) on page 372
Dataset object and Datasets collection on page 293
Remarks
The LabelAlong property replaces the old Parallel property, which we still support but have
deprecated to a hidden property. The parallel property dictated whether labels on lines and polylines
are not rotated or are drawn at the same angle as the line or polyline segment to which they are
anchored.
For objects other than polylines, if the property is set to miLabelAlongMultiSegment, the property is
ignored (i.e., for point and region objects). For line objects, if the property is set to
miLabelAlongMultiSegment, automatic labels are drawn as if the property is set to
miLabelAlongParallel.
See Also
LabelAlongConstants
Remarks
This property allows a label to be automatically displayed even if the centroid of the object is not in the
map view.
See Also
LabelProperties.LabelZoomMax property (LabelProperties object) on page 374
LabelProperties.LabelZoomMin property (LabelProperties object) on page 375
See Also
LabelProperties.LabelZoom property (LabelProperties object) on page 374
Map.MapUnit property (Map object) on page 445
See Also
LabelProperties.LabelZoom property (LabelProperties object) on page 374
Map.MapUnit property (Map object) on page 445
See Also
LabelProperties.Offset property (LabelProperties object) on page 375
See Also
LabelProperties.Position property (LabelProperties object) on page 376
LabelProperties.LineType property (LabelProperties object) on page 375
Remarks
The LabelProperties.Overlap is used only for auto labels. For manually labeled features, Overlap is
ignored.
Reordering Layers
Map layers display in a particular order. It is important to order your layers correctly. For example,
you have a layer of customer points and a layer of census tracts. If the layers are incorrectly ordered in
the map window, MapX might draw the customer points first and then display the census tract layer
second. Your points would be obscured beneath the census tract layer.
Zoom Layering
Sometimes you want a map layer to display only at certain zoom levels. Zoom Layering controls the
display of a map layer only when the map's zoom level falls within a preset distance.
For example, you have a layer of streets and a layer of ZIP Code boundaries. When you zoom out past
10 or so miles, the streets look like a black smudge in the window. This is because the zoom (window
width) is too wide to show detailed street maps. Use Zoom Layering to prompt MapX to display the
street layer only when the zoom is set to distance that allows you to see the street detail properly, for
instance, less than 5 miles.
The first map doesn't have zoom layering set for its street layer. At a zoom of 15 miles across, notice
how difficult it is to see any detail. The second map has zoom layering set to display the streets when
the zoom is less than five miles. Therefore, the streets layer does not display when the window is set at
15 miles.
You can set a different zoom layering level for each layer.
Object Properties
• Layer.AutoLabel property
• Layer.Bounds property
• Layer.ClippedBounds property
• Layer.CoordSys property
• Layer.DrawLabelsAfter property
• Layer.Editable property
• Layer.FileSpec property
• Layer.Find property
• Layer.KeyField property
• Layer.LabelProperties property
• Layer.Name property
• Layer.OverrideStyle property
• Layer.PredominantFeatureType property
• Layer.Selectable property
• Layer.Selection property
• Layer.ShowCentroids property
• Layer.ShowLineDirection property
• Layer.ShowNodes property
• Layer.Style property
• Layer.Type property
• Layer.Visible property
• Layer.ZoomLayer property
• Layer.ZoomMax property
• Layer.ZoomMin property
Object Methods
• Layer.AddFeature method
• Layer.AllFeatures method
• Layer.BeginAccess method
• Layer.ClearCustomLabels method
• Layer.DeleteFeature method
• Layer.DrilldownAddFeatures method
• Layer.DrilldownRemoveFeatures method
• Layer.DrilldownReset method
• Layer.FeatureIDFromFeatureName method
• Layer.FeatureKeyFromFeatureName method
• Layer.GetDrilldownFeaturesByID method
• Layer.GetFeatureByID method
• Layer.GetFeatureByKey method
• Layer.Invalidate method
• Layer.LabelAtPoint method
• Layer.NoFeatures method
• Layer.Refresh method
• Layer.Search method
• Layer.SearchAtPoint method
• Layer.SearchWithinDistance method
• Layer.SearchWithinFeature method
• Layer.SearchWithinRectangle method
• Layer.UpdateFeature method
Collection Properties
• Layers.AnimationLayer property
• Layers.Bounds property
• Layers.ClippedBounds property
• Layers.Count property
• Layers.Item property
Collection Methods
• Layers. Remove method
• Layers.Add method
• Layers.AddGeosetLayers method
• Layers.AddServerLayer method
• Layers.AddUserDrawLayer method
• Layers.ClearSelection method
• Layers.CreateLayer method
• Layers.InsertionLayer
• Layers.LayersDlg method
• Layers.Move method
• Layers.RemoveAll method
See Also
Map object on page 427
Syntax
[feature=]OBJECT.AddFeature (Source, [RowValues])
Part Description
See Also
Layer.AllFeatures method (Layer object) on page 380
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Syntax
[ Features= ]OBJECT.AllFeatures
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
Syntax
OBJECT.BeginAccess (BeginAccessType)
Part Description
Remarks
MapX programs written without using BeginAccess and EndAccess will work as before, but without
the performance enhancement for multiple operations.
You may nest calls to BeginAccess, however, only the first one has any effect.
See Also
Layer.EndAccess method (Layer object) on page 387
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in one layer.
See Also
Layers.Bounds property (Layers collection) on page 407
Syntax
[objAllFeaturesConstraint = ]OBJECT.CreateAllFeaturesConstraint
Remarks
The data that is held in the cache by this object is only held as long as the constraint (or some other
constraint) exists. Thus, specifying code such as:
lyr.CreateAllFeaturesObject.Enable = True
This code will creates constraint and that ensures that all records are cached as it is above). However,
the newly created constraint object is then destroyed releasing the records from the cache. To be
effective, the constraint object must be stored in a variable by the client and released (or set to Nothing
or Enabled = False) when the records are no longer needed.
Unlike the BoundsConstraint and FeaturesConstraint, the AllFeatures constraint is initially disabled
and will not ensure that all records are cached until the constraint is enabled.
See Also
AllFeaturesConstraint object on page 272
Feature Object and Features Collection on page 308
Syntax
[objBoundsConstraint = ]OBJECT.CreateBoundsConstraint
Remarks
The data that is held in cache by this object is only held as long as the constraint (or some other
constraint) exists. Thus, specifying code such as:
Set lyr.CreateBoundsObject.Bounds = rect
This code creates a constraint and sets the constraint's bounds. This will ensure records are cached.
However, the newly created BoundsConstraint object is then destroyed releasing the records from the
cache. To be effective, the BoundsConstraint object must be stored in a variable by the client and
released (or set to Nothing) when the records are no longer needed.
See Also
BoundsConstraint object on page 285
Rectangle Object on page 480
Syntax
[objFeaturesConstraint = ]OBJECT.CreateFeaturesConstraint
Remarks
The data that is held in the cache by this object is only held as long as the constraint (or some other
constraint) exists. Thus, specifying code such as:
Set lyr.CreateFeaturesObject.Features = ftrs
This code creates a constraint and set the constraint's features collection which ensures these records
are cached. However, the newly created FeaturesConstraint object is destroyed, releasing the records
from the cache. To be effective, the FeaturesConstraaint object must be stored in a variable by the client
and released (or set to Nothing) when the records are no longer needed.
See Also
FeaturesConstraint object on page 322
Feature Object and Features Collection on page 308
Remarks
Since this is a read-only property, you may NOT set it to another rectangle object.
Example
Set Map.Bounds = Map.Layer.ClippedBounds
See Also
Map.Bounds property (Map object) on page 430
Layer.Bounds property (Layer object) on page 381
Layers.ClippedBounds property (Layer collection) on page 407
See Also
CoordSys Object on page 288
Map.DisplayCoordSys property (Map object) on page 438
Map.NumericCoordSys property (Map object) on page 451
Syntax
OBJECT.ClearCustomLabels
Remarks
Layers that do not have Datasets (such as Raster and UserDraw) will return an empty collection.
Layer.Datasets will not support the Add or Restore methods. An exception is thrown if either are
used.
Adding a Dataset to Map.Datasets via Datasets.Add also adds that Dataset to the Datasets collection of
the layer it is bound to. Removing a Dataset from a Layer.Dataset collection, also removes it from
Map.Datasets, and vice versa.
See Also
Datasets.Add method (Datasets collection) on page 300
Map.Datasets property (Map object) on page 436
Syntax
OBJECT.DeleteFeature (FeatureKey)
Part Description
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
Syntax
OBJECT.DrilldownAddFeatures (Level, FeatureKeys)
Part Description
Remarks
This method does not actually alter the contents of any tables. The features that you are adding are
already in a table; by "adding" them to the layer, you make them visible.
Syntax
OBJECT.DrilldownRemoveFeatures (Level, FeatureKeys)
Part Description
Remarks
Method does not actually alter the contents of any tables. The features that you are removing are not
deleted from the table; by "removing" them, you simply make them disappear.
Syntax
OBJECT.DrilldownReset (Level)
Part Description
Remarks
This method resets the Drilldown layer so that it only shows features from one specific level. You
might use this method if you want to provide a "Reset" button, which restores the Drilldown layer to
its original state.
Syntax
OBJECT.EndAccess (endAccessType)
Part Description
Remarks
If Layer.BeginAccess was called with a beginAccessType of miAccessRead or miAccessReadWrite, the
EndAccessType parameter must be miAccessEnd.
MapX programs written without using BeginAccess and EndAccess will work as before, but without
the performance enhancement for multiple operations.
See Also
Layer.BeginAccess method (Layer object) on page 380
Syntax
[int=]OBJECT.FeatureIDFromFeatureName (Name)
Part Description
Syntax
[BSTR=]OBJECT.FeatureKeyFromFeatureName (KeyValue)
Part Description
Remarks
This method is not applicable for remote database layers (ODBC or OCI). Use the Layer.Search
method as an alternate means of locating a feature or features collection for a remote database layer.
See Also
Layer.KeyField property (Layer object) on page 391
Syntax
[Feature=]OBJECT.GetDrilldownFeaturesByID( strLevel, FeatureID)
Part Description
Syntax
[Feature=]OBJECT.GetFeatureByID( FeatureKey )
Part Description
Part Description
FeatureKey A string that identifies the feature. This is the value returned by
Feature.FeatureKey property. This is a replacement for Feature.FeatureID , which
still works as it did before, but it is recommended that you use the new FeatureKey
property.
The FeatureKey property is used to identify a unique record in a table. In previous
versions, the FeatureID property was used for this purpose, but it did not work
correctly for seamless and remote layers. The FeatureKey property works for all
layer types.
See Also
Feature.FeatureKey property (Feature object) on page 311
Feature.FeatureID property (Feature object) on page 311
Syntax
[Feature=]OBJECT.GetFeatureByKey (FeatureKey)
Part Description
See Also
Feature.FeatureKey property (Feature object) on page 311
Syntax
OBJECT.Invalidate ([InvalidRect])
Parts Description
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
Syntax
[ Labels= ]OBJECT.Labels
See Also
Label object and Labels collection on page 365
Syntax
OBJECT.LabelAtPoint (x, y)
Part Description
See Also
LabelProperties Object on page 372
Layer.AutoLabel property (Layer object) on page 380
Syntax
OBJECT.NoFeatures()
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
See Also
Layer.Style property
Note: Performing a Pack Table operation can corrupt your customized labels in MapInfo
Professional Workspaces. For additional information, please refer to the MapInfo
Professional Online Help System or Users Guide.
Syntax
OBJECT.Pack (PackType)
Part Description
Part Description
Remarks
Although packing a file's graphic information saves disk space, it may make graphic update
operations a little slower in that file; you are sacrificing processing speed for disk space. Alternatively,
if you have just created a TAB file by performing an import operation, you may want to pack the
graphic data.
Before you pack a table, make sure there is enough disk space to store a copy of the database as a
scratch file. You cannot pack a read-only file. Packing will also not be allowed on a table if the tabel’s
files can not be locked for write access. You cannot Pack a table for which you have called
Layer.BeginAccess method without calling a corresponding Layer.EndAccess method.
To rebuild the index and/or graphics files without removing the deleted records, specify the rebuild
options separately (e.g. Rebuild Graphics and/or Rebuild Index). For tighter packing of the index
and/or graphics files, specify the Pack option for the Index and/or Graphics. If the table is an Access
(DAO) table, you may also specify Compact in addition to the other options or by itself.
Call Layer.SupportsPack method befor calling Pack to see if the Layer’s table supports the desired
pack operation.
See Also
LayerPackConstants on page 599
Layer.SupportsPack method (Layer object) on page 400
Remarks
If the layer has an equal number of features of more than one type (eg 2 symbols and 2 regions) then
PredominantFeatureType will return miFeatureTypeMixed unless one of the types is Region in which
case PredominantFeatureType returns miFeatureTypeRegion.
Syntax
OBJECT.Refresh
See Also
LayerInfo Object on page 412
Working with the Cache on page 178
Syntax
[ Features collection= ]OBJECT.Search (strWhere, [Variables])
Part Description
Remarks
Layer.Search will not work on raster, seamless, or userdraw tables. If an expression uses an identifier
that is not a Dataset field name or a variable found in the variables collection, Layer.Search will throw
an exception.
If you use a string value in either a Boolean 'AND', 'OR', or 'NOT' expressesion, the string is
considered "True" if it has at least one character in it, and "False" if it is of zero length.
In expressions, MapX will perform a type conversion from boolean to string for function parameters
that expect a string argument.
When specifying dates as string constants, the following applies:
See Also
Creating Expressions on page 605
IDispatch Table on page 657
Geographic operators on page 606
Variable object and Variables collection on page 549
Syntax
[Features collection=]OBJECT.SearchAtPoint (Point, [SearchResultFlag])
Part Description
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.NoFeatures method (Layer object) on page 392
Layer.Invalidate method (Layer object) on page 390
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinFeature method (Layer object) on page 398
Syntax
OBJECT.SearchWithinDistance(Source, double Distance, short Units, short SearchType)
Part Description
Remarks
This method creates a buffer region around the source object, then searches within the buffer region.
After the search has been performed, the buffer is discarded; if you need to save the buffer, use the
BufferFeatures method instead.
The resolution of the buffer region (i.e. the number of nodes) is controlled by the
Map.DefaultConversionResolution property.
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
Syntax
OBJECT.SearchWithinFeature (Feature, SearchType)
Part Description
See Also
Selection.SelectByRegion method (Selection collection) on page 495
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.SearchWithinRectangle method (Layer object) on page 398
Layer.UpdateFeature method (Layer object) on page 401
Syntax
[features collection=]OBJECT.SearchWithinRectangle (Rectangle, SearchType)
Part Description
See Also
Layer.AddFeature method (Layer object) on page 379
Layer.DeleteFeature method (Layer object) on page 384
Layer.Invalidate method (Layer object) on page 390
Layer.NoFeatures method (Layer object) on page 392
Layer.SearchAtPoint method (Layer object) on page 396
Layer.SearchWithinFeature method (Layer object) on page 398
Layer.SearchWithinDistance method (Layer object) on page 397
Layer.UpdateFeature method (Layer object) on page 401
See Also
Selection Collection on page 489
See Also
Layer.OverrideStyle property (Layer object) on page 393
Syntax
[bool=]OBJECT.SupportsPack (PackType)
Part Description
See Also
Layer.Pack method (Layer object) on page 393
LayerPackConstants on page 599
• miLayerTypeRaster = 2
• miLayerTypeSeamless = 4
• miLayerTypeUnknown = 5
• miLayerTypeUserDraw = 6
Syntax
OBJECT.UpdateFeature (Target, [Source], [RowValues])
Part Description
Remarks
This method should not be used to update a computed column, but will not throw an exception if you
are trying to do so. The reason for this for this is that the RowValues collection may contain both
computed columns and non-computed columns.
When the Computetheme property is set to false that the legend.showemptyranges property must be
set to true in order for the theme's legend text(s) to be visible. This is because MapX does not calculate
theme category counts when computetheme is set to false.
Columns named or aliased with name of MI_PRINX or PRINX are not updateable.
Note: Layer.UpdateFeature will not throw exceptions when one attempts to update non-
updateable columns. Oracle layer columns of the following datatypes are not updateable
and will not envoke exceptions if you try to update them:
• Long
• Raw
• LOB,BFILE
See Also
RowValue Object and RowValues Collection on page 485
Feature Object and Features Collection on page 308
See Also
Layer.ZoomMax property (Layer object) on page 402
Layer.ZoomMin property (Layer object) on page 403
See Also
Layer.ZoomMax property (Layer object) on page 402
Layer.ZoomMin property (Layer object) on page 403
See Also
Layer.ZoomLayer property (Layer object) on page 402
Map.MapUnit property (Map object) on page 445
Syntax
[Layer=]OBJECT.Add (LayerInfo, [Position])
Part Description
Remarks
The layer is positioned automatically with respect to other layers in the map. For example, the layer
with points is placed above a layer with regions.
If a string is passed for the LayerInfo parameter, it is treated as a file specification with the following
interpretation:
• .tab extension is treated as a .tab file.
• Any other extension is treated as a self-registering raster file.
• No extension is treated as a geodictionary user name.
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a layer
name ( as in the "name" parameter of the LayerInfo object, Layers.AddUserDrawLayer, and
Layers.AddServerLayer, an exception will be thrown if the name is not unique.
When the type property of LayerInfo is 'NewTab' and the 'Fields' parameter has a 'string' field of
length 255 or greater, an exception will be thrown. The field length is based upon the 254 length limit
of MapInfo Professional.
Syntax
OBJECT.AddGeosetLayers (GeosetName)
Part Description
See Also
Map.GeoSet property (Map object) on page 443
Syntax
[Layer=]OBJECT.AddServerLayer (Name, ConnectString, Query, [ Position ], [ServerLayerOptions] )
Part Description
Part Description
miLayerCacheOn Attributes and objects which have been read in will be kept in
memory. This will make map interaction (such as zooming, labeling,
themes and panning) faster. However, the latest updates to the data
will not be shown until Layer.Refresh is called.
miLayerCacheOff All data will be fetched from the database each time the layer is
drawn. This will be less efficient, but it will give the most up to date
data.
miLayerMBRSearchOn This will cause an MBRSearch predicate to be added to the spatial
query when retrieving the data.
miLayerMBRSearchOff Turns off the MBRSearch predicate that is appended to the query
when the Map is drawn. This is useful for queries which already
contain a spatial predicate and where an additional spatial predicate
should be avoided.
Remarks
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a layer
name ( as in the "name" parameter of the LayerInfo object, Layers.AddUserDrawLayer, and
Layers.Add), an exception will be thrown if the name is not unique.
This adds ODBC layers ONLY. Oracle Spatial layers must be added via Layers.Add with the
LayerInfo object.
See Also
Layers.Add method (Layers collection) on page 403
LayerInfo Object on page 412
Syntax
OBJECT.AddUserDrawLayer (Name, Position)
Part Description
Remarks
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a layer
name ( as in the "name" parameter of the LayerInfo object, Layers.AddServerLayer, and
Layers.Add), an exception will be thrown if the name is not unique.
Initially AnimationLayer is set to null. You can assign a Layer object to the property to make that Layer
the animation layer (it can be a regular layer or user draw layer). When a layer is assigned to the
AnimationLayer property, it is drawn on top of all layers, including the annotations layer and
selections. The layer is still in the same position in the layers collection. Floating objects like legends
are still displayed on top of the animation layer, although they don't have to be re-drawn each time
because they are clipped out. If a normal layer is used as the animation layer, selections and labeling
will still work.
To turn off the animation layer, you assign null to it:
Set Map.Layers.AnimationLayer = nothing
This turns the layer back into a normal layer, which is still positioned in the same place in the layer list.
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in all layers.
See Also
Layer.Bounds property (Layer object) on page 381
Remarks
Since this is a read-only property, you may NOT set it to another rectangle object.
Example
Set Map.Bounds = Map.Layers.ClippedBounds
See Also
Map.Bounds property (Map object) on page 430
Layer.Bounds property (Layer object) on page 381
See Also
Selection.ClearSelection method (Selection collection) on page 490
Note: This is a 'deprecated' method that still works for backward compatability. The new way to
create a layer is to use Layers.Add with a Layerinfo object.
Syntax
[Layer=]OBJECT.CreateLayer (Name , [FileSpec] , [Position] , [KeyLength] , [CoordSys])
Part Description
Remarks
The method returns a Layer object-the Layer object that was added to the collection. The new layer is
created with a key column named "GEONAME".
Remarks
You cannot make a drill-down, raster, seamless or user-draw layer the insertion layer.
The layer's editable property must be set to true before you can make that layer the InsertionLayer.
At any time only one layer can be designated the insertion layer.
The AddPoint, AddLine, AddRegion and AddPolyLine stock tools (object creation tools) will add
features to the layer designated as the insertion layer.
You cannot set Map.CurrentTool to any of the object creation tools until you've specified an insertion
layer.
Syntax
[Boolean=]OBJECT.LayersDlg ([HelpFile], [HelpID])
Part Description
Part Description
Remarks
If you specify both the HelpFile and the HelpID, the dialog includes a Help button; if the user clicks
the Help button, MapX displays the specified Help topic.
The return value of LayersDlg is True if the user clicked OK and False if the user clicked Cancel.
Example
The following statement displays the Layer Control dialog box
Map1.Layers.LayersDlg
Syntax
OBJECT.Move (From, To)
Part Description
Remarks
The order of layers in the Layers collection controls draw order. When layers are added using
Layers.Add or Layers.AddGeosetLayers, the layers are intelligently inserted into the layer collection.
For example, layers with points are put above layers with lines, and layers with lines are put above
layers with regions, and layers with regions are put above raster layers.
Syntax
OBJECT.Remove (Index)
Part Description
Remarks
If a Layer is removed from the Layers collection by the Layers.Remove method, the datasets associated
with the layer will also be deleted from the Datasets collection.
If you remove an item, the collection indexes are renumbered to fill in the hole left by the item
removed.
Syntax
OBJECT.RemoveAll
LayerInfo Object
A LayerInfo object is the first argument passed to Layers.Add. The LayerInfo object passed to
Layers.Add describes/defines the layer to be added. The Type property of the LayerInfo object
determines what parameters the object must have, that is, the parameters that any given LayerInfo
object must have will vary depending on the type of layer being added. The LayerInfo.AddParameter
method is used to set these parameters. LayerInfo.Type is set to one of the LayerInfoTypeConstants.
The table below displays the parameters that need to be used for each layer type.
Requir
LayerInfoType Parameter Type
ed
Requir
LayerInfoType Parameter Type
ed
Requir
LayerInfoType Parameter Type
ed
Requir
LayerInfoType Parameter Type
ed
Remarks
To improve performance, you can specify the TableStorageType as "memtable".
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a layer
name ( as in the "name" parameter of the Layers.AddServerLayers, Layers.AddUserDrawLayer, and
Layers.Add), an exception will be thrown if the name is not unique.
miLayerInfoTypeTemp is a temporary layer that lasts until the MapX control is closed, then the layer is
discarded. It is never saved to disk. One may specify a layer name, but not a filespec.
miLayerInfoTypeNewTable is a layer that can be generated from external data (i.e. query results).
For miLayerInfoTypeTemp and miLayerInfoTypeNewTable:
• Either a Fields collection or a Features collection is required; both can be used.
• If only a Features collection is passed, MapX will try to get the column information from the
table the Features came from.
• If a Features collection and a Fields collection are passed, MapX will try to match the field
names passed in with the columns found in the table the Features came from.
• If only a Fields collection is passed, check the layer for a Dataset of type miDatasetLayer. If
found, check the passed-in Fields against the columns in the miDatasetLayer. If the
miDatasetLayer Dataset isn't present, create the table solely on the Fields information passed
in.
• The Fields default should be columns found in the Features collection's source table.
When using the LayerInfo object to add a .tab that references a raster, remote table, etc, use LayerInfo
type miLayerInfoTypeTab. LayerInfo type LayerInfoTypeRaster is used specifically for adding self-
registering raster files that do not have an associated .tab file. LayerInfo type
LayerInfoTypeServerLayer is used specifically for adding remote tables that do not have an associated
.tab file.
Object Properties
• LayerInfo.Type property
• LayerInfo.Parameter property
Object Methods
• LayerInfo.AddParameter method
See Also
Layers.Add method (Layers collection) on page 403
Working with the Cache on page 178
See Also
LayerInfo.AddParameter method (LayerInfo object) on page 417
Layers.Add method (Layers collection) on page 403
Syntax
OBJECT.AddParameter (name, value)
Part Description
Remarks
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a layer
name (in a layerinfo "name" param, addserverlayer, or adduserdrawlayer), an exception will be
thrown if the name is not unique.
See Also
Layers.Add method (Layers collection) on page 403
Example
To get the value of an existing parameter (e.g. CoordSys) do the following:
Set oCoordSys = oLayerInfo.Parameter("CoordSys")
To modify an existing or add a new parameter (e.g. Style), use method AddParameter or use the
Parameter property as follows:
Set oLayerInfo.Parameter("Style") = Map1.Layers("MyLayer").Style
Note: Set is only used when setting objects. Other properties such as strings or numbers do not
require the Set statement.
Legend Object
Purpose
Each Theme object has a Legend object (Theme.Legend). The Legend object contains properties to
control the display of a theme's legend. Each ThemeCategory object (RangeCategory,
IndividualValueCategory, or MultiVarCategory) has an entry in the legend contained in a LegendText
object.
Object Properties
• Legend.BodyTextStyle property
• Legend.Compact property
• Legend.CompactTitle property
• Legend.CompactTitleStyle property
• Legend.CurrencyFormat property
• Legend.Height property
• Legend.Left property
• Legend.LegendTexts property
• Legend.PaperHeight property
• Legend.PaperWidth property
• Legend.ShowCount property
• Legend.ShowEmptyRanges property
• Legend.SubTitle property
• Legend.SubTitleStyle property
• Legend.Title property
• Legend.TitleStyle property
• Legend.Top property
• Legend.Visible property
• Legend.Width property
Object Methods
• Legend.ExportLegend method
• Legend.LegendDlg method
• Legend.PrintLegend method
See Also
Style Object on page 507
See Also
Map.PreferCompactLegends property (Map object) on page 452
See Also
Style Object on page 507
Syntax
OBJECT.ExportLegend (Destination, Format)
Part Description
See Also
Map.ExportMap method (Map object) on page 440
Note: You can drag the legend outside the bounds of the MapX control in a form and not be able
to drag it back (if you release the mouse button with the legend off the screen).
It is possible, however, to programmatically reset the Left and Top properties of the object to be within
the bounds of the map. This also applies to map titles and annotations.
Syntax
[Boolean=]OBJECT.LegendDlg([ HelpFile ] [ HelpID ])
Part Description
Remarks
If either of the optional parameters are not given, the help button will not appear on the dialog.
The return value of LegendDlg is True if the user clicked OK and False if the user clicked Cancel.
See Also
LegendText Object and LegendTexts Collection on page 425
See Also
Map.PaperUnit property (Map object) on page 452
See Also
Map.PaperUnit property (Map object) on page 452
Syntax
OBJECT.PrintLegend (hDC, x, y, w, h)
Part Description
Remarks
The current legend is drawn to fit the rectangle given. Best results are obtained when the aspect ratio
of width to height is maintained.
See Also
Style Object on page 507
See Also
Style Object on page 507
Note: You can drag the legend outside the bounds of the MapX control in a form and not be able
to drag it back (if you release the mouse button with the legend off the screen).
It is possible, however, to programmatically reset the Left and Top properties of the object
to be within the bounds of the map. This also applies to map titles and annotations.
Object Properties
• LegendText.Text property
• LegendText.Visible property
Collection Properties
• LegendTexts.AllOthersText property
• LegendTexts.AutoGenerate property
• LegendTexts.Count property
• LegendTexts.Item property
See Also
Theme Object and Themes Collection on page 526
See Also
Theme Object and Themes Collection on page 526
Theme.AutoRecompute property (Theme object) on page 526
See Also
Theme.AutoRecompute property (Theme object) on page 526
Map object
Maps are the basic building blocks for MapInfo MapX. Each map is defined by Dataset, Layer and
Annotations objects and collections.
Object Properties
• Map.Annotations property
• Map.AreaUnit property
• Map.AutoRedraw property
• Map.BackColor property
• Map.Bounds property
• Map.CenterX property
• Map.CenterY property
• Map.CurrentTool property
• Map.Dataset property
• Map.DatasetGeoField property
• Map.Datasets property
• Map.DatasetTheme property
• Map.DefaultConversionResolution property
• Map.DefaultStyle property
• Map.DisplayCoordSys property
• Map.ExportSelection property
• Map.FeatureEditMode property
• Map.FeatureFactory property
• Map.GeoDictionary property
• Map.GeoSet property
• Map.GeoSets property
• Map.GeoSetWidth property
• Map.hWnd property
• Map.InfotipPopupDelay property
• Map.InfotipSupport property
• Map.Layers property
• Map.MapPaperHeight property
• Map.MapPaperWidth property
• Map.MapScreenHeight property
• Map.MapScreenWidth property
• Map.MapUnit property
• Map.MatchNumericFields property
• Map.MatchThreshold property
• Map.MaxSearchTime property
• Map.MouseIcon property
• Map.MousePointer property
• Map.MouseWheelSupport property
• Map.NumericCoordSys property
• Map.PanAnimationLayer property
• Map.PaperUnit property
• Map.PreferCompactLegends property
• Map.RedrawInterval property
• Map.ReuseEquivalentOnRestore property
• Map.Rotation property
• Map.SearchPath property
• Map.SelectionStyle property
• Map.Title property
• Map.TitleText property
• Map.Version property
• Map.WaitCursorEnabled property
• Map.Zoom property
Object Methods
• Map.AboutBox method
• Map.ClipLine method
• Map.CliplineV method
• Map.ConvertCoord method
• Map.ConvertCoordP method
• Map.ConvertCoordV method
• Map.CreateCustomTool method
• Map.Distance method
• Map.ExportMap method
• Map.IsPointVisible method
• Map.Pan method
• Map.PrintMap method
• Map.PropertyPage method
• Map.Refresh method
• Map.SaveMapAsGeoset method
• Map.SetSize method
• Map.ZoomTo method
See Also
Dataset object and Datasets collection on page 293
Layer Object and Layers Collection on page 377
Annotation Object and Annotations Collection on page 274
Syntax
OBJECT.AboutBox
See Also
Annotation Object and Annotations Collection on page 274
Remarks
Set AutoRedraw to FALSE to turn screen updating off, or TRUE to resume normal screen updating.
When property or methods cause the map to change (such as Map.Zoom), the map gets redrawn. If
you want to make several changes to the map, this property lets you turn off redrawing, make the
several changes, then turn redrawing back on. This will prevent the numerous redraws you would get
otherwise. When set to TRUE, the entire map is redrawn.
Remarks
Since MapX has just one top level color property, it is selected by default and the property name
combo box is disabled. You may choose one of the colors and it is highlighted and the system color
combo is empty. Alternatively, you may pick a system color.
See Also
OLE_COLOR Values on page 655
See Also
Rectangle Object on page 480
Remarks
The CenterX property is set when a new Geoset is loaded.
See Also
Map.CenterY property (Map object) on page 430
Map.ZoomTo method (Map object) on page 460
Remarks
The CenterY property is set when a new Geoset is loaded.
See Also
Map.CenterY property (Map object) on page 430
Map.ZoomTo method (Map object) on page 460
Syntax
[ Boolean= ]OBJECT.ClipLine (X1, Y1, X2, Y2)
Part Description
Remarks
All parameters are passed by reference and should be in the Map.NumericCoordSys coordinate
system.
The return value of ClipLine is True if any portion of the line fell inside the view rectangle, and False
otherwise.
If the line is completely within the Map window, none of the parameters will be affected and ClipLine
will return True. If some section of the line is within the map window, the coordinates will be adjusted
so that they form the portion of the line that is within the view window, and ClipLine will return True.
If the line is completely outside the map window, the coordinates will not be affected and ClipLine
will return False.
See Also
Map.CliplineV method (Map object) on page 432
Layers.AddUserDrawLayer method (Layers collection) on page 406
Map.NumericCoordSys property (Map object) on page 451
Syntax
[ Boolean= ] OBJECT.ClipLineV(X1, Y1, X2, Y2)
Part Description
All parameters are variants which are passed by reference. They are expected to contain numeric
values and should be in the Map.NumericCoordSys coordinate system. An exception code 1111 is
thrown if any of the parameters could not be converted to a number.
The return value of ClipLineV is True if any portion of the line fell inside the view rectangle, and False
otherwise.
If the line is completely within the Map window, none of the parameters will be affected and
ClipLineV will return True. If some section of the line is within the map window, the coordinates will
be adjusted so that they form the portion of the line that is within the view window, and ClipLineV
will return True. If the line is completely outside the map window, the coordinates will not be affected
and ClipLineV will return False.
See Also
Map.ClipLine method (Map object) on page 431
Map.NumericCoordSys property (Map object) on page 451
Syntax
OBJECT.ConvertCoord (ScreenX, ScreenY, MapX, MapY, Dir)
Part Description
Either the Screen coordinates or the Map coordinates are provided, and the others are filled out based
on the Dir specified.
Syntax
Object.ConvertCoordP(X , Y , Dir)
Part Description
Syntax
OBJECT.ConvertCoordV (ScreenX, ScreenY, MapX, MapY, Dir)
Part Description
Either the Screen coordinates or the Map coordinates are provided, and the others are filled out based
on the Dir specified.
Note: If you create a Custom Tool of type circle and in theTool_Used event of the MapX control
do a SelectByRadius with the values passed into the event, the results are not the same as if
you select objects with the Radius Select Tool. The SelectByRadius method will not select
exactly what is under the circle drawn on the Control when the custom tool is being used
because this circle is an approximation that does not consider the projection of the map.
Selections made with the actual Radius Select Tool correspond exactly to what is under the
circle.
Syntax
OBJECT.CreateCustomTool (ToolNumber, Type, Cursor, [ShiftCursor] , [CtrlCursor], [InfoTips])
Part Description
Part Description
ToolNumber Number of the tool used to reference it later. This value can be an integer
between 1 and 999.
Type The type describes the tool behavior. This takes a ToolTypeConstants value.
Cursor Cursor shape when the tool created is the CurrentTool and the cursor is over
the map. This takes a CursorConstants value -OR- a custom cursor file name.
ShiftCursor Variant: A CursorConstants value, indicating the cursor that should appear
while the SHIFT key is held down. Optional. If omitted, the SHIFT key has no
effect on the cursor.
CtrlCursor Variant: A CursorConstants value, indicating the cursor that should appear
while the CTRL key is held down. Optional. If omitted, the CTRL key has no
effect on the cursor.
InfoTips Boolean: Set to true if you want to show InfoTips. Default value is false.
Remarks
Custom tools can be created to build tools that perform specialized behavior. For example, a tool could
be built to have the behavior of displaying information about the object that was clicked on. Here, we
would define a tool of type miToolTypePoint, and in the ToolUsed event handler, write code to display
information about the object that falls under the point that was clicked on (using Layer.SelectByPoint).
See Also
Map.CurrentTool property (Map object) on page 435
Remarks
Different tools will cause the mouse to perform a variety of different tasks. For example, if the current
tool is set to miLabelTool, when you click the mouse, it will place a label on that particular map object.
The mouse cursor will change based on the tool you are using.
If you have defined a custom tool, set it to the CurrentTool by specifying its ToolNumber.
See Also
Map.CreateCustomTool method (Map object) on page 434
Remarks
Visual Basic will display a list of all of the Data Controls on the current form in the Visual Basic
property sheet for MapX. Choosing one of the Data Controls in the list for the Dataset property will
cause MapX to create a Dataset for it at Run time with the data defined by the DataControl.
This is similar to Datasets.Add method. However, since this takes no parameters, it assumes default
behavior for the rest of the parameters. The GeoField parameter can be specified using the
Map.DatasetGeoField property. You can also choose which fields (columns) and aggregation methods
to use for each field on the MapX Data property page.
See Also
Datasets.Add method (Datasets collection) on page 300
Map.DatasetGeoField property (Map object) on page 436
Remarks
This is similar to the GeoField parameter of the Datasets.Add method, but specifying the GeoField for
the Dataset specified at Design time.
See Also
Map.Datasets property (Map object) on page 436
Datasets.Add method (Datasets collection) on page 300
See Also
Dataset object and Datasets collection on page 293
Remarks
If you are specifying a Dataset at Design time (Map.Dataset property), then you can have that data
thematically mapped. This controls the theme style. This is similar to the Themes.Add method, but is
available at Design time. You can choose which field or fields to base your theme on in the MapX
Theme tab of the property page.
The DatasetTheme property is ignored if the Dataset property is not set.
See Also
Themes.Add method (Themes collection) on page 530
Map.Datasets property (Map object) on page 436
Remarks
Various methods (listed below) allow you to explicitly specify an optional resolution parameter. If you
do not specify a resolution value, MapX uses the resolution setting specified by the
DefaultConversionResolution property.
This property affects the generation of buffers, circles, ellipses, and arcs. When generating these types
of features, you can control the resolution (sometimes called the "smoothness") of the features. For
example, the following table shows two different circular regions-one containing 10 nodes, and the
other containing 30 nodes.
Circular region with 10 nodes Circular region with 30 nodes
Increasing the resolution produces a smoother looking region; however, such regions take longer to
generate, and the resulting object requires more storage space.
This property also controls the resolution used when a MapInfo table contains an arc, circle, rectangle,
or rounded rectangle feature, and MapX converts the feature into a region or polyline.
See Also
FeatureFactory.BufferFeatures method (FeatureFactory object) on page 325
FeatureFactory.CreateArc method (FeatureFactory object) on page 327
FeatureFactory.CreateCircularRegion method (FeatureFactory object) on page 330
FeatureFactory.CreateEllipticalRegion method (FeatureFactory object) on page 332
Layer.SearchWithinDistance method (Layer object) on page 397
See Also
Style Object on page 507
Note: If a map includes one or more raster image layers, MapX automatically displays the map
in the projection specified by the most visible raster image. The coordinate system could
then change as the map view changes (due to zooming or panning) if a different raster
image with a different projection becomes the most visible. In this case, you cannot change
the map's display coordinate system.
Remarks
The Map.DisplayCoordSys represents the coordinate system (or "projection") in which the map is
displayed. By default, the map's coordinate system is set by the geoset. By modifying the map's
DisplayCoordSys (through the CoordSys.Set method), you can display the map in another coordinate
system.
The Map.DisplayCoordSys property only affects the appearance of the map. To access the coordinate
system used to interpret or return map coordinates, use the Map.NumericCoordSys property.
See Also
”Chapter 13: Using Coordinate Systems” on page 191
CoordSys Object on page 288
Map.NumericCoordSys property (Map object) on page 451
Syntax
[ distance = ]OBJECT.Distance( x1,y1,x2,y2 )
Part Description
Remarks
The distance is calculated using the Great Circle Calculation.
See Also
CoordSys Object on page 288
Map.NumericCoordSys property (Map object) on page 451
Map.MapUnit property (Map object) on page 445
Remarks
This property is false by default. It will affect only rectangle and radius selection tools. The behavior of
the tools themselves are the same.
Remarks
The Labels Collection can always be used to edit labels programatically regardless of the value of
Map.EditableLabels. Map.EditableLabels controls whether users can edit labels (select and move)
using the Select Tool.
The LabelChanged event is fired when this property is True and the user uses the Select tool to select
or move labels
See Also
Label object and Labels collection on page 365
LabelChanged Event on page 557
BMP
Note: If using MapX Mobile, you may only export in BMP. Attempting to export in alternative
formats will generate an error.
Syntax
OBJECT.ExportMap (Location, Format, [Width], [Height])
Part Description
Remarks
If features on the map are selected, you might not want to output the selection highlighting; see
Map.ExportSelection property.
See Also
Map.ExportSelection property (Map object) on page 441
Map.PaperUnit property (Map object) on page 452
See Also
Map.ExportSelection property (Map object) on page 441
Map.PrintMap method (Map object) on page 453
Map.SelectionStyle property (Map object) on page 457
Remarks
This property returns a FeatureFactory object, which has methods that support various editing tasks-
creating features, generating buffer regions, combining features, and testing for intersections between
features.
See Also
FeatureFactory Object on page 325
Remarks
When a map control is created, MapX will query the registry key:
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX\5.0\<Value of GeoDictonary Property>
The value of this registry key specifies two things:
• The GeoDictionary file, which maintains information about which map layers can be
matched to which information. (MapX can be used without a GeoDictionary.)
• The default data directory. This directory is searched for GeoSet files (*.gst) which are shown
in the Property Pages and the Map.GeoSets collection.
There are three valid options for the registry value:
• Full file spec for the Geodictionary file (e.g. "C:\Program Files\MapInfo
MapX\Maps\geodict.dct"). The data directory is set to be the path leading to the
Geodictionary file named by this key (in this example, "C:\Program Files\MapInfo
MapX\Maps\". The in-memory geodictionary is initialized from the Geodictionary file and
layers contained in the Geodictionary can be automatically matched against it too. Layers
added to the map are added to the in-memory geodictionary so they can be auto matched
against.
• Path specification (e.g. "C:\Program Files\MapInfo MapX\Maps\"). The data directory is
set to this directory. The in-memory geodictionary is initialized empty. Layers added to the
map are still added to the in-memory geodictionary so they can be auto matched against.
• Empty. The in-memory geodictionary is initialized empty. Layers added to the map are still
added to the in-memory geodictionary so they may be auto matched.
The default value of Map.GeoDictionary is "GeoDictionary", meaning that MapX will query the
registry entry HKEY_LOCAL_MACHINE\Software\MapInfo\MapX\5.0\GeoDictionary.
See Also
Map.GeoSet property (Map object) on page 443
Remarks
A GeoSet is a collection of map layers and their settings. A GeoSet can be specified at Design time. If
this is set during Run time, it will first remove all loaded layers and Datasets, then load the new
geoset. To simply remove all loaded layers and Datasets and not load a new geoset, specify an empty
string. The default GeoSet that is loaded is US.GST.
See Also
Geoset Object and Geosets Collection on page 359
Remarks
When InfoTipSupport is True, InfoTips will pop up for the following tools: Arrow Tool, Select Tool,
Label Tool, and any custom tools where the ShowInfoTips parameter to Map.CreateCustomTool was
True.
Infotips only look at the selectable layers. It also searches the layer list from top to bottom. Therefore,
if objects from one layer obscure another, you will only see infotips for uppermost objects.
See Also
Map.InfotipPopupDelay property (Map object) on page 444
Map.CreateCustomTool method (Map object) on page 434
See Also
Map.InfotipSupport property (Map object) on page 444
Syntax
[ bool= ] OBJECT.IsPointVisible (X, Y )
Part Description
See Also
Layer Object and Layers Collection on page 377
Syntax
[ strPoint= ]OBJECT.MilitaryGridReferenceFromPoint (dblX, dblY)
Part Description
Example
Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Dim MapX As Double
Dim MapY As Double
Dim s As String
s = Map1.MilitaryGridReferenceFromPoint(MapX, MapY)
Dim b As Boolean
Dim dx As Double
Dim dy As Double
b = Map1.MilitaryGridReferenceToPoint(s, dx, dy)
Dim vx As Variant
Dim vy As Variant
b = Map1.MilitaryGridReferenceToPointV(s, vx, vy)
Syntax
[ bool= ] OBJECT.MilitaryGridReferenceToPointV (strMGRS, vX, vY)
Part Description
Example
Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Dim MapX As Double
Dim MapY As Double
Dim s As String
s = Map1.MilitaryGridReferenceFromPoint(MapX, MapY)
Dim b As Boolean
Dim dx As Double
Dim dy As Double
b = Map1.MilitaryGridReferenceToPoint(s, dx, dy)
Dim vx As Variant
Dim vy As Variant
b = Map1.MilitaryGridReferenceToPointV(s, vx, vy)
Syntax
[ bool= ] OBJECT.MilitaryGridReferenceToPointV (strMGRS, dblX, dblY)
Part Description
Example
Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Dim MapX As Double
Dim MapY As Double
Dim s As String
s = Map1.MilitaryGridReferenceFromPoint(MapX, MapY)
Dim b As Boolean
Dim dx As Double
Dim dy As Double
b = Map1.MilitaryGridReferenceToPoint(s, dx, dy)
Dim vx As Variant
Dim vy As Variant
b = Map1.MilitaryGridReferenceToPointV(s, vx, vy)
Remarks
If Map.MousePointer is set to miCustomCursor and Map.MouseIcon has not been set yet, then the
cursor will be drawn with the shape of miDefaultCursor. The MousePointer property will still have a
value of miCustomCursor (40). As soon as the Map.MouseIcon is properly set, then the new cursor
shape will be used.
Alternatively, the MouseIcon and MousePointer properties can be set via the MapX properties dialog.
Simply right click your map and select the Mouse tab.
See Also
Map.MousePointer property
CursorConstants
Remarks
If Map.MousePointer is set to miCustomCursor (40) and Map.MouseIcon has not been set yet, then
the cursor will be drawn with the shape of miDefaultCursor.The MousePointer property will still
have a value of miCustomCursor.As soon as the Map.MouseIcon is properly set, then the new cursor
shape will be used.
Note: If a map includes one or more raster image layers, MapX automatically displays the map
in the projection specified by the most visible raster image. The coordinate system could
then change as the map view changes (due to zooming or panning) if a different raster
image with a different projection becomes the most visible. In this case, you cannot change
the map's display coordinate system.
Remarks
The NumericCoordSys represents the coordinate system used to process numeric map coordinates.
The default coordinate system is Longitude/Latitude WGS-84. By modifying the map's
NumericCoordSys (through its CoordSys.Set method), you can work with map coordinates in another
coordinate system.
The NumericCoordSys property does not affect the appearance of the map. To set the coordinate
system (or "projection") in which the map is displayed, use the Map.DisplayCoordSys property.
See Also
”Chapter 13: Using Coordinate Systems” on page 191
Syntax
OBJECT.Pan (ScreenX, ScreenY)
Part Description
Remarks
When legends are created, they can be compact or full sized. When a thematic map is created, a legend
is always shown. This setting controls how the legend will be shown. The legend can always be
changed later using the Theme.Legend.Compact or Theme.Legend.Visible settings, but the initial
setting controls the position of the legend.
Syntax
OBJECT.PrintMap (hDC x, y, w, h)
Part Description
Remarks
The current map is drawn to fit the rectangle given. Best results are obtained when the aspect ratio of
width to height is maintained.
If features on the map are selected, you might not want to output the selection highlighting; see
Map.ExportSelection property.
Syntax
OBJECT.PropertyPage
3000) effectively turns off incremental drawing -- the screen won't be updated until the map is
completely drawn off screen.
Remarks
Currently, the map is drawn to an off-screen bitmap, then transferred to the screen when the bitmap is
complete. Now, you can transfer to the screen more often to show the user that something is indeed
happening. (This is especially useful when drawing streets at 25 mile zoom.)
Syntax
OBJECT.Refresh
Remarks
Normally when an action is taken that causes the Map to be redrawn, MapX won't actually redraw
until it receives a paint message, so that it can combine multiple redraws into one. This method causes
MapX to redraw immediately, without waiting for the next paint message. This method will not return
until the redraw is complete.
See Also
Map.AutoRedraw property (Map object) on page 429
Example
The following example saves and restores a Map with a dataset called "Dataset1":
Remarks
This property is very useful in MapXtreme applications to speed up the process of restoring the Map
object state on each session request. Restoring a dataset can be an expensive operation because MapX
must bind and read all data from an external source (such as ADO.) Allowing MapX to reuse a dataset
that matches the one being restored bypasses having to bind and read from an external source.
Setting the value of this property does not guarantee that MapX will find a matching dataset. For
example, if you have an ASP application that shares a MapX object between sessions, and the
application allows each session to add or remove a dataset, when each session restores its Map state,
the map might or might not have the dataset. If MapX does not find a matching dataset, you must call
Datasets.Restore to completely restore the dataset. You can find out if MapX found a matching dataset
by calling Datasets.Contains.
Keep in mind that if your external source changes frequently (e.g. while a session is active) you might
not want to reuse existing datasets. If the data does not change frequently, you can start with a new
dataset on the first session request and then allow MapX to reuse existing datasets, if present, during
subsequent session requests.
See Also
State Object on page 499
Datasets.Contains method (Datasets object) on page 302
Note: A map containing one or more raster layers cannot be rotated, because MapX is unable to
rotate raster images.
Syntax
OBJECT.SaveMapAsGeoset (name, filespec)
Part Description
Remarks
If the map contains any temporary layers, user draw layers, or remote layers added via
miLayerInfoTypeServer, those layers are left out of the new geoset file and an exception is thrown
(after the geoset has been saved). Remote layers added via .tab file are saved in the resulting geoset.
This method also throws an exception if there are no layers in the map. Also, shape files(*.shp) can not
be saved into a geoset.
Remarks
This property returns a read/write Style object that controls the appearance of selected features in all
layers.
To control the appearance of selected regions, set this Style object's RegionXXX properties, such as
RegionColor. The RegionColor and RegionBorderXXX properties are used to draw the box around
selected symbol features. The LineXXX properties are used to draw selected line features. Note that the
SymbolXXX and TextXXX properties do not apply and have no effect.
Note: The "XXX" is a place holder for the various properties of the Style object that define a
region, line, etc.
Remarks
To omit the selection highlighting from output, set the Map.ExportSelection property to False.
Syntax
OBJECT.SetSize (W, H)
Part Description
Remarks
In most Visual Basic applications, you can resize the control without using the SetSize method -- just
use the standard Width and Height properties supported by Visual Basic. The SetSize method can not
be used with a map object on a form. SetSize is for users that create map objects via CreateObject() call.
Remarks
When you are working in a Map window containing many closely positioned objects, you want a
fairly tight Snap tolerance (1, 2, or 3 pixels). This allows you to draw very close to a node without
snapping to it. When objects are more loosely positioned, you can have a looser tolerance. This allows
you to be farther away from a node and still snap to it.
See Also
Node Selecting and Editing on page 239
Map.SnapToNodeSupport property (Map object) on page 458
Remarks
You may enact this feature by pressing 's' or 'S' key. (This character is defined in the MapX resource, so
that it can be changed on foreign platforms).
This functionality works with any of the MapX stock tools as well as any custom tools created by your
application. This functionality is especially useful when editing the nodes of a feature by selecting and
dragging them with the Select tool.
See Also
Map.SnapTolerance property (Map object) on page 458
Node Selecting and Editing on page 239
Remarks
The title defaults to the GeoSet name. If the TitleText is equal to the GeoSet name and the Geoset is
changed, the TitleText also changes.
See Also
Map.Title property (Map object) on page 459
Syntax
OBJECT.ZoomTo (Zoom, x, y)
Part Description
Remarks
Use this method as a simple way to zoom and re-center the map. The alternative would be to set the
Zoom, CenterX, and CenterY properties of the Map object, but doing it that way would cause 3 screen
redraws unless screen updating was turned off, then on using the Map.AutoRedraw property.
Object Properties
• MultivarCategory.Style property
Collection Properties
• MultivarCategories.Count property
• MultivarCategories.Item property
See Also
ThemeProperties.MultivarCategories property (ThemeProperties object) on page 537
LegendText Object and LegendTexts Collection on page 425
See Also
Style Object on page 507
NotesQueryInfo object
Perform queries on a Notes Dataset by making a NotesQueryInfo object and using Dataset type 8
(miDatasetNotesQuery).
This Dataset type will allow the MapX user to ask Notes to perform queries upon a database at run-
time. To add a Dataset of this type to MapX, you will need to create a NotesQueryInfo object and pass
it to Datasets.Add.
Note: THIS OBJECT AND IT’S PROPERTIES ARE NOT YET AVAILABLE IN MAPX MOBILE
DUE TO THE FACT THAT MAPX MOBILE DOES NOT SUPPORT REMOTE
CONNECTIVITY.
Object Properties
• NotesQueryInfo.BeginDate property
• NotesQueryInfo.Database property
• NotesQueryInfo.DefaultNumericValue property
• NotesQueryInfo.DefaultStringValue property
• NotesQueryInfo.EndDate property
• NotesQueryInfo.FullTextSearch property
• NotesQueryInfo.MaxNumDocs property
• NotesQueryInfo.Query property
• NotesQueryInfo.Server property
See Also
Datasets.Add method (Datasets collection) on page 300
See Also
NotesQueryInfo.Query property
See Also
NotesQueryInfo.FullTextSearch property
See Also
NotesQueryInfo.Database property
NotesViewInfo Object
The NotesViewInfo object is required for the second parameter to Datasets.Add for Datasets of type
miDatasetNotesView. This Dataset type will access a specified view of a Database.
Object Properties
• NotesViewInfo.Database property
• NotesViewInfo.Server
• NotesViewInfo.View
See Also
Datasets.Add method (Datasets collection) on page 300
OCIQueryInfo object
An OCIQueryInfo object is passed into the Datasets.Add method as the source parameter if the
Dataset type is miDatasetOCI. This object contains information about how to connect to an OCI data
source and which records to treat as the record set.
When using an OCIQueryInfo object, one must ensure that the proper OCI dlls are installed. In Visual
Basic, choose Project > References. Click the Browse button to add references to appropriate dlls. The
dlls are installed in the MapX Program directory.
Note: THIS OBJECT AND IT’S PROPERTIES ARE NOT YET AVAILABLE IN MAPX MOBILE
DUE TO THE FACT THAT MAPX MOBILE DOES NOT SUPPORT REMOTE
CONNECTIVITY.
Object Properties
• OCIQueryInfo.ConnectString property
• OCIQueryInfo.Query property
See Also
Datasets.Add method (Datasets collection) on page 300
Example
"SRVR=rock;UID=mapx;PWD=mapx"
ODBCQueryInfo Object
An ODBCQueryInfo object is passed into the Datasets.Add method as the source parameter if the
Dataset type is miDatasetODBC. This object contains information about how to connect to an ODBC
data source and which records to treat as the record set.
Note: If you use the ODBCQueryInfo object, your project must reference MODBCDataset.DLL
("MapInfo ODBC Dataset Engine Library").
In Visual Basic, choose Tools > References (for VB 4) or Project > References (for VB 5). Click the
Browse button to add references to appropriate dlls. The dlls are installed in the MapX Program
directory.
Note: THIS OBJECT AND ITS PROPERTIES ARE NOT YET AVAILABLE IN MAPX MOBILE
DUE TO THE FACT THAT MAPX MOBILE DOES NOT SUPPORT REMOTE
CONNECTIVITY.
Object Properties
• ODBCQueryInfo.ConnectString property
• ODBCQueryInfo.DataSource property
• ODBCQueryInfo.SqlQuery property
See Also
Datasets.Add method (Datasets collection) on page 300
Parts Collection
A Parts collection is a grouping of Points collection objects. That is, each object of a Parts Collection is
made up of a Points Collection. A Parts collection has the normal Count, Item, and Remove methods.
The Add method takes a Source Points object and returns the Points object added to the Parts
collection (i.e., a new Points object is added to the Parts collection and the points are copied from the
Source Points collection).
Collection Properties
• Parts.Count property
• Parts.Item property
Collection Methods
• Parts.Add method
• Parts.Remove method
• Parts.RemoveAll method
Syntax
OBJECT.Add(Points)
Points is the Points collection object you want to add.
Syntax
OBJECT.Remove (index)
Syntax
OBJECT.RemoveAll
Object Properties
• Point.X property
• Point.Y property
Object Methods
• Point.Offset method
• Point.Set method
Collection Properties
• Points.Count property
• Points.Item property
Collection Methods
• Points.Add method
• Points.AddXY method
• Points.GetXY method
• Points.GetXYV method
• Points.X method
• Points.Y method
• Points.Remove method
• Points.RemoveAll method
Syntax
OBJECT.Offset(double deltaX, double deltaY)
Part Description
See Also
Map.NumericCoordSys property (Map object) on page 451
Syntax
OBJECT.Set(double X, double Y)
Part Description
See Also
Map.NumericCoordSys property (Map object) on page 451
See Also
Map.NumericCoordSys property (Map object) on page 451
Syntax
[ Point= ]OBJECT.Add(Point, [Position])
Part Description
Part Description
Syntax
[ Point= ]OBJECT.AddXY (x, y, [Position])
Part Description
Note: This method is NOT available in MapX Mobile. To get the XY coordinates in MapX
Mobile, you must use the GetXYV method.
Syntax
OBJECT.GetXY(lIndex, dX, dY)
Part Description
Syntax
OBJECT.GetY(lIndex, vX, vY)
Part Description
Syntax
OBJECT.X(lIndex)
Parts Description
Parts Description
lIndex long: This by reference value is the index of the point object.
Syntax
OBJECT.Y(lIndex)
Parts Description
Syntax
OBJECT.Remove (index)
Syntax
OBJECT.RemoveAll
Object Properties
• RangeCategory.Max property
• RangeCategory.Min property
• RangeCategory.NumItems property
• RangeCategory.Style property
Collection Properties
• RangeCategories.AllOthersCategory property
• RangeCategories.Count property
• RangeCategories.Item property
See Also
ThemeProperties.DistMethod property (ThemeProperties object) on page 535
See Also
ThemeProperties.DistMethod property (ThemeProperties object) on page 535
Themes.Add method (Themes collection) on page 530
Theme.AutoRecompute property (Theme object) on page 526
Note: This property is only valid when MapX generates the theme (Theme.ComputeTheme =
TRUE). If you are manually calculating the theme (Theme.ComputeTheme = FALSE), then
NumItems will NOT reflect the number of items in the category and is undefined as a
result.
Note: If you are using ranges for a theme and specifying range colors individually (ie per
range), ThemeProperties.SpreadBy must be set to miSpreadByNone.
Rectangle Object
Rectangle objects are used to specify the extents of an object. Several properties, such as Map.Bounds,
Feature.Bounds, and Layer.Bounds, are rectangle objects. A rectangle is defined by its minimum and
maximum X coordinates, and its minimum and maximum Y coordinates. For geographic properties
(such as Map.Bounds), these coordinates will be specified in terms of the Map.NumericCoordSys. For
methods relating to Windows (such as Style.DrawLineSample), the properties of the Rectangle object
will be in pixel values.
Object Properties
• Rectangle.Height property
• Rectangle.Width property
• Rectangle.XMax property
• Rectangle.XMin property
• Rectangle.YMax property
• Rectangle.YMin property
Object Methods
• Rectangle.Offset method
• Rectangle.Set method
Syntax
Object.Offset( deltaX, deltaY )
Part Description
Syntax
OBJECT.Set (x1, y1, x2, y2)
Part Description
Object Properties
• ResolveObject.SourceMatch property
• ResolveObject.TableMatch property
• ResolveObject.TableName property
Collection Properties
• ResolveObjects.Count property
• ResolveObjects.Item property
Object Properties
• RowValue.Dataset property
• RowValue.Field property
• RowValue.ReadOnly property
• RowValue.Value property
Collection Properties
• RowValues.Count property
• RowValues.Item property
• RowValues.ReadOnly property
Collection Methods
• RowValues.Add method
• RowValues.Clone method
• RowValues.Remove method
• RowValues.RemoveAll method
See Also
Layer.UpdateFeature method (Layer object) on page 401
Layer.AddFeature method (Layer object) on page 379
Feature.Update method (Feature object) on page 317
Dataset.RowValues property (Dataset object) on page 296
Syntax
OBJECT.Item (index)
Part Description
Note: Though removed from the collection, it will leave the Dataset in tact.
Syntax
OBJECT.Remove (index)
Part Description
Syntax
[ RowValues= ] OBJECT.Add (RowValue)
Part Description
Note: Though removed from the collection, it will leave the Dataset in tact.
Syntax
OBJECT.RemoveAll
Part Description
fields. Obtaining the RowValues collection directly from the dataset (without cloning) will not allow
you to add or remove fields.
Syntax
[ RowValues= ]OBJECT.Clone
Part Description
See Also
Feature.Update method (Feature object) on page 317
Selection Collection
A fundamental function of MapX is selecting objects or records so that you can perform additional
tasks on them such as getting more information. A Selection is a collection of Feature objects.
The Layer.Selection collection is a special Features collection in that objects can be added to or
removed from it by the end user if they use of any of the selection tools. You can get a snapshot of a
layer's selection by using the Clone method to return a Features object.
MapX gives you a number of commands and tools for making selections, the Select tool, Radius Select,
Marquee Select, and Boundary Select tool.
To select records with the tools, click on or encircle the associated graphic objects.
Use the property and methods in the Selection collection and Feature objects to obtain additional
information or manipulate the features of the collection.
Object Properties
• Selection.Count property
• Selection.Item property
Object Methods
• Selection.Add method
• Selection.ClearSelection method
• Selection.Clone method
• Selection.Common method
• Selection.Remove method
• Selection.Replace method
• Selection.SelectAll method
• Selection.SelectByID method
• Selection.SelectByPoint method
• Selection.SelectByRadius method
• Selection.SelectByRectangle method
• Selection.SelectByRegion method
See Also
Layer Object and Layers Collection on page 377
Feature Object and Features Collection on page 308
Syntax
OBJECT.Add (Source)
Part Description
See Also
Feature Object and Features Collection on page 308
FindFeature object on page 353
Syntax
OBJECT.ClearSelection
Part Description
Syntax
OBJECT.Clone
Part Description
Syntax
OBJECT.Common (Source)
Part Description
Syntax
OBJECT.Remove (Source)
Part Description
Part Description
Syntax
OBJECT.Replace (Source)
Part Description
Syntax
Map.Selection.SelectAll SelectionTypeConstant
See Also
SelectionTypeConstant
Syntax
OBJECT.SelectByID (*FeatureID, Flag)
Part Description
Note: Although the FeatureID parameter is still a functional part of MapX, it is recommended
that you use the FeatureKey for the sake of simplicity and expedience. The FeatureKey is
used to identify a unique record in a table. In previous versions, the FeatureID property
was used for this purpose, but it did not work correctly for seamless and remote layers.
The FeatureKey property works for all layer types.
Syntax
OBJECT.SelectByPoint (X, Y, SelectFlag, [SearchResultFlag])
Part Description
Remarks
If you are selecting regions, the Selection.SelectByPoint method will select a region that contains the
location. If you are selecting points or lines, the method will select a point or line within 3 pixels of the
location.
By combining (using OR operator) one or more of the SearchResultTypeConstants you may define
whether you want all the features, the topmost feature, all the regions, all the points, the topmost
point, etc. The default is to return all the features.
Syntax
OBJECT.SelectByRadius (X, Y, Radius, Flag)
Part Description
Remarks
A feature is considered to be within "within" the radius if and only if its centroid is within the radius. If
you need more control over selection criteria, you may want to use the Layer object's
SearchWithinDistance method.
Syntax
OBJECT.SelectByRectangle (X1, Y1, X2, Y2, Flag)
Part Description
Part Description
Flag This controls whether the selected objects are added to, removed from, or
replace the current selection. This takes a SelectionTypeConstants value.
Remarks
A feature is considered to be "within" the rectangle if and only if its centroid is within the rectangle. If
more control over selection criteria is needed, you may want to use the Layer object's
SearchWithinRectangle method. The Rectangle is a 'Map' rectangle in the Numeric Projection, and
does not represent a screen rectangle.
See Also
Layer.SearchWithinRectangle method (Layer object) on page 398
Syntax
OBJECT.SelectByRegion (Layer, *FeatureKey, Flag)
Part Description
Remarks
A feature is considered to be within "within" the region if and only if its centroid is within the radius. If
you need more control over selection criteria, you may want to use the Layer object's
SearchWithinFeature method.
See Also
Feature.FeatureKey property (Feature object) on page 311
Layer.SearchWithinFeature method (Layer object) on page 398
Layer Object and Layers Collection on page 377
Object Properties
• SourceRow.Row property
Collection Properties
• SourceRows.Count property
• SourceRows.Item property
Syntax
[ SourceRow= ]OBJECT.Item (index)
Part Description
Part Description
index Row in Dataset to get value. This is a Variant, and can be a row number or a Feature
object.
The Dataset.SourceRows property is a SourceRows collection, which contains a SourceRow object for
each row in the original data source that was aggregated to the row in the MapX Dataset.
You can use a Feature object as the Row parameter, since a feature object uniquely identifies a single
row in the Layer that the Dataset is bound to.
State Object
The State object allows you to save the current state of an item, such as an object or variable, so that
you can restore the item back to that state at a later time. You can save and restore MapX objects or
variables (e.g. a String or Boolean.)
The State object is very useful in MapXtreme applications to restore the state of the Map object on each
session request. (See “State.Stream property (State object)” on page 504 for more information). It is
also useful in MapX applications (e.g. when using Visual Basic) if you want to save and restore
Datasets and Themes into a permanent file so that you can then restore them at a later time. See
“State.WriteToFile method (State object)” on page 505 for more information.
For example, to save the map and your annotations, do the following:
objState.Save objMap
objState.Save objMap.Annotations
To then restore the map and its annotations, do the following:
objState.Restore objMap
objState.Restore objMap.Annotations
Saving and restoring the Map object also saves the Datasets collection object. However, in order to
completely restore each dataset, the Datasets collection might need each dataset external source (e.g.
ADO recordset.) See "Saving and restoring datasets" for more information.
See Also
Datasets.Contains method (Datasets object) on page 302
Map.ReuseEquivalentOnRestore property (Map object) on page 454
Dataset object and Datasets collection on page 293
Object Methods
• State.ReadFromFile method
• State.Reset method
• State.Restore method
• State.Save method
• State.WriteToFile method
Object Properties
• State.Stream property
Syntax
OBJECT.ReadFromFile (strFile)
Part Description
Remarks
When using this method on a server-side script running on an internet application such as ASP you
need to make sure that the user account executing the script has read access to the file specification.
Keep in mind, however, that if you are also calling State.WriteToFile you need write access as well.
See Also
State.WriteToFile method (State object) on page 505
Example
Save a map using the following statement:
Stateobj.Save mapobj
Then, restore two copies by using the following statements:
Stateobj.Restore mapobj1
Stateobj.Reset
Stateobj.Restore mapobj2
See Also
State.ReadFromFile method (State object) on page 501
State.Restore method (State object) on page 502
State.Save method (State object) on page 504
State.Stream property (State object) on page 504
Syntax
OBJECT.Restore (item)
Part Description
Examples
A MapX map object is a persistent object. To restore a previously saved map object embedded in a
Visual Basic form, you need to do the following:
objState.Restore Map1.Object
Note: Object is a property in VB to access the OLE object of an embedded control.
To restore a previously saved map object in ASP (or any other web server application), there is no
Object property, so you can just send the actual object directly:
objState.Restore objMap
Note: objMap must be an existing Map object.
To restore three previously saved variables, e.g. the map zoom, center x and center y, do the following:
Dim nZoom
Dim nCenterX
Dim nCenterY
'save state
objState.Save Map1.Zoom
objState.Save Map1.CenterX
objState.Save Map1.CenterY
'restore state calls are made in the same order
objState.Restore nZoom
objState.Restore nCenterX
objState.Restore nCenterY
objMap.ZoomTo nZoom, nCenterX, nCenterY
Remarks
You can call this method multiple times to restore multiple items.
When restoring persistent objects, you must have an existing object, not just an empty object variable.
You may call State.Restore multiple times to restore more than one object or variable in the same State
object, as long as you have originally called State.Save the same number of times and order with
equivalent objects and variables.
You do not need to call State.Reset before the first State.Restore call, if calling State.Restore right after
setting the State.Stream property or calling State.Save or State.ReadFromFile) because it is done
automatically.
You cannot restore the property of an object directly. You must restore it into a variable and then set the
object property. For example, to save the Map.Zoom property, do the following:
objState.Save Map1.Zoom
To restore it, however, you must do the following:
Dim nZoom as Double
objState.Restore nZoom
Map1.Zoom = nZoom
See Also
State.Save method (State object) on page 504
Syntax
Part Description
Examples
A MapX map object is a persistent object. To save a map object embedded in a Visual Basic form, you
need to do the following:
objState.Save Map1.Object
Note: Object is a property in VB to access the OLE object of an embedded control.
To save a map object in ASP (or any other web server application), there is no Object property, so you
can just send the actual object directly:
objState.Save objMap
To save three variables, e.g. the map zoom, center x and center y, do the following:
objState.Save objMap.Zoom
objState.Save objMap.CenterX
objState.Save objMap.CenterY
Remarks
You can call this method multiple times to save multiple items.
The following MapX objects support persistence: Map, Annotation, Annotations, Layer, Layers,
Labels, LabelProperties, Feature, Dataset, Datasets, Theme, Themes, CoordSys, Style, Field and Fields.
See Also
State.Restore method (State object) on page 502
Example
You can use the State object in an ASP application to save and restore the state of a Map object on every
session request. The following ASP code snippet sends the current state of the Map object back to the
client through a hidden HTML form field:
Dim objState
Set objState = Server.CreateObject("MapX.State.5")
objState.Save objMap
Response.Write("<INPUT TYPE=HIDDEN NAME=""State"" VALUE=" &
objState.Stream & ">")
The following ASP code snippet then restores the Map object to its previous state on the next HTTP
request:
Dim objState
Set objState = Server.CreateObject("MapX.State.5")
objState.Stream = Request.Form.Item("State")
objState.Restore objMap
Remarks
The value of the Stream property contains alphabetic characters only. It does not contain any special
HTML characters so that it can be written in an HTML page as a string value.
This property is useful in web applications to save and restore the state of the Map object on each
session request. You can save the Map object into a State object and then use the Stream property to
send the state back to the client on a hidden HTML form field. On the next session request, you can set
the Stream property of a new State object to the value of the hidden HTML form field and call
State.Restore to restore the Map object.
Keep in mind that saving Map objects with a lot of information (e.g. maps that have several layers or
temporary layers with several features) can significantly increase the amount of data transferred
between the client and the server. An alternate solution is to save the value of the Stream property to
store the value of the Stream object in a database and send a key back to the client. This key can then be
used on the next session request to retrieve the Stream value from the database.
See Also
State.Restore method (State object) on page 502
State.Save method (State object) on page 504
Syntax
OBJECT.WriteToFile (strFile)
Part Description
Remarks
When using this method on a server-side script running on an internet application such as ASP you
need to make sure that the user account executing the script has write access to the file specification.
See Also
State.ReadFromFile method (State object) on page 501
Style Object
The Style object contains attributes for drawing symbols, lines, regions, and text. The object contains
attributes for all feature types, even though a particular feature type only uses a subset of the
properties. The property names begin with a keyword indicating the feature type it applies to.
Object Properties
• Style.LineColor property
• Style.LineInterleaved property
• Style.LineStyle property
• Style.LineStyleCount property
• Style.LineSupportsInterleave property
• Style.LineWidth property
• Style.LineWidthUnit property
• Style.MaxVectorSymbolCharacter property
• Style.MinVectorSymbolCharacter property
• Style.RegionBackColor property
• Style.RegionBorderColor property
• Style.RegionBorderStyle property
• Style.RegionBorderWidth property
• Style.RegionBorderWidthUnit property
• Style.RegionColor property
• Style.RegionPattern property
• Style.RegionTransparent property
• Style.SupportsBitmapSymbols property
• Style.SymbolBitmapColor property
• Style.SymbolBitmapName property
• Style.SymbolBitmapOverrideColor property
• Style.SymbolBitmapSize property
• Style.SymbolBitmapTransparent property
• Style.SymbolCharacter property
• Style.SymbolFont property
• Style.SymbolFontBackColor property
• Style.SymbolFontColor property
• Style.SymbolFontHalo property
• Style.SymbolFontOpaque property
• Style.SymbolFontRotation property
• Style.SymbolFontShadow property
• Style.SymbolType property
• Style.SymbolVectorColor property
• Style.SymbolVectorSize property
• Style.TextFont property
• Style.TextFontAllCaps property
• Style.TextFontBackColor property
• Style.TextFontColor property
• Style.TextFontDblSpace property
• Style.TextFontHalo property
• Style.TextFontOpaque property
• Style.TextFontRotation property
• Style.TextFontShadow property
Object Methods
• Style.Clone method
• Style.DrawLineSample method
• Style.DrawRegionSample method
• Style.DrawSymbolSample method
• Style.DrawTextSample method
• Style.ExportLineSample method
• Style.ExportRegionSample method
• Style.ExportSymbolSample method
• Style.ExportTextSample method
• Style.PickLine method
• Style.PickRegion method
• Style.PickSymbol method
• Style.PickText method
Syntax
OBJECT.Clone
The OBJECT placeholder represents a Style object.
Remarks
When you reference a Style object that is owned by another object (for example, using an expression
such as objFeature.Style), any changes that you make to the style automatically affect the style's parent
object.
To create a modified style without affecting the parent object, use the Clone method to create a copy of
the style. The style returned by this method is a stand-alone object; changes made to this Style object
do not automatically affect any other object. You can assign a stand-alone Style object to any object's
Style property.
A Style object created through the Clone method supports bitmap symbols if and only if the original
Style object supports bitmap symbols.
Syntax
OBJECT.DrawLineSample (HDC, Rectangle)
Part Description
Syntax
OBJECT.DrawRegionSample (HDC, Rectangle)
Part Description
Syntax
OBJECT.DrawSymbolSample (HDC, Rectangle)
Part Description
Syntax
OBJECT.DrawTextSample (HDC, Rectangle, SampleText)
Part Description
Syntax
OBJECT.ExportLineSample (Destination, Format, Width, Height, [BackColor])
Part Description
Syntax
OBJECT.ExportRegionSample (Location, Format, Width, Height, [BackColor ])
Part Description
Syntax
OBJECT.ExportSymbolSample (Location, Format, Width, Height, [BackColor ] )
Part Description
Part Description
Width Width of output. This is a double value, and specifies width in terms of pixels.
Height Height of output. This is a double value, and specifies height in terms of
pixels.
BackColor Variant. Controls color of the background. Specify an OLE_COLOR value. It
can be a specific solid color or one of the Windows System Colors such as
'Window Background'. (Most containers like Visual Basic display a special
color picker dialog in their property pages for properties of type
OLE_COLOR.)
Syntax
OBJECT.ExportTextSample (Location, Format, Width, Height, [BackColor ])
Part Description
Remarks
This property is a read-write integer line style number: 0 represents a non–visible line, 1 a solid line,
and a larger number for a patterned line; see table below.
You can assign any PenStyleConstants value to this property. However, most of the line styles do not
have corresponding constants. The table below shows the complete set of LineStyle numbers.
Note: The table (above) shows the default styles. If the user has customized the mapx.pen file
(the file that defines the line styles), the set of available styles might not match the table
shown above. Use the LineStyleCount property to determine the number of styles in the
.pen file.
See Also
Style.LineInterleaved
Remarks
You may specify a style Style.LineWidth in tenths of points or in pixels by setting the
Style.LineWidthUnit property to one of the StyleUnitConstants.
See Also
Style.LineWidth
Syntax
OBJECT.PickLine
Syntax
OBJECT.PickRegion
Syntax
OBJECT.PickSymbol
Syntax
OBJECT.PickText
See Also
FillPatternConstants
See Also
Style.RegionBorderWidth property (Style object) on page 517
Remarks
If a region feature is drawn with a fill pattern (as opposed to a solid fill), you can control whether the
fill pattern is transparent. Use a transparent fill style if features on your map overlap, and you want to
see what is underneath a region.
The following picture shows two buffer regions. The region on the left is opaque; the region on the
right is transparent, allowing you to see features beneath the region.
The RegionTransparent property does not have any effect on regions drawn with a solid fill.
Remarks
A True value indicates that the Symbol object supports bitmap symbols.
Currently, only Feature, Layer, and Theme objects support bitmap symbols.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Remarks
To make the non-white pixels in a bitmap symbol appear in a particular color:
1. Set the SymbolBitmapColor property to the desired color.
2. Set the SymbolBitmapOverrideColor property to True.
When you change a TrueType font symbol into a bitmap symbol - in other words, when you change
the SymbolType property to miSymbolTypeBitmap (1) - MapX sets the SymbolBitmapColor property
to match the SymbolFontColor property.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Remarks
The name that you specify should not include a full directory path. The bitmap file must be in the
custom symbol directory, currently defined to be:
<path>\CUSTSYMB
where <path> is the path where the MapX Common Files are installed, e.g. C:\Program
Files\Common Files\MapInfo Shared\MapXCommon.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Remarks
The default is false, meaning that the non–white pixels in a bitmap symbol will appear in their default
colors. If you want all of the non–white pixels to display in an override color (the color specified by the
SymbolBitmapColor property), set this property to True.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Remarks
When you change a TrueType font symbol into a bitmap symbol - in other words, when you change
the SymbolType property to miSymbolTypeBitmap (1) - MapX sets the SymbolBitmapSize property to
match the value of the SymbolFont.Size property. For example, if you change a 12-point TrueType font
symbol into a bitmap symbol, the SymbolBitmapSize will be 12.
The SymbolBitmapSize point values range from 1 - 48. If a bitmap symbol is less than 1 then
SymbolBitmapSize is set to 1. Conversely, if a bitmap symbol is greater than 48 points, then
SymbolBitmapSize is set to 48.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Remarks
Default value is False, meaning that the white portion of a bitmap symbol will appear white. Set to
True if you want white portions of the bitmap to be transparent.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
See Also
Style.SymbolFont property (Style object) on page 521
Remarks
A symbol can be defined by the combination of a TrueType font and a character within that font
(Style.SymbolCharacter). Therefore, if you need to modify the appearance of a symbol, you might
need to obtain and modify the symbol's Style.SymbolFont property.
The SymbolFont property is read-only; however, you can set the properties of the Font object that it
returns.
See Also
Style.SymbolCharacter property (Style object) on page 520
Setting Font Attributes on page 108
Remarks
This property should be set to an integer between zero and 360. Rotation is clockwise.
This property only applies to TrueType font symbols, not to bitmap symbols; bitmap symbols cannot
be rotated.
Feature, Layer, and Theme objects support rotated symbols. If an object does not support rotated
symbols, this property is ignored.
Remarks
The TextFont property is read-only; however, you can set the properties of the Font object that it
returns.
See Also
OLE_COLOR Values on page 655
See Also
OLE_COLOR Values on page 655
clockwise. It is valid only for Feature objects and if set/queried for any other object, this property is
ignored/undefined.
Remarks
To use a TrueType font symbol, set this to miSymbolTypeTrueTypeFont.
To change to a bitmap symbol, set this to miSymbolTypeBitmap.
To change to a vector symbol, set this to miSymbolTypeVector.
Note: Only some objects (Feature, Layer, Theme) support bitmap symbols. Attempting to set
SymbolType to miSymbolTypeBitmap will throw an exception if the object does not
support bitmap symbols.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 283
Object Properties
• Theme.AutoRecompute property
• Theme.ComputeTheme property
• Theme.DataMax property
• Theme.DataMin property
• Theme.Fields property
• Theme.Layer property
• Theme.Legend property
• Theme.Name property
• Theme.Properties property (Theme object)
• Theme.ThemeProperties property
• Theme.Type property
• Theme.Visible property
Object Methods
• Theme.ThemeDlg method
Collection Properties
• Themes.Count property
• Themes.Item property
Collection Methods
• Themes.Add method
• Themes.Remove method
• Themes.RemoveAll method
Remarks
When theme properties are changed (such as ThemeProperties.NumRanges), the Theme object is
recomputed. This can take some time. If you want to change several properties, you should set
AutoRecompute to FALSE, change the properties, then set AutoRecompute to TRUE, and have the
recomputation happen only once.
Remarks
If the value is set to False an invisible theme object will be created with 10 ranges for Individual value
themes and 5 ranges for Ranged themes. You can then manually set the minimum and maximum
values to define the theme with Theme.DataMin property and Theme.DataMax property.
ThemeProperties.NumRanges and IndividualValueCategory.Value properties are used to modify it.
For ranged themes you can manually set the theme ranges or calculate equal size ranges determined
by the minimum (Theme.DataMin) and maximum (Theme.DataMax) values.
When this property is set to "false", the Legend.ShowEmptyranges property must be set to "true" in
order for the theme's legend text(s) to be visible. This is because MapX does not calculate theme
category counts while ComputeTheme is "false".
See Also
Theme.ComputeTheme property (Theme object) on page 527
Theme.DataMin property (Theme object) on page 527
See Also
Theme.ComputeTheme property (Theme object) on page 527
Theme.DataMin property (Theme object) on page 527
See Also
Layer Object and Layers Collection on page 377
See Also
Legend Object on page 418
Remarks
The Name property can be used with the Themes.Item property and the Themes.Remove method.
See Also
Themes.Add method (Themes collection) on page 530
Themes.Item property (Themes collection) on page 532
See Also
Theme.ThemeProperties property (Theme object) on page 530
ThemeProperties Object on page 534
Syntax
[Boolean=]OBJECT.ThemeDlg ([HelpFile], [HelpID])
Part Description
Remarks
If either of the optional parameters are not given, the help button will not appear on the dialog.
The return value of ThemeDlg is True if the user clicked OK and False if the user clicked Cancel.
See Also
ThemeProperties Object on page 534
Remarks
When creating a theme, computing ranges for layers with large numbers of rows, such as drilldown or
server layers, can take some time. The ComputeTheme parameter lets you create a non-compute
theme for any theme type. A non-compute theme gives you the ability to create a theme without
having the ranges automatically calculated for you. You can then create the ranges yourself. This is a
faster way for drilldown and server layers.
Note: MapX will create an empty theme against an empty Dataset. A theme object is created and
added to the themes collection, but because the theme is based on a Dataset with no data,
the theme will not be visible.
A Dataset with no rows would probably only occur if there is a programmer error. For instance, if one
accidentally binds USA data against the Canada layer, the result is a Dataset with no rows (i.e. no
data). If one tries to make a theme based on that Dataset, an "empty" theme is created. The
responsibility of checking whether there are any rows in the Dataset before making a theme, is the
progammer’s.
Syntax
OBJECT.Add ([Type], [Field], [Name], [ComputeTheme])
Part Description
See Also
Field object and Fields collection on page 340
Theme.DataMax property (Theme object) on page 527
Theme.DataMin property (Theme object) on page 527
Theme.Name property (Theme object) on page 528
Theme.Type property (Theme object) on page 530
Syntax
OBJECT.Item (index)
Part Description
See Also
Theme.Name property (Theme object) on page 528
Note: If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
Syntax
OBJECT.Remove (index)
Part Description
See Also
Theme.Name property (Theme object) on page 528
Syntax
OBJECT.RemoveAll
ThemeProperties Object
The ThemeProperties object is a property of a Theme object and contains the information defining the
Theme.
Note: The Theme.Properties property still works as it did before, but it is recommended that you
use the ThemeProperties object because of its improved functionality.
Object Properties
• ThemeProperties.AllowEmptyRanges property
• ThemeProperties.ApplyAttribute property
• ThemeProperties.BarFramed property
• ThemeProperties.BarFrameStyle
• ThemeProperties.BarGraduatedStack property
• ThemeProperties.BarIndependentScale property
• ThemeProperties.BarStacked property
• ThemeProperties.BarWidth property
• ThemeProperties.BorderStyle property
• ThemeProperties.ColorMethod property
• ThemeProperties.DataValue property
• ThemeProperties.DistMethod property
• ThemeProperties.DotColor property
• ThemeProperties.DotSize property
• ThemeProperties.Graduated property
• ThemeProperties.GraduateSizeBy property
• ThemeProperties.Independent property
• ThemeProperties.IndividualValueCategories property
• ThemeProperties.InflectionColor property
• ThemeProperties.InflectionRange property
• ThemeProperties.InflectRanges property
• ThemeProperties.MultivarCategories property
• ThemeProperties.NegativeSymbolStyle property
• ThemeProperties.NumRanges property
• ThemeProperties.PieClockwise property
• ThemeProperties.PieGraduated property
• ThemeProperties.PieHalfPies property
• ThemeProperties.PieStartAngle property
• ThemeProperties.PositiveSymbolStyle property
• ThemeProperties.RangeCategories property
• ThemeProperties.RoundBy property
• ThemeProperties.RoundRanges property
• ThemeProperties.ShowNegativeValues property
• ThemeProperties.Size property
• ThemeProperties.SpreadBy property
• ThemeProperties.SymbolStyle property
• ThemeProperties.ValuePerDot property
• ThemeProperties.Width property
Remarks
If the ThemeProperties.DistMethod property is set to miCustomRanges (value: 0), empty ranges are
allowed, regardless of the value of the AllowEmptyRanges property.
See Also
Legend.ShowEmptyRanges property (Legend object) on page 422
See Also
ThemeProperties.Size property (ThemeProperties object) on page 538
Distribution Description
miEqualRangeSize Takes the maximum data value and the minimum data value,
andchooses ranges by breaking the range of data values into
equally sized pieces (e.g. 0-25; 25-50; 51-75; 76-100)
miEqualCountPerRange Attempts to assign ranges in such a way that each range contains
the same number of features.
Distribution Description
miCustomRanges You will specify your own ranges in the RangeCategories collection
( MapX won't compute ranges).
miNaturalBreak Range breaks are determined using an algorithm that attempts to
minimize the difference between the data values and the average of
the data values, minimized on a per range basis.
miStandardDeviation The middle range breaks at the mean of the data values, and the
ranges above and below the middle range are one standard
deviation above or below the mean.
See Also
RangeCategory Object and RangeCategories Collection on page 477
See Also
ThemeProperties.PieGraduated property (ThemeProperties object) on page 540
The population data would be in the millions and the ranking would only be between 1 and 50. If the
Independent property is set to True, then the highest populated state's population bar would be equal
in height to the highest ranking state in exports export bar. Were the Independent property left false,
the export ranking bar would be difficult to obtain any meaning from because the state ranked 1st
would have an export bar the size of a state's population bar if that state had 1 person in it.
See Also
ThemeProperties.BarIndependentScale property (ThemeProperties object) on page 541
See Also
IndividualValueCategory object and IndividualValueCategories collection on page 363
See Also
MultivarCategory Object and MultivarCategories Collection on page 461
See Also
RangeCategory Object and RangeCategories Collection on page 477
See Also
Map.PaperUnit property (Map object) on page 452
ThemeProperties.DataValue property (ThemeProperties object) on page 535
Remarks
This takes a SpreadByConstants value. To control which colors or sizes are used for the start or end set
the ThemeProperties.RangeCategories(x).Style values, where x = 1 for the first range (start value) and
x is ThemeProperties.NumRanges for the last range (end value).
Note: If you are using ranges for a theme and specifying range colors individually (ie per
range), ThemeProperties.SpreadBy must be set to miSpreadByNone.
See Also
ThemeProperties.PositiveSymbolStyle property (ThemeProperties object) on page 543
Style Object on page 507
ThemeProperties.DataValue property (ThemeProperties object) on page 535
See Also
Map.PaperUnit property (Map object) on page 452
See Also
ThemeProperties.PieStartAngle property (ThemeProperties object) on page 540
See Also
ThemeProperties.PieClockwise property (ThemeProperties object) on page 539
See Also
ThemeProperties.GraduateSizeBy property (ThemeProperties object) on page 543
See Also
ThemeProperties.BarGraduatedStack property (ThemeProperties object) on page 541
See Also
ThemeProperties.BarStacked property (ThemeProperties object) on page 540
ThemeProperties.GraduateSizeBy property (ThemeProperties object) on page 543
See Also
Map.PaperUnit property (Map object) on page 452
See Also
Style Object on page 507
ThemeProperties.BorderStyle property (ThemeProperties object) on page 542
See Also
Style Object on page 507
ThemeProperties.BarFrameStyle (ThemeProperties object) on page 542
ThemeProperties.ShowNegativeValues property(ThemeProperties
object)
Purpose
This is a Boolean property which applies to Graduated Symbol themes. If True, then negative data
values will be treated like their absolute values; a symbol representing -4000 will have the same size as
a symbol representing 4000. If False, then negative values will not be shown. The default is False.
See Also
ThemeProperties.PositiveSymbolStyle property (ThemeProperties object) on page 543
ThemeProperties.NegativeSymbolStyle property (ThemeProperties object) on page 543
See Also
Style Object on page 507
ThemeProperties.ShowNegativeValues property(ThemeProperties object) on page 542y
ThemeProperties.NegativeSymbolStyle property (ThemeProperties object) on page 543
ThemeProperties.DataValue property (ThemeProperties object) on page 535
See Also
Style Object on page 507
ThemeProperties.ShowNegativeValues property(ThemeProperties object) on page 542y
ThemeProperties.NegativeSymbolStyle property (ThemeProperties object) on page 543
ThemeProperties.DataValue property (ThemeProperties object) on page 535
See Also
ThemeProperties.PieGraduated property
ThemeProperties.BarGraduatedStack property
See Also
OLE_COLOR Values on page 655
See Also
ThemeProperties.RoundBy property (ThemeProperties object) on page 544
Remarks
If RoundBy was 100, and the computed ranges were 420-560, and 560-930, then they would be
rounded to 400-600, and 600-900, respectively. The default RoundBy value is calculated by finding the
power of 10 which is closest to the difference between the maximum and minimum data value. For
example, if the difference between the maximum and minimum data value was 11,554, then the
default value for the RoundBy property would be 100.
See Also
ThemeProperties.RoundRanges property (ThemeProperties object) on page 544
Remarks
For example, if the InflectionColor is miColorWhite, and the top and bottom range colors are blue and
red respectively, then the color would go from blue to white, then from white to red. If InflectRanges
was False, then the color in the middle ranges would instead be some mixture of blue and red.
See Also
ThemeProperties.InflectionRange property (ThemeProperties object) on page 545
ThemeProperties.InflectionColor property (ThemeProperties object) on page 546
ThemeProperties.RangeCategories property (ThemeProperties object) on page 538
Remarks
This property only applies if ThemeProperties.InflectRanges is True. The default is 2 (the second
range).
See Also
ThemeProperties.InflectionRange property (ThemeProperties object) on page 545
ThemeProperties.InflectionColor property (ThemeProperties object) on page 546
See Also
ThemeProperties.InflectRanges property (ThemeProperties object) on page 545
See Also
ThemeProperties.SpreadBy property (ThemeProperties object) on page 538
See Also
ThemeProperties.RangeCategories property (ThemeProperties object) on page 538
RangeCategory Object and RangeCategories Collection on page 477
ThemeProperties.IndividualValueCategories property (ThemeProperties object) on page 537
IndividualValueCategory object and IndividualValueCategories collection on page 363
Title Object
Each map contains a title (Map.Title property) in which the title, its style and location are stored.
Object Properties
• Title.Border property
• Title.Caption property
• Title.Editable property
• Title.Position property
• Title.TextStyle property
• Title.Visible property
• Title.X property
• Title.Y property
Object Properties
• Variable.Name property
• Variable.Value property
Collection Properties
• Variables.Count property
• Variables.Item method
Collection Methods
• Variables.Add method
• Variables.Clone method
• Variables.Remove method
• Variables.RemoveAll method
Note: The default property is Variables.Item, and the Variable object is NOT createable. Also,
there is no limitation in terms of length and character set.
Remarks
A variable is a name "tied to" a variant. When an expression reads an unresolved identifier, it will try
to resolve it in the Variables collection. If a programmer has added the Variable object in question to
the Variables collection, the expression will execute. The variant can be of any type (string, number,
etc.).
Note: When using a feature object as a variable, you will get the best performance if the Feature
object and the layer being searched have the same coordinate system. This will prevent "on
the fly" coordinate transformations from occurring.
Dataset names and Dataset field names have precedence over variable names.
The Variables collection IS createable.
Note that in the case of Feature objects, a copy of the feature is made during the call to Variables.Add.
If you subsequently modify the feature, the variable will not reflect the changes. You will need to
update the value of the Variable via the Variables.Add method or via the Variable.Value property.
Syntax
[ Variables collection= ]OBJECT.Add(Name, Value)
Part Description
Remarks
The Variables.Add method adds a new variable to the collection. If a variable with the same name is
already in the collection, it will update the existing variable with the new variable value.
The variant can be of any numeric, string, or date type. In addition, it can be a IDispatch where the
object is a MapX Feature object.
See Also
Feature Object and Features Collection on page 308
IDispatch Table on page 657
Syntax
[ Variable object= ]OBJECT.Clone
Part Description
Syntax
[ Variable object= ]OBJECT.Item(Index)
Part Description
Syntax
OBJECT.Remove(Index)
Part Description
Syntax
[ Variable object= ]OBJECT.Clone
Part Description
Stock events
MapX supports the following stock events:
Custom Events
MapX supports the following custom events:
AddFeatureToolUsed Event
This event is called whenever the user uses one of the standard object creation tools (miAddPointTool,
miAddLineTool, miAddPolylineTool, or miAddRegionTool). The behavior of this event is similar to
the PolyToolUsed Event.
Dispatch ID = 16
Syntax
AddFeatureToolUsed(ToolNum, Flags, Feature, Shift, Ctrl, EnableDefault)
Part Description
Part Description
EnableDefault Boolean. This parameter controls whether MapX allows the tool's
standard behavior to take effect. Default value is True. To prevent the
tool's standard behavior (e.g. to cancel the user's action), set this
parameter to False. This parameter only takes effect when the user
concludes the tool use (miToolEnd).
Remarks
This event is fired multiple times during every use of the object creation tools:
Once at the beginning of the tool use, when the user clicks to place the first node of the feature. During
this call, the Flags variable is set to miToolBegin (0).
For the Add Polyline and Add Region tools, it is fired once for every time the user clicks to add
another node, and also for every time the user deletes a node by pressing the BACKSPACE key.
During this call, the Flags variable has a value equal to miToolInProgress (3).
Fired once at the end of the tool use, when the user performs one of these actions:
• Ends the drawing of the feature by double clicking (polyline and polygon tools) or releasing
the mouse (line and point tools), in which case the Flags variable will be set to miToolEnd (1);
-or-
• Presses the ESC key to end the add feature tool, in which case the Flags variable will be set to
miToolEndEscaped (2); -or-
• Uses the backspace key to delete all of the nodes, in which case the Flags variable will be set
to miToolEndEscaped (2).
AnnotationAdded event
Purpose
This event that is called whenever an annotation is added, modified, or deleted. It is called right
before the annotation is changed. The programmer also has an opportunity to prevent the operation.
Dispatch ID = 7
Syntax
AnnotationChanged event
Purpose
This is an event that is called whenever an annotation is added, modified, or deleted. It is called right
before the annotation is changed, and the programmer has an opportunity to prevent the operation.
Dispatch ID = 8
Syntax
AnnotationChanged (changetype, EnableDefault)
Part Description
See Also
AnnotationChangedType Constants
DataMismatch event
Purpose
This event is called when a row doesn't match an object in the map during data binding.
Once MapX knows a geocolumn for a data set, it can then bind it to a map. However, MapX may
encounter a row that doesn't match an object in the map. In the default case, it is simply skipped over.
If the DataMismatch event handler is defined, we will send an event to it when a row doesn't match.
Dispatch ID = 5
Syntax
DataMismatch (DatasetName, ByValRow, GeoColValue)
Part Description
DatasetName This string value is the name of the Dataset that dosen’t match.
ByValrow This is the row number (as long) in the general data source that dosen’t
match.
GeoColValue This is a string value of the field in the dataset that dosen’t match.
DrawUserLayer Event
Purpose
When the application creates a UserDraw layer using the AddUserDrawLayer method of the Layers
collection, an event is fired to the application when the window needs updating:
Dispatch ID = 10
Syntax
DrawUserLayer (Layer, hOutputDC, hAttributeDC, RectFull, RectInvalid)
Part Description
The rectangles are objects of type Rectangle. The coordinates in the rectangles are screen (client)
coordinates.
Remarks
You can also add a UserDrawLayer via Layers.Add.
LabelChanged Event
MapX fires this event whenever a label is about to be added (via the stock Label tool), selected,
deselected or moved (via stock Select tool). The MapX programmer has the opportunity to prevent the
operation by setting the EnableDefault value to False.
Note: This event is only fired for changes made via user interaction (like selecting the label or
moving it), NOT through programmatic changes. For example, Label.AnchorX = -110 will
not fire the event, even though it does move the label.
Syntax
LabelChanged(ChangeType, ChangingLabels, *EnableDefault)
Dispatch ID = 17
Part Description
ChangingLabels Labels object: Represents a collection of Label objects that are about to
change. This has the same interface as the Layer object's Labels collection
(i.e., it has a Count and [Item] property).
*EnableDefault Boolean: Controls whether the MapX default behavior is allowed to take
effect. Default value is True. If you set this to False in the event handler,
MapX will ignore the user interaction about to change the label.
MapDraw event
This event will be called once before a draw, and once after a draw is completed. There is one
parameter which states whether a draw is beginning or ending.
Disp ID = 15
Syntax
MapDraw (Flag)
Part Description
See Also
MapDrawConstants
MapInitialized event
Purpose
This event is called immediately after map initialization is complete. It serves to notify the container
application of the best time to do any necessary run-time configuration.
Dispatch ID = 13
Syntax
MapInitialized < no parameters >
MapViewChanged event
Purpose
This event is called whenever the distance across the control (map) changes or the centerpoint is
moved.
Dispatch ID = 6
Syntax
MapViewChanged < no parameters >
MouseWheel Event
Purpose
The Intellimouse provides a wheel as a third (middle) button on the Microsoft mouse. In addition to
the regular mouse button messages, the wheel sends a MOUSEWHEEL message when turned.
The MouseWheel will zoom the map when rolled, scroll the map up and down when the wheel is
rolled with the control key down, and "AutoScroll" when the middle button is held down and moved
away from the mouse click point. The speed of the scrolling is proportional to the distance of the
cursor from the mouse-click point. The MouseWheel event allows you to override this built-in
behavior of the MouseWheel.
Note that there is no support in Visual Basic under Windows 95 for the MouseWheel, but third party
ActiveX controls have been built that you can use to take advantage of the MouseWheel. (That is, you
put another control on your form that gathers and sends along the MOUSEWHEEL messages.)
Dispatch ID = 12
Syntax
MouseWheel(long Flags, int zDelta, single X & Y, bool EnableDefault)
Part Description
Flags Indicates whether various virtual keys are down. This parameter can be
any combination of the following values:
MK_CONTROL: Set if the CTRL key is down.
MK_LBUTTON: Set if the left mouse button is down.
MK_MBUTTON: Set if the middle mouse button is down.
MK_RBUTTON: Set if the right mouse button is down.
MK_SHIFT: Set if the SHIFT key is down.
zDelta The value of the high-order word of wParam. Indicates the distance that
the wheel is rotated, expressed in multiples or divisions of
WHEEL_DELTA, which is 120. A positive value indicates that the wheel
was rotated forward, away from the user; a negative value indicates
that the wheel was rotated backward, toward the user.
X Specifies the x-coordinate of the pointer, relative to the upper-left corner
of the screen.
Y Specifies the y-coordinate of the pointer, relative to the upper-left corner
of the screen.
PolyToolUsed Event
This event is called whenever the user draws a polyline or polygon, using either the standard tool
miPolygonSelectTool (1010), or a custom tool of type miToolTypePoly (4).
Dispatch ID = 11
Syntax
PolyToolUsed(ToolNum, Flags, Pts, Shift, Ctrl, EnableDefault)
Part Description
Remarks
This event is fired multiple times during every use of the PolyTool.
Once at the beginning of the tool use, when the user clicks to place the first node of the polyline/
polygon. During this call, the Flags variable is set to miPolyToolBegin (0).
Once for every time the user clicks to add another node to the polyline, and also for every time the
user deletes a node by pressing the BACKSPACE key. During this call, the Flags variable has a value
equal to miPolyToolInProgress (3).
Once at the end of the tool use, when the user performs one of these actions:
• Double-clicks to end the drawing of the polygon, in which case the Flags variable will be set
to miPolyToolEnd (1);
-or-
• Presses the ESC key to end the drawing of the polygon, in which case the Flags variable will
be set to miPolyToolEndEscaped (2);
-or-
• Uses the backspace key to delete all of the nodes, in which case the Flags variable will be set
to miPolyToolEndEscaped (2)
RequestData event
Purpose
This is event is called to request data from a cell container when dealing with unbound data.
Dispatch ID = 4
Syntax
RequestData (row, column, value, done)
Set the done flag when there is no more data to pass to the container.
ResolveDataBind event
Purpose
Automatic Data Binding can encounter ambiguous situations. Theses situations include: multiple
geocolumns are detected in the user data, multiple layers are detected that match the geocol,multiple
geosets are available for the matched map layer. In these cases, MapX will take the first one, unless the
following ResolveDataBind event handler is defined. If defined, MapX will call it, and let the handler
choose which one to use.
Dispatch ID = 2
Syntax
ResolveDataBind (flag, nummatches, matches, choice, cancel )
Part Description
flag Indicates if the event is being called because of multiple geocols (0),
multiple layers (1), or multiple geosets (2).
nummatches Indicates how many entries are in the matches array. The array of
strings matches contains list of matches.
matches Variant: Represents an array of strings.
choice The return variable. 1 based. 0 means auto–select and has MapX choose
the best one).
cancel Allows the user to cancel the data bind and causes it to fail.
Remarks
ResolveDataBind could get fired 3 times.
First, it chooses columns in the source table, then for the chosen column it chooses a table if there are >
1, and lastly, for the table it chooses geosets if there are > 1.
The geodictinonary lists geosets for each table.
ResolveDataBindEx event
Purpose
This event has the same function as the ResolveDataBind event, but it passes a collection of
ResolveObjects instead of a string array. So, for situations like multiple geocolumns being detected in
the user data, multiple layers detected that match the geocol, or multiple geosets available for the
matched map layer, MapX will take the first one, unless either the ResolveDataBind or the
ResolveDataBindEx event handler is defined. If defined, MapX will call one, and let the handler
choose which one to use.
Dispatch ID = 14
Syntax
ResolveDataBindEx (flag, nummatches, matches, choice, cancel )
Part Description
flag Indicates the event is being called because of multiple geocols. This flag
is always set to one.
nummatches Indicates how many entries are in the matches collection.
matches Variant: Represents a collection of ResolveObject objects.
choice The return variable. 1 based. 0 means auto–select and has MapX choose
the best one.
cancel Allows the user to cancel the data bind and causes it to fail.
Remarks
ResolveDataBindEx is fired only for multiplegeo columns and only if choice is set to 1 during
ResolveDataBind Event.
SelectionChanged event
Purpose
This event is called whenever the selection changes and enables the container to react to a selection
made on the map. The selection can change as a result of a user using a selection tool, or by using one
of the Selection methods from the Layer object.
Dispatch ID = 1
Syntax
SelectionChanged
ThemeModifyRequested event
Purpose
This event is called when a user double clicks on a thematic legend. The parameter is the Theme object
that `owns' the legend. The purpose for this event is to be able to write code and let the user modify
theme or legend properties when the user double clicks on the legend.
Dispatch ID = 9
Syntax
ThemeModifyRequested
Theme as object
ToolUsed event
The ToolUsed event is called when the user uses a custom tool on the map. This procedure allows you
to determine how the tool was used; for example, it tells you the map coordinates where the user
clicked. Within the ToolUsed procedure, you write code to carry out the intended functionality of the
tool.
This event is also called when a standard tool is used, in which case the event is called after the user
interaction, but before the operation is executed for standard tools.
Dispatch ID = 3
Part Description
ToolNum Integer: Indicates the tool number. Note that if you create multiple
custom tools, this event is called when any of those tools are used;
therefore, you need to check ToolNum to determine which tool is in use.
x1, y1 Double: Map coordinates where user clicked.
x2, y2 Double: Map coordinates where the user ended the tool use; does not
apply to Point tools, which do not allow dragging.
distance Double: Distance, in Map Units, between beginning location and
ending location.
shift Boolean: Indicates whether user held down SHIFT KEY.
control Boolean: Indicates whether user held down CTRL KEY.
*EnableDefault Boolean: In cases where a standard tool is being used, this parameter
controls whether MapX allows the tool's standard behavior to take
effect. Default value is True. To prevent the tool's standard behavior
(e.g. to cancel the user's action), set this parameter to False.
Even if you cannot access your data sources through the standard MapX data binding techniques, you
can create your own custom dataset support. MapX version 3 and later provides a run-time extensible
architecture, allowing you to plug in custom dataset types through a COM-based dataset interface.
Creating custom dataset support is an advanced topic. This discussion assumes that you are already
familiar with creating COM objects.
Special Registration
When registered, a Static DataSet object server must make some special entries in the registry so that
MapX knows when to use it:
Add the key:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<DatasetID>
Add the string value:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<DatasetID>
\DE_CLSID =
The CLSID of the Static Dataset object (in the form “{xxxxxxxx-xxxx-
xxxx-xxxx-xxxxxxxxxxxx}”).
Where <DatasetID> is a unique numeric identifier for your Static DataSet object. When the “Type”
parameter to Map’s DataSet.Add(…) method is this value, your server will be asked to provided the
Static DataSet object through which MapX will ultimately retrieve data. The values 0 through 1000 are
reserved by MapInfo and should not be used.
Note: Don’t forget to delete these registry entries when your server is unregistered!
Interfaces
The IMMapXDataSet Interface
[
uuid(96e0f395-caec-11d0-9d99-00aa00a478cb),
helpstring("IMMapXDataset Interface"),
version(1.0)
]
interface IMMapXDataset : IUnknown
{
HRESULT Init(
[in] short sType,
[in] VARIANT* pvSourceData,
[in] VARIANT* pvFields );
HRESULT GetSample(
[in] long lColNum,
[in] long lNumSampleValuesRequested,
[in] VARTYPE vtRequested,
[out] VARIANT * pvarData,
[out] long * pNumRecordsFetched);
IMMapXDataSet::Init
HRESULT Init :)
Description
Initializes the Static DataSet object. This method will be called immediately after the Static
DataSet object is created. It gives the Static DataSet object an opportunity to establish a
connection with the data source, and identifies which columns from the source data will be bound
to the map. The Static DataSet object should, before returning from this call, build an internal
collection of ColumnInfo objects (objects that implement IMMapXColumnInfo). The collection
must contain an initialized ColumnInfo object for each bound column. This collection is exposed
to MapX via the IMMapXColumnInfoContainer interface.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXDataset::GetSample
HRESULT GetSample();
Description
Used to collect a sample of data from a given source data column. Note that the returned variant
(pvData) must contain an array, even if that array contains only a single data value.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXStaticDataset::FetchData
HRESULT FetchData();
Description
Fetches a cell of data from the data source.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXStaticDataset::BeginFetch
HRESULT BeginFetch();
Description
Indicates that a fetch sequence is about to begin. Can be used to allocate/set up resources needed
for fetching data.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXStaticDataset::EndFetch
HRESULT EndFetch();
Description
Indicates that a fetch sequence has ended. Can be used to free resources that are used for fetching
data.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfoContainer::GetColumnInfoByName
HRESULT GetColumnInfoByName();
Description
Used to retrieve a ColumnInfo object by column name.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfoContainer::GetColumnInfoByIndex
HRESULT GetColumnInfoByIndex ();
Description
Used to retrieve a ColumnInfo object by column number.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfoContainer::GetColumnInfoEnumerator
HRESULT GetColumnEnumerator( );
Description
Used to retrieve a ColumnInfo Enumerator object (an object that implements
(IMMapXEnumColumnInfo). This object can be used to enumerate the collection of ColumnInfo
objects contained in the dataset.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
version(1.0)
]
interface IMMapXColumnInfo : IUnknown
{
HRESULT Init(
[in] BSTR bstrName,
[in] VARTYPE vt,
[in] long lColNum);
HRESULT GetName([out] BSTR *pbstrName);
HRESULT GetDataType([out] VARTYPE *pvt);
HRESULT GetColumnNumber([out] long *plColNum);
IMMapXColumnInfo::Init
HRESULT Init(
Description
Initialize a ColumnInfo object. MapX will never call this method, it is up to the DataSet object to
initialize the ColumnInfo object after it is created. Note that MapX currently supports only numeric
and string data types.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetName
HRESULT GetName(
The name of );
the source
data column.
Description
Retrieves the name of the source data column.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetDataType
HRESULT GetDataType(
[out]VARTYPE *pvtThe type of the source data column.);
Description
Retrieves the data type of the source data column. Note that MapX currently supports only numeric
and string data types.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetColumnNumber
HRESULT GetColumnNumber(
[out]long *pColNumThe column number of the source data column.);
Description
Retrieves the column number of the source data column.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
This is a table of the MapX errors encountered when writing MapX applications. For information on
handling errors in Visual Basic, Delphi, and Powerbuilder, see the respective programmer's reference
book and/or help system.
Error Description
Error Description
Error Description
1054 Dataset has no fields. No fields were successfully added to the dataset from
the source data.
1055 Unable to obtain a temporary directory.
1056 Unable to create a filename for the new layer.
1057 Key column not specified, cannot create new layer.
1058 The specified reference layer is not installed in the geodictionary.
1059 Unable to create new layer. Layer filename may already exist.
1060 Invalid bind layer type specified.
1061 Invalid bind layer specified.
1062 Unable to complete this type of bind with the reference column(s) specified.
1063 Unknown error creating map.
1064 Invalid Search Time specified. Time must be between 1 and 3600 seconds.
1065 Display unit specified was not valid .
1066 Inalid Conversion Constant specified.
1067 Missing or Invalid Source, or Source doesn't match Type specified.
1068 The specified reference layer is not a point reference layer.
1069 Invalid dot size.
1070 Invalid position.
1071 The maximum size for a point theme object is 48.
1072 Unable to create geotable.
1073 Unable to create map layer.
1074 Unable to set or retrieve layer information.
1075 Unable to set or retrieve label information.
1076 Unable to set or retrieve layer style information.
1077 Unable to set or retrieve label style information.
1078 Not a feature object or Feature object is no longer valid.
1079 Unable to find or load Helper Dialog DLL.
1080 Error initializing Helper Dialog DLL. Check DLL version.
1081 For the geofield specified or auto detected a secondary geofield is required,
and one was not specified or auto detected.
1082 Fields Add or Remove not allowed after dataset has been created.
1083 Property or Method not supported by layers of this type.
Error Description
Error Description
1112 The reference layer specified has no matchable columns, and therefore
cannot be used as a reference layer.
1113 Creating bitmap image failed on map export.
1114 Invalid Circle Type specified.
1115 Resolution must be >= 3
1116 Invalid Datum object.
1117 Invalid CoordSys object.
1118 Invalid units specified.
1119 Invalid origin longitude specified.
1120 Invalid origin latitude specified.
1121 Invalid standard parallel #1 specified.
1122 Invalid standard parallel #2 specified.
1123 Invalid azimuth specified.
1124 Invalid scale factor specified.
1125 Invalid false easting specified.
1126 Invalid false northing specified.
1127 Invalid range specified.
1128 Invalid bounds specified.
1129 Invalid AffineInfo object.
1130 Datum has not been specified.
1131 Units have not been specified.
1132 Origin longitude has not been specified.
1133 Origin latitude has not been specified.
1134 Standard parallel #1 has not been specified.
1135 Standard parallel #2 has not been specified.
1136 Azimuth has not been specified.
1137 Scale factor has not been specified.
1138 False easting has not been specified.
1139 False northing has not been specified.
1140 Range has not been specified.
1141 Bounds have not been specified.
Error Description
Error Description
Error Description
Error Description
Error Description
Error Description
1283 The layer specified does not contain any line, point, or area objects. Nodes
can only be shown for layers that contain line, point, or bounded area
objects.
1284 Invalid layer specified. Cannot set the insertion layer to a drilldown, raster,
seamless, or user draw layer.
1285 Invalid Field specified. Name not found, or index out of range.
1286 Error accessing the insertion tools for the map.
1287 The editable property for the insertion layer cannot be set to false.
1288 Invalid infotip popup delay. The popup delay must be a number between
50 and 10000.
1289 The height specified is not valid
1290 The width specifed is not valid
1291 Invalid LayerInfo Type.
1292 Invalid Variables object specified.
1293 Invalid Variable object specified.
1294 Invalid Storage Type for Layer Type specified.
1295 Invalid distance specified
1296 The requested property is not available for this Field type.
1297 Specified Layer does not support data binding. Remote, Seamless,
UserDraw, and Raster layers do not allow databinding.
1298 Node Editing and Feature Editing can not be enabled at the same time
1299 Invalid Indexed parameter specified.
1300 RefineBoundary specified in Search method without setting RefineLayer or
RefineDataset in Find object.
1302 Multipoint object cannot have more than one part.
1303 There are too many fields for this object theme.\nThe limit is %d.
1304 Cannot use a fields collection from a dataset that is not bound to the layer
the features belong to.
1305 Invalid field width specified
1306 Custom dataset error. Method failed:
IMMapXColumnInfo2::GetColumnWidth.
1307 Custom dataset error. Method failed:
IMMapXColumnInfo2::GetColumnDecimals.
1308 Custom dataset error. Method failed:
IMMapXColumnInfo2::GetColumnPrecision.
Error Description
Appendix D: Constants
AggregationFunctionConstants AnnotationChangedTypeConstants
AnnotationTypeConstants ApplyAttributeConstants
AreaUnitConstants BindLayerTypeConstants
CircleTypeConstants ColorConstants
ColorSpreadingMethodConstants ConversionConstants
CoordSysTypeConstants CursorConstants
DataSetTypeConstants DistribMethodConstants
DotSizeConstants ExportFormatConstants
FeatureEditModeConstants FeatureTypeConstants
FieldTypeConstants FillPatternConstants
GraduationConstants IntersectionPointConstants
IntersectionTestConstants LayerBeginAccessConstants
LayerEndAccessConstants LayerInfoTypeConstants
LayerSrvLayerOptions LayerTypeConstants
LineTypeConstants MapDrawConstants
MapUnitConstants MouseWheelSupportConstants
PaperUnitConstants PenStyleConstants
PolyToolFlagConstants PositionConstants
ResolveDataBindConstants SearchTypeConstants
SearchResultTypeConstants SelectionTypeConstants
SpreadByConstants StyleUnitConstants
SymbolTypeConstants ThemeTypeConstants
ToolConstants ToolFlagConstants
ToolTypeConstant
AggregationFunctionConstants
miAggregationSum = 0
miAggregationAverage = 1
miAggregationCount = 2
miAggregationIndividual = 4
miAggregationAuto = 5
AnnotationChangedTypeConstants
miAddAnnotation = 0
miDeleteAnnotation = 1
miSelectAnnotation = 2
miEditAnnotation = 3
AnnotationTypeConstants
miSymbolAnnotation = 1
miTextAnnotation = 6
ApplyAttributeConstants
miApplyAttributeAll = 0
miApplyAttributeColor = 1
miApplyAttributeSize = 2
AreaUnitConstants
miUnitSquareMile = 14
miUnitSquareKilometer = 15
miUnitSquareInch = 16
miUnitSquareFoot = 17
miUnitSquareYard = 18
miUnitSquareMillimeter = 19
miUnitSquareCentimeter = 20
miUnitSquareMeter = 21
miUnitSquareSurveyFoot = 22
miUnitSquareNauticalMile = 23
miUnitSquareTwip = 24
miUnitSquarePoint = 25
miUnitSquarePica = 26
miUnitSquareDegree = 27
miUnitAcre = 28
miUnitHectare = 29
miUnitSquareLink = 33
miUnitSquareChain = 34
miUnitSquareRod = 35
miUnitPerch = 36
miUnitRood = 37
BindLayerTypeConstants
miBindLayerTypeNormal = 0
miBindLayerTypeXY = 1
miBindLayerTypePointRef = 2
CircleTypeConstants
Constant Value Description
ColorConstants
Note: These numbers represent OLE_COLOR values (BGR), which can be assigned to
properties such as Style.LineColor. When specifying colors in a geoset, use RGB color
settings instead.
miColorBlack = 0
miColorRed = 255
miColorGreen = 65280
miColorBlue = 16711680
miColorMagenta = 16711935
miColorCyan = 16776960
miColorWhite = 16777215
miColorLightGray = 12632256
miColorDarkGray = 4210752
miColorGray = 8421504
miColorPaleYellow = 13697023
miColorLightYellow = 8454143
miColorYellow = 65535
miColorLimeGreen = 12639424
miColorTeal = 8421440
miColorDarkGreen = 16384
miColorMaroon = 128
miColorPurple = 8388736
miColorOrange = 33023
miColorKhaki = 7051175
miColorOlive = 32896
miColorBrown = 4210816
miColorNavy = 8404992
miColorScrollBars = 0x80000000
miColorDesktop = 0x80000001
miColorActiveTitleBar = 0x80000002
miColorInactiveTitleBar = 0x80000003
miColorMenuBar = 0x80000004
miColorWindowBackground = 0x80000005
miColorWindowFrame = 0x80000006
miColorMenuText = 0x80000007
miColorWindowText = 0x80000008
miColorTitleBarText = 0x80000009
miColorActiveBorder = 0x8000000A
miColorInactiveBorder = 0x8000000B
miColorApplicationWorkspace = 0x8000000C
miColorHighlight = 0x8000000D
miColorHighlightText = 0x8000000E
miColorButtonFace = 0x8000000F
miColorButtonShadow = 0x80000010
miColorGrayText = 0x80000011
miColorButtonText = 0x80000012
miColorInactiveCaptionText = 0x80000013
miColor3DHighlight = 0x80000014
miColor3DDarkShadow = 0x80000015
miColor3DLight = 0x80000016
miColorInfoText = 0x80000017
miColorInfoBackground = 0x80000018
ColorSpreadingMethodConstants
miColorMethodRGB = 0
miColorMethodHSV = 1
ConversionConstants
miMapToScreen = 0
miScreenToMap = 1
CoordSysTypeConstants
Constant Value Description
miAlbersEqualAreaConic 9
miAzimuthalEquidistant 5 Polar aspect only
miDblStereographic 31
miCylindricalEqualArea 2
miEckertIV 14
miEckertVI 15
miEquidistantConic 6 Also known as Simple Conic
miGall 17
miHotineObliqueMercator 7
miLambertAzimuthalEqualArea 4 Polar aspect only
miLambertConformalConic 3
miLambertConformalConicBelgium 19 Modified for Belgium 1972
miLongLat 1 Longitude/Latitude
miMercator 10
miMillerCylindrical 11
miMollweide 13
miNewZealandMapGrid 18
miNonEarth 0 Unprojected; cartesian coords.
miRobinson 12
miSinusoidal 16
miStereographic 20
miSwissObliqueMercator 25
miTransverseMercator 8 Also known as Gauss-Kruger
miTransverseMercatorDenmarkS34J 21 Modified for Danish System 34 Jylland-Fyn
miTransverseMercatorDenmarkS34S 22 Modified for Sjaelland
miTransverseMercatorDenmarkS45B 23 Modified for Danish System 45 Bornholm
miTransverseMercatorFinland 24 Modified for Finnish KKJ
miMercatorStdParallel 26 Regional Mercator
miPolyconic 27 Polyconic
CursorConstants
miDefaultCursor = 0
miArrowCursor = 1
miCrossCursor = 2
miIBeamCursor = 3
miIconCursor = 4
miSizeCursor = 5
miSizeNESWCursor = 6
miSizeNSCursor = 7
miSizeNWSECursor = 8
miSizeEWCursor = 9
miUpArrowCursor = 10
miHourglassCursor = 11
miNoDropCursor = 12
miArrowHourglassCursor = 13
miArrowQuestionCursor = 14
miSizeAllCursor = 15
miArrowToolCursor = 16
miPanCursor = 17
miCenterCursor = 18
miZoomInCursor = 19
miZoomOutCursor = 20
miSymbolCursor = 21
miTextCursor = 22
miSelectCursor = 23
miRadiusSelectCursor = 24
miRectSelectCursor = 25
miRegionSelectCursor = 26
miInfoCursor = 27
miSelectPlusCursor = 28
miSelectRadiusPlusCursor = 29
miSelectRectPlusCursor = 30
miSelectRegionPlusCursor = 31
miSelectMinusCursor = 32
miSelectRadiusMinusCursor = 33
miSelectRectMinusCursor = 34
miSelectRegionMinusCursor = 35
miLabelCursor = 36
miDrillDownExpandCursor = 37
miDrillDownContractCursor = 38
miInfoCursorOld = 39
miCustomCursor = 40
DataSetTypeConstants
miDataSetDAO = 1
miDataSetODBC = 2
miDataSetUnbound = 3
miDataSetGlobalHandle = 4
miDataSetOLEData = 5
miDataSetLayer = 6
miDataSetNotesView = 7
miDataSetNotesQuery = 8
miDataSetSafeArray = 9
miDataSetOCI = 15
miDataSetDelphi = 1010
miDataSetDelphi4 = 1011
miDatasetDelphi5 = 1012
miDataSetDelphi6 = 1013
miDataSetADO = 12
miDataSetRDO = 13
miDatasetXML = 14
DistribMethodConstants
miCustomRanges = 0
miEqualCountPerRange = 1
miEqualRangeSize = 2
miNaturalBreak = 3
miStandardDeviation = 4
DotSizeConstants
miDotSizeSmall = 0
miDotSizeLarge = 1
ExportFormatConstants
miFormatWMF = 0
miFormatBMP = 1
miFormatGIF = 2
miFormatJPEG = 3
miFormatTIF = 4
miFormatPNG = 5
miFormatPSD = 6
FeatureEditModeConstants
miEditModeFeature = 0x1
miEditModeNode = 0x2
miMoveDuplicateNodes = 0x4
miDeleteDuplicateNodes = 0x8
miEditModeAddNode = 0x40
FeatureTypeConstants
miFeatureTypeRegion = 0
miFeatureTypeLine = 1
miFeatureTypeSymbol = 2
miFeatureTypeMixed = 3
miFeatureTypeUnknown = 4
miFeatureTypeText = 5
miFeatureTypeNull = 6
miFeatureTypeMultipoint = 7
miFeatureTypeCollection = 8
FieldTypeConstants
miTypeString = 0
miTypeNumeric = 1
miTypeDate = 2
miTypeInteger = 3
miTypeSmallInt = 4
miTypeFloat = 5
miTypeLogical = 6
FillPatternConstants
miPatternNoFill = 0
miPatternHollow = 1
miPatternSolid = 2
miPatternHorizontal = 3
miPatternVertical = 4
miPatternFDiag = 5
miPatternFilBDiag = 6
miPatternCross = 7
miPatternDiagCross = 8
GraduationConstants
miGraduateBySquareRoot = 0
miGraduateByConstant = 1
miGraduateByLogarithm = 2
IntersectionPointConstants
miIntersectCrossings = 9
miIntersectCommon = 10
miIntersectAll = 11
IntersectionTestConstants
miIntersectCentroidWithinFeature = 0
miIntersectFeature = 1
miIntersectEntirelyWithinFeature = 2
LabelAlongConstants
miLabelAlongNone = 0
miLabelAlongParallel = 1
miLabelAlongMultiSegment = 2
LineTypeConstants
miLineTypeArrow = 0
miLineTypeNone = 1
miLineTypeSimple = 2
LabelChangedType Constants
miLabelMove = 0
miLabelAdd = 1
miLabelSelectionChange = 2
LayerBeginAccessConstants
miAccessRead= 0
miAccessReadWrite = 1
LayerEndAccessConstants
miAccessEnd= 0
LayerInfoTypeConstants
miLayerInfoTypeTab = 0
miLayerInfoTypeUserDraw = 1
miLayerInfoTypeRaster = 2
miLayerInfoTypeShape = 3
miLayerInfoTypeServer = 4
miLayerInfoTypeGeodictUserName = 5
miLayerInfoTypeTemp = 6
miLayerInfoTypeNewTable = 7
LayerSrvLayerOptions
miLayerCacheOn = 0
miLayerCacheOff = 1
miLayerMBRSearchOn = 0
miLayerMBRSearchOff = 2
LayerTypeConstants
miLayerTypeNormal = 0
miLayerTypeRaster = 2
miLayerTypeSeamless = 4
miLayerTypeUnknown = 5
miLayerTypeUserDraw = 6
miLayerTypeDrilldown = 7
LineTypeConstants
miLineTypeNone = 0
miLineTypeSimple = 1
miLineTypeArrow = 2
LayerPackConstants
miPackGraphics=1
miRebuildGraphics=2
miPackIndex=4
miRebuildIndex=8
miPackData=16
miCompactDB=32
miPackAll=21 (miPackGraphics & miPackIndex & miPackData)
MapDrawConstants
miDrawBegin = 1
miDrawEnd = 2
MapUnitConstants
miUnitMile = 0
miUnitKilometer = 1
miUnitInch = 2
miUnitFoot = 3
miUnitYard = 4
miUnitMillimeter = 5
miUnitCentimeter = 6
miUnitMeter = 7
miUnitSurveyFoot = 8
miUnitNauticalMile = 9
miUnitTwip = 10
miUnitPoint = 11
miUnitPica = 12
miUnitDegree = 13
miUnitLink = 30
miUnitChain = 31
miUnitRod = 32
MouseWheelSupportConstants
miNoMousewheelSupport = 1
miMousewheelNoAutoScroll = 2
miFullMousewheelSupport = 3
PaperUnitConstants
miPaperUnitMile = 0
miPaperUnitKilometer = 1
miPaperUnitInch = 2
miPaperUnitFoot = 3
miPaperUnitYard = 4
miPaperUnitMillimeter = 5
miPaperUnitCentimeter = 6
miPaperUnitMeter = 7
miPaperUnitSurveyFoot = 8
miPaperUnitNauticalMile = 9
miPaperUnitTwip = 10
miPaperUnitPoint = 11
miPaperUnitPica = 12
miPaperUnitDegree = 13
miPaperUnitLink = 30
miPaperUnitChain = 31
miPaperUnitRod = 32
PenStyleConstants
miPenNone = 0
miPenSolid = 1
Note:Other pen styles are available, although constants have not been defined for those styles; see
Style.LineStyle property.
PolyToolFlagConstants
miPolyToolBegin = 0
miPolyToolEnd = 1
miPolyToolEndEscaped = 2
miPolyToolInProgress = 3
PositionConstants
miPositionCC = 0
miPositionTL = 1
miPositionTC = 2
miPositionTR = 3
miPositionCL = 4
miPositionCR = 5
miPositionBL = 6
miPositionBC = 7
miPositionBR = 8
ResolveDataBindConstants
miChooseField = 0
miChooseLayer = 1
miChooseGeoSet = 2
SearchTypeConstants
miSearchTypeCentroidWithin = 0
miSearchTypePartiallyWithin = 1
miSearchTypeEntirelyWithin = 2
SearchResultTypeConstants
miSearchResultDefault = 0x0000
miSearchResultTopmost = 0x0001
miSearchResultRegion = 0x0002
miSearchResultPoint = 0x0004
miSearchResultLine = 0x0008
miSearchResultText = 0x0010
miSearchResultAll = 0xFFFE
miSearchResultMultipoint = 0x0020
miSearchResultCollection = 0x0040
SelectionTypeConstants
miSelectionNew = 0
miSelectionAppend = 1
miSelectionRemove = 2
SpreadByConstants
miSpreadByColor = 1
miSpreadByNone = 0
miSpreadBySize = 2
StyleUnitConstants
miStyleUnitPixel = 0
miStyleUnitTenthsOfPoint = 1
SymbolTypeConstants
miSymbolTypeBitmap = 1
miSymbolTypeTrueTypeFont = 0
miSymbolTypeVector = 2
ThemeTypeConstants
miThemeRanged = 0
miThemeBarChart = 1
miThemePieChart = 2
miThemeGradSymbol = 3
miThemeDotDensity = 4
miThemeIndividualValue = 5
miThemeAuto = 6
miLabelRangedTheme = 7
miLabelIndividualValuesTheme = 8
miThemeNone = 9
ToolConstants
miArrowTool = 1000
miPanTool = 1001
miCenterTool = 1002
miZoomInTool = 1003
miZoomOutTool = 1004
miSymbolTool = 1005
miTextTool = 1006
miSelectTool = 1007
miRadiusSelectTool = 1008
miRectSelectTool = 1009
miPolygonSelectTool = 1010
miLabelTool = 1011
miAddLineTool = 1012
miAddPolylineTool = 1013
miAddRegionTool = 1014
miAddPointTool = 1015
ToolFlagConstants
miToolBegin = 0
miToolEnd = 1
miToolEndEscaped = 2
miToolInProgress = 3
ToolTypeConstants
miToolTypePoint = 0
miToolTypeLine = 1
miToolTypeCircle = 2
miToolTypeMarquee = 3
miToolTypePoly = 4
miToolTypePolygon = 5
Expressions in MapX are useful for several reasons. The Layer.Search method can be used to select a
subset of a layer's features based on an expression. In this case, the expression should evaluate to a
boolean value, e.g. "year(Received) = 1990 and month(Received) > 4".
The DataSet.AddField method uses expressions to create a new field by applying an expression to the
existing columns. These expressions can evaluate to a date, numerical, or string value, as in
"Female_Pop + Male_Pop" or "Proper$(City) + "", "" + UCase$(State)"
Expressions are formed using dataset field names, constants (i.e. specific data values), or variable
substitutions, along with functions and operators which act upon the columns and constants.
MapX allows for the use of variable substitution in expressions. An expression can contain a reference
to a variable name. A variable is a name along with a variant. When the expression sees an unresolved
identifier it will try to resolve it in the variables collection. The variant can be of any type (date, string,
number, etc, or MapX Feature object.)
String constants in expressions should be enclosed in double quotes so that MapX knows to treat it as
a string, rather than thinking it is a dataset field name or variable.
In expressions, MapX will perform a type conversion from boolean to string for function parameters
that expect a string argument.
When specifying dates as string constants, the following applies:
• Dates consist of a month, a day, and an optional year.
• The year is specified by four digits.
• The entire date string should be enclosed in double quotes.
• The components of a date can be separated by hyphens or slashes.
Contents
• Operators
• Functions
Operators
Below is a list of the operators used in MapX and related topics.
Operators:
• Geographic operators
• Mathematical operators
• String operators
• Comparison operators
• Numerical Comparison
• String Comparison
• Date Comparison
• Logical Comparison
• Logical operators
Related Topics:
• String Clauses
• Date Clauses
• Keywords
• Operator Precedence
Geographic operators
MapX supports several geographic operators: contains, contains_within, entirely_within, intersects,
and within. These operators can be used in any MapX expression. All geographic operators are infix
operators (i.e. they operate on two objects and return boolean).
object1 CONTAINS object2 Centroid of second object is within the first object.
object1 CONTAINS ENTIRE object2 Second object is entirely inside the first object.
object1 CONTAINS PART object2 First object touches second object.
object1 ENTIRELY WITHIN object2 First object is entirely inside the second object.
object1 INTERSECTS object2 First object touches second object
object1 PARTLY WITHIN object2 First object touches second object.
object1 WITHIN object2 Centroid of first object is within the second object.
Mathematical operators
A+B + addition
A-B - subtraction
-A (negative) - negation
A*B * multiplication
A/B / division
A\B \ integer division
A^B ^ exponentiation
Note that you can:
• Add numbers to dates to yield another date.
• Subtract a number from a date to yield another date.
• Subtract a date from a date to yield a number.
When you add numbers to dates, or subtract numbers from dates, MapX treats the numbers as
specifying a number of days. If you want to add or subtract a week, you would use the number 7.
When you want to add or subtract a month, you could use 30 or 31. When MapX subtracts a date from
a date, the resulting number indicates a number of days.
String operators
& “concatenation” — connects strings and string expressions.
+ “concatenation” — connects strings and string expressions.
Note: Remember that string constants must be enclosed in double quotes.
Comparison operators
= “equals”
<> “not equals”
> “greater than”
< “less than”
>= “greater than or equal to”
<= “less than or equal to”
Numerical Comparison
Numerical comparisons are based on the numerical values of the expressions and numerical constants.
Example
All rows where the median age is 42.
• MED_AGE=42
Note: This expression selects only those records where the median age is exactly 42. When your
median age data contains a decimal portion (which is the case for MapInfo–supplied
demographic data) then it is unlikely that there are many regions with a median age of
exactly 42. In this case, you may want to use the Round function to search for records
whose median age is approximately equal to 42.
String Comparison
String comparisons are based on the exact character content of the string. In this case “>” means
“alphabetically greater than” (i.e. comes after in the alphabet) and “<” means “alphabetically less
than.”
When typing a string constant into an expression, you should enclose it in quotes so that MapX knows
to treat it as a string, rather than treating it as a column name.
Example
All rows where the vendor is Acme.
• VENDOR=”Acme”
Note: The equal operator is case insensitive.
Date Comparison
Remember to enclose date constants in quotes and use the order Month, Day, Year.
Example
All received after October 9, 1991.
• RECEIVED>stringtodate("10-9-91")
Note: This expression does not select those received on October 9, 1991. When you want them as
well, use the ">=" operator
• RECEIVED>=stringtodate("10-9-91")
Example
Records for all received before August, no matter what year.
• Month(RECEIVED)<8
Logical Comparison
Example
All that have shipped.
• Shipped
Note: The column “Shipped” is a logical column. It contains “T” for true, or yes, and “F” for
false, or no. When an order is shipped, it is marked “T”. Otherwise, it is not shipped. For
orders that are shipped, expression 27 evaluates to true. For orders not shipped it evaluates
to false.
Example
All that have not shipped.
• Str$(Shipped)=”F”
• Not Shipped
Logical operators
and Is “true” if (and only if) both of its arguments (the expressions it joins
together) are true. A record must satisfy both of these conditions if it is to be
selected.
or is “true” if either one, or both, of its arguments (the expressions it joins
together) are true. A record need satisfy only one of these conditions if it is to
be selected. It is also selected if both of its conditions are satisfied.
not is “true” if its argument (the expression it applies to) is false. A record is
selected if it does not meet the stated condition.
“And”, “or”, and “not” are logical operators. You use them to combine expressions when using
methods like Layer.Search.
For example, suppose you want to select all properties that are worth $250,000 or more and are in
Columbia county. So, you would combine two simple expressions using the "and" operator:
• COUNTY = ”Columbia” and VALUE >= 250000
Now, what if you want all properties worth $250,000 or more and not in Columbia county? You can
use “not” to negate the first clause of the previous expression:
• not(COUNTY=”Columbia”) and VALUE>=250000
You can use “or” when you want to specify alternative conditions, such as:
• COUNTY=”Columbia” or COUNTY=”Greene”
String Clauses
Example
All customers from N to Q.
• LAST_NAME >= ”N” and LAST_NAME <”R”
Note: The first part of the expression checks for names that are either alphabetically equal to “n”
or that are alphabetically greater than (after) “n”. The second part of the expression checks
for names that are alphabetically less than (before) “r”. Any name starting with letters “n”
through “q” satisfies this condition.
Example
All customers whose last name begins with C.
• LAST_NAME>=”C” and LAST_NAME<”D”
Note: The logic of this expression is the same as the logic for expression 47.
Date Clauses
Example
Records for all received in August 1990
• Month(RECEIVED)=8 and Year(RECEIVED)=1990
Note: In this expression we specify the year explicitly, using the “year(<somecolumn>)”
function to extract it from the date.
Example
Records for all received in July or September of 1989
• month(RECEIVED)=(7, 9) and year(RECEIVED)=89
Keywords
MapX supports the use of keywords "like" and “between”.
Consider the following example, which illustrates “between”:
• PRICE between 50000 and 100000
You can also use between with character strings.
The keyword "like" is used for string pattern matching.
• The underscore character matches a single character.
• The percent character matches zero or more characters.
The comparison is case insensitive.
Example
To determine if a string starts with "South"
• STATE like "South%"
Operator Precedence
When MapX evaluates expressions it needs to know which components of an expression to evaluate
first. This is called precedence. By convention, certain operators are assigned different levels of
precedence. Those with the highest level are evaluated first. The following table lists MapX's operators
in the order in which they are evaluated. Operators at the same level of precedence are evaluated from
left to right, besides exponentiation, which evaluates from the right.
exponentiation
negation
multiplication, division
addition, subtraction
geographic operators
comparison operators
Not
And
Lowest Priority: Or
For example, the expression 3+4*2 produces a result of 11. That is because multiplication has a higher
precedence than addition and is performed first. Parenthesis must be used to force MapX to do the
addition first: (3+4)*2.
Now consider this expression, which is intended to select all records July or September of 1989.
• year(RECEIVED)=89 and month(RECEIVED)=7 or month(RECEIVED)=9
Because “and” has higher precedence than “or”, MapX treats this expression as though
“year(RECEIVED)=89 and month(RECEIVED)=7” was enclosed in parentheses. In this case, any
record for July of 89 or for September of any year would be selected. That's probably not what you
want. However, by adding parentheses to the second expression, you can get what you want:
• year(RECEIVED)=89 and (month(RECEIVED)=7 or month(RECEIVED)=9)
Note: When you are not sure how MapX evaluates an expression with several operators, you
should use parentheses to group elements as you want them.
Functions
Functions take data values and perform some operation on them to produce a new value. Most of
MapX's functions take one or two parameters. A parameter can be a column or it can be another
expression.
MapX uses the keyword “obj” or “object” with the geographic functions: Area, CentroidX, CentroidY,
ObjectLen, and Perimeter. This keyword tells MapX that it has to get values based on the graphical
objects in the table rather than the tabular data.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
MapX Functions
Abs( ) function
Purpose
This returns the absolute value of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Abs( num_expr )
Part Description
Remarks
The Abs( ) function returns the absolute value of the expression specified by num_expr.
If num_expr has a value greater than or equal to zero, Abs( ) returns a value equal to num_expr. If
num_expr has a negative value, Abs( ) returns a value equal to the value of num_expr multiplied by
negative one.
Acos( ) function
Purpose
This returns the arc-cosine value of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Acos(num_expr)
Part Description
Remarks
The Acos( ) function returns the arc-cosine of the numeric num_expr value. In other words, Acos( )
returns the angle whose cosine is equal to num_expr.
The result returned from Acos( ) represents an angle, expressed in radians. This angle will be
somewhere between zero and Pi radians (given that Pi is equal to approximately 3.141593, and given
that Pi/2 radians represents 90 degrees).
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
Since cosine values range between one and minus one, the expression num_expr should represent a
value no larger than one and no smaller than minus one.
Area( ) function
Purpose
This returns the geographical area of an Object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Area(obj_expr, unit_name)
Part Description
Remarks
The Area( ) function returns the area of the geographical object specified by obj_expr.
The function returns the area measurement in the units specified by the unit_name parameter; for
example, to obtain an area in acres, specify "acre" as the unit_name parameter. See the Set Area Units
statement for the list of available unit names.
Only regions, ellipses, rectangles, and rounded rectangles have any area. By definition, the Area( ) of a
point, arc, text, line, or polyline object is zero. The Area( ) function returns approximate results when
used on rounded rectangles. MapX calculates the area of a rounded rectangle as if the object were a
conventional rectangle.
Asc( ) function
Purpose
This returns the character code for the first character in a string expression.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ int= ]Asc(string_expr)
Part Description
Remarks
The Asc( ) function returns the character code representing the first character in the string specified by
string_expr.
If string_expr is a null string, the Asc( ) function returns a value of zero.
Note that the Windows and Macintosh operating environments use different character sets. Therefore,
the values returned by the Asc( ) function depend partly on the operating environment that is in use at
run-time. However, all MapInfo environments have common character codes within the range of 32
(space) to 126 (tilde).
On a system that supports double-byte character sets (e.g. Windows Japanese): if the first character of
string_expr is a single-byte character, Asc( ) returns a number in the range 0 - 255; if the first character
of string_expr is a double-byte character, Asc( ) returns a value in the range 256 - 65,535.
On systems that do not support double-byte character sets, Asc( ) returns a number in the range 0 -
255.
Asin( ) function
Purpose
This returns the arc-sine value of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Asin ( num_expr )
Part Description
Remarks
The Asin( ) function returns the arc-sine of the numeric num_expr value. In other words, Asin()
returns the angle whose sine is equal to num_expr.
The result returned from Asin( ) represents an angle, expressed in radians. This angle will be
somewhere between -Pi/2 and Pi/2 radians (given that Pi is approximately equal to 3.141593, and
given that Pi/2 radians represents 90 degrees).
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
Since sine values range between one and minus one, the expression num_expr should represent a
value no larger than one and no smaller than minus one.
Atn( ) function
Purpose
This returns the arc-tangent value of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Atn( num_expr )
Part Description
Remarks
The Atn( ) function returns the arc-tangent of the numeric num_expr value. In other words, Atn( )
returns the angle whose tangent is equal to num_expr. The num_expr expression can have any
numeric value.
The result returned from Atn( ) represents an angle, expressed in radians, in the range -Pi/2 radians to
Pi/2 radians.
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
Buffer( ) function
Purpose
This returns a region object that represents a buffer region (the area within a specified buffer distance
of an existing object).
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ region object= ]Buffer( inputobject, resolution, width, unit_name )
Part Description
Remarks
The Buffer( ) function returns a region representing a buffer.
Centroid( ) function
Purpose
This returns the centroid (center point) of an object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ Point object= ]Centroid(obj_expr)
Part Description
Remarks
The Centroid( ) function returns a point object, which is located at the centroid of the specified
obj_expr object.
Note: In MapInfo, a region’s centroid does not represent its center of mass. Instead, the centroid
represents the location used for automatic labeling, geocoding, and placement of thematic
pie and bar charts. If you edit a map in reshape mode, you can reposition region centroids
by dragging them.
If the obj_expr parameter represents a point object, the Centroid( ) function returns the position of the
point.
If the obj_expr parameter represents a line object, the Centroid( ) function returns the point midway
between the ends of the line.
If the obj_expr parameter represents a polyline object, the Centroid( ) function returns a point located
at the mid point of the middle segment of the polyline.
If the obj_expr parameter represents any other type of object, the Centroid( ) function returns a point
located at the true centroid of the original object. For rectangle, arc, text, and ellipse objects, the
centroid position is halfway between the upper and lower extents of the object, and halfway between
the left and right extents. For region objects, however, the centroid position is always "on" the object in
question, and therefore may not be located halfway between the object’s extents.
CentroidX( ) function
Purpose
This returns the x-coordinate of the centroid of an object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]CentroidX( obj_expr )
Part Description
Remarks
The CentroidX( ) function returns the X coordinate (e.g. Longitude) component of the centroid of the
specified object. See the Centroid( ) function for a discussion of what the concept of a centroid position
means with respect to different types of graphical objects (lines vs. regions, etc.).
The coordinate information is returned in Map.NumericCoordSys. By default, MapX uses a longitude,
latitude coordinate system.
CentroidY( ) function
Purpose
This returns the y-coordinate of the centroid of an object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]CentroidY(obj _expr)
Part Description
Remarks
The CentroidY( ) function returns the Y-coordinate (e.g. latitude) component of the centroid of the
specified object. See the Centroid( ) function for a discussion of what the concept of a centroid position
means, with respect to different types of graphical objects (lines vs. regions, etc.).
The coordinate information is returned in Map.NumericCoordSys. By default, MapX uses a longitude,
latitude coordinate system.
Chr$( ) function
Purpose
This returns a one-character string corresponding to a specified character code.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Chr$(num_expr)
Part Description
Remarks
The Chr$( ) function returns a string, one character long, based on the character code specified in the
num_expr parameter. On most systems, num_expr should be a positive Integer value between 0 and
255. On systems that support double-byte character sets (e.g. Windows Japanese), num_expr can have
a value from 0 to 65,535.
If the num_expr parameter is fractional, MapX rounds to the nearest integer.
Character 12 is the form-feed character. Thus, you can use the statement Print Chr$(12) to clear the
Message window. Character 10 is the line-feed character; see example below.
Character 34 is the double-quotation mark ("). If a string expression includes the function call Chr$(34),
MapX embeds a double-quote character in the string.
Cos( ) function
Purpose
This returns the cosine of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Cos (num_expr)
Parts Description
Remarks
The Cos( ) function returns the cosine of the numeric num_expr value, which represents an angle in
radians. The result returned from Cos( ) will be between one and minus one.
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
CurDate( ) function
Purpose
Returns the current date in YYYYMMDD format.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
CurDate( )
Return Value
Date
Remarks
The Curdate( ) function returns a Date value representing the current date. The format will always be
YYYYMMDD. To change the value to a string in the local system format use the FormatDate$( ) or
Srt$( ) functions.
Day( ) function
Purpose
Returns the day component from a Date expression.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
Day( date_expr )
date_expr is a Date expression
Return Value
SmallInt from 1 to 31
Remarks
The Day( ) function returns an integer value from one to thirty-one, representing the day-of-the-month
component of the specified date. For example, if the specified date is 12/17/93, the Day( ) function
returns a value of 17.
DeformatNumber$( ) function
Purpose
Removes formatting from a string that represents a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]DeformatNumber$ ( numeric_string )
Part Description
Remarks
This function returns a string that represents a number. The return value does not include thousands
separators, regardless of whether the numeric_string argument included thousands separators. The
return value uses a period as the decimal separator, regardless of whether the user's computer is set up
to use another character as the decimal separator.
Distance( ) function
Purpose
This returns the distance between two locations.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Distance( x1 , x2 , y1 , y2 , unit_name)
Part Description
Remarks
The Distance( ) function calculates the distance between two locations.
The function returns the distance measurement in the units specified by the unit_name parameter; for
example, to obtain a distance in miles, specify "mi" as the unit_name parameter. See
MapUnitConstants on page 599 for the list of available unit names.
The x- and y-coordinate parameters must use the coordinate system set in Map.NumericCoordSys. By
default, MapInfo expects coordinates to use a longitude, latitude coordinate system.
If Map.NumericCoordSys is an earth coordinate system, Distance( ) returns the great-circle distance
between the two points. A great-circle distance is the shortest distance between two points on a
sphere. (A great circle is a circle that goes around the earth, with the circle’s center at the center of the
earth; a great-circle distance between two points is the distance along the great circle which connects
the two points.)
If Map.NumericCoordSys is a non-earth coordinate system, Distance( ) returns the Cartesian distance.
Exp( ) function
Purpose
This returns the number e raised to a specified exponent.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Exp( num_expr )
Part Description
Remarks
The Exp( ) function raises the mathematical value e to the power represented by num_expr has a value
of approximately 2.7182818.
Fix( ) function
Purpose
This returns an integer value, obtained by removing the fractional part of a decimal value.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ Int= ]Fix(num_expr)
Part Description
Remarks
The Fix( ) function removes the fractional portion of a number, and returns the resultant integer value.
The Fix( ) function is similar to, but not identical to, the Int( ) function. The two functions differ in the
way that they treat negative fractional values. When passed a negative fractional number, Fix( )
returns the nearest integer value greater than or equal to the original value; thus, the function call:
Fix(-2.3)
returns a value of -2. But when the Int( ) function is passed a negative fractional number, it returns the
nearest integer value that is less than or equal to the original value. Thus, the function call:
Int(-2.3)
returns a value of -3.
Format$( ) function
Purpose
This returns a string representing a custom-formatted number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Format$(value , pattern)
Part Description
Remarks
The Format$( ) function returns a string representing a formatted number. Given a numeric value such
as 12345.67, Format$( ) can produce formatted results such as "$12,345.67".
The value parameter specifies the numeric value that you want to format.
The pattern parameter is a string of code characters, chosen to produce a particular type of formatting.
The pattern string should include one or more special format characters, such as #, 0, % , the comma
character, the period, or the semi-colon; these characters control how the results will look. The table
below summarizes the format characters.
# The result will include one or more digits from the value.
If the pattern string contains one or more # characters to the left of the
decimal place, and if the value is between zero and one, the formatted
result string will not include a zero before the decimal place.
0 A digit placeholder similar to the # character. If the pattern string
contains one or more 0 characters to the left of the decimal place, and
the value is between zero and one, the formatted result string will
include a zero before the decimal place. See examples below.
. (period) The pattern string must include a period if you want the result string to
include a "decimal separator." The result string will include the decimal
separator currently in use on the user's computer. To force the decimal
separator to be a period, use the Set Format statement.
, (comma) The pattern string must include a comma if you want the result string to
include "thousand separators." The result string will include the
thousand separator currently set up on the user's computer. To force the
thousand separator to be a comma, use the Set Format statement.
% The result will represent the value multiplied by one hundred; thus, a
value of 0.75 will produce a result string of "75%". If you wish to include
a percent sign in your result, but you do not want MapX to multiply the
value by one hundred, place a \ (back slash) character before the
percent sign (see below).
E+ The result is formatted with scientific notation. For example, the value
1234 produce the result "1.234e+03". If the exponent if positive, a plus
sign appears after the "e". If the exponent is negative (which is the case
for fractional numbers), the results include a minus sign after the "e".
E- This string of control characters functions just as the "E+" string, except
that the result will never show a plus sign following the "e".
; (semi-colon) By including a semicolon in your pattern string, you can specify one
format for positive numbers and another format for negative numbers.
Place the semicolon after the first set of format characters, and before
the second set of format characters. The second set of format characters
applies to negative numbers. If you want negative numbers to appear
with a minus sign, include "-" in the second set of format characters.
\ If the back slash character appears in a pattern string, MapX does not
perform any special processing for the character which follows the back
slash. This lets you include special characters (e.g. % ) in the results,
without causing the special formatting actions described above.
FormatDate$( ) function
Purpose
Returns a date formatted in the short date style specified by the Control Panel.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]FormatDate$ ( value )
Part Description
Remarks
The FormatDate$( ) function returns a string representing a date in the local system format as specified
by the Control Panel.
FormatNumber$( ) function
Purpose
This returns a string representing a number, including thousands separators and decimal-place
separators that match the user's system configuration.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]FormatNumber$( num )
Part Description
Remarks
This function returns a string that represents a number. If the number is large enough that it needs
thousands separators, this function inserts thousands separators. MapInfo reads the user's system
configuration to determine which characters to use as the thousands separator and decimal separator.
The following table demonstrates how the FormatNumber$( ) function behaves if the user's computer
is set up to use comma as the thousands separator and period as the decimal separator (United States
defaults):
If the user's computer is set up to use period as the thousands separator and comma as the decimal
separator, the following table demonstrates the results:
InStr( ) function
Purpose
This returns a character position, indicating where a substring first appears within another string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ int= ]InStr( position, string, substring )
Part Description
Remarks
The InStr( ) function tests whether the string expression string contains the string expression substring.
MapX searches the string expression, starting at the position indicated by the position parameter; thus,
if the position parameter has a value of one, MapX will search from the very beginning of the string
parameter.
If string does not contain substring, the InStr( ) function returns a value of zero.
If string does contain substring, the InStr( ) function returns the character position where the substring
appears. For example, if the substring appears at the very start of the string, InStr( ) will return a value
of one.
If the substring parameter is a null string, the InStr( ) function returns zero.
The InStr( ) function is case-sensitive. In other words, the InStr( ) function cannot locate the substring
"BC" within the larger string "abcde", because "BC" is upper-case.
Int( ) function
Purpose
This returns an integer value obtained by removing the fractional part of a decimal value.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ Int= ]Int( num_expr )
Part Description
Remarks
The Int( ) function returns the nearest integer value that is less than or equal to the specified num_expr
expression.
Note that the Fix( ) function is similar to, but not identical to, the Int( ) function. The two functions
differ in the way that they treat negative fractional values. When passed a negative fractional number,
Fix( ) will return the nearest integer value greater than or equal to the original value; thus, the function
call
Fix(-2.3)
will return a value of -2. But when the Int( ) function is passed a negative fractional number, it returns
the nearest integer value that is less than or equal to the original value. Thus, the function call
Int(-2.3)
returns a value of -3.
LCase$( ) function
Purpose
This returns a lower-case equivalent of a string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]LCase$( string_expr )
Part Description
Remarks
The LCase$( ) function returns the string which is the lower-case equivalent of the string expression
string_expr.
Conversion from upper- to lower-case only affects alphabetic characters (A through Z); numeric digits
and punctuation marks are not affected. Thus, the function call:
LCase$( "A#12a" )
returns the string value "a#12a".
Left$( ) function
Purpose
This returns part or all of a string, beginning at the left end of the string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Left$( string_expr, num_expr )
Part Description
Remarks
The Left$( ) function returns a string which consists of the left most num_expr characters of the string
expression string_expr.
The num_expr parameter should be an integer value, zero or larger. If num_expr has a fractional
value, MapX rounds to the nearest integer. If num_expr is zero, Left$( ) returns a null string. If the
num_expr parameter is larger than the number of characters in the string_expr string, Left$( ) returns a
copy of the entire string_expr string.
Log( ) function
Purpose
This returns the natural logarithm of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Log( num_expr )
Part Description
Remarks
The Log( ) function returns the natural logarithm of the numeric expression specified by the num_expr
parameter.
The natural logarithm represents the number to which the mathematical value e must be raised in
order to obtain num_expr has a value of approximately 2.7182818.
The logarithm is only defined for positive numbers; accordingly, the Log( ) function will generate an
error if num_expr has a negative value.
You can calculate logarithmic values in other bases (e.g. base 10) using the natural logarithm. To obtain
the base-10 logarithm of the number n, divide the natural log of n ( Log( n ) ) by the natural logarithm
of 10 ( Log( 10 ) ).
LTrim$( ) function
Purpose
Trims space characters from the beginning of a string and returns the results.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]LTrim$( string_expr )
Part Description
Remarks
The LTrim$( ) function removes any spaces from the beginning of the string_expr string, and returns
the resultant string.
Maximum( ) function
Purpose
This returns the larger of two numbers.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Maximum( num_expr , num_expr )
Part Description
Remarks
The Maximum( ) function returns the larger of two numeric expressions.
MBR( ) function
Purpose
This returns a rectangle object, representing the minimum bounding rectangle of another object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ Rectangle object= ]MBR( obj_expr )
Part Description
Remarks
The MBR( ) function calculates the minimum bounding rectangle (or MBR) which encompasses the
specified obj_expr object.
A minimum bounding rectangle is defined as being the smallest rectangle which is large enough to
encompass a particular object. In other words, the MBR of the United States extends east to the eastern
tip of Maine, south to the southern tip of Hawaii, west to the western tip of Alaska, and north to the
northern tip of Alaska.
The MBR of a point object has zero width and zero height.
Mid$( ) function
Purpose
This returns a string extracted from the middle of another string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Mid$( string_expr, position, length )
Part Description
Remarks
The Mid$( ) function returns a substring copied from the specified string_expr string.
Mid$( ) copies length characters from the string_expr string, starting at the character position
indicated by position. A position value less than or equal to one tells MapX to copy from the very
beginning of the string_expr string.
If the string_expr string is not long enough, there may not be length characters to copy; thus,
depending on all of the parameters, the Mid$( ) may or may not return a string length characters long.
If the position parameter represents a number larger than the number of characters in string_expr,
Mid$( ) returns a null string. If the length parameter is zero, Mid$( ) returns a null string. If the length
or position parameters are fractional, MapX rounds to the nearest integer.
Minimum( ) function
Purpose
This returns the smaller of two numbers.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Minimum( num_expr , num_expr )
Part Description
Remarks
The Minimum( ) function returns the smaller of two numeric expressions.
Month( ) function
Purpose
This returns the month component (1 - 12) of a date value.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ SmallInt value from 1 to 12, inclusive= ]Month( date_expr )
Remarks
The Month( ) function returns an integer, representing the month component (one to twelve) of the
specified date.
ObjectLen( ) function
Purpose
This returns the geographic length of a line or polyline object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]ObjectLen( expr , unit_name )
Part Description
Remarks
The ObjectLen( ) function returns the length of an object expression. Note that only line and polyline
objects have length values greater than zero; to measure the circumference of a rectangle, ellipse, or
region, use the Perimeter( ) function.
The ObjectLen( ) function returns a length measurement in the units specified by the unit_name
parameter; for example, to obtain a length in miles, specify "mi" as the unit_name parameter. See the
Set Distance Units statement for the list of valid unit names.
ObjectType( ) function
Purpose
Returns the type of the object (GeoObject.h).
• POINT= 1
• LINE = 2
• ARC = 3
• POLYLINE = 4
• REGION = 5
• TEXT= 6
• RECT= 7
• ROUNDRECT = 8
• ELLIPSE = 9
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
ObjectType( object)
Part Description
Return Value
Integer
Perimeter( ) function
Purpose
This returns the perimeter of a graphical object.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Perimeter( obj_expr , unit_name )
Part Description
Remarks
The Perimeter( ) function calculates the perimeter of the obj_expr object. The Perimeter( ) function is
defined for the following object types: ellipses, rectangles, rounded rectangles, and polygons. Other
types of objects have perimeter measurements of zero.
The Perimeter( ) function returns a length measurement in the units specified by the unit_name
parameter; for example, to obtain a length in miles, specify "mi" as the unit_name parameter. See the
Set Distance Units statement for the list of valid unit names.
The Perimeter( ) function returns approximate results when used on rounded rectangles. MapX
calculates the perimeter of a rounded rectangle as if the object were a conventional rectangle.
Proper$( ) function
Purpose
This returns a mixed-case string, where only the first letter of each word is capitalized.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Proper$( string_expr )
Part Description
Remarks
The Proper$( ) function first converts the entire string_expr string to lower case, and then capitalizes
only the first letter of each word in the string, thus producing a result string with "proper"
capitalization. This style of capitalization is appropriate for proper names.
Right$( ) function
Purpose
This returns part or all of a string, beginning at the right end of the string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Right$( string_expr, num_expr )
Part Description
Remarks
The Right$( ) function returns a string which consists of the right most num_expr characters of the
string expression string_expr.
The num_expr parameter should be an integer value, zero or larger. If num_expr has a fractional
value, MapX rounds to the nearest integer. If num_expr is zero, Right$( ) returns a null string. If
num_expr is larger than the number of characters in the string_expr string, Right$( ) returns a copy of
the entire string_expr string.
Round( ) function
Purpose
This returns a number obtained by rounding off another number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Round( num_expr, round_to )
Part Description
Remarks
The Round( ) function returns a rounded-off version of the numeric num_expr expression.
The precision of the result depends on the round_to parameter. The Round( ) function rounds the
num_expr value to the nearest multiple of the round_to parameter. If round_to is 0.01, MapInfo
rounds to the nearest hundredth; if round_to is 5, MapInfo rounds to the nearest multiple of 5; etc.
RTrim$( ) function
Purpose
Trims space characters from the end of a string, and returns the results.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]RTrim$( string_expr )
Part Description
Remarks
The RTrim$( ) function removes any spaces from the end of the string_expr string, and returns the
resultant string.
Sgn( ) function
Purpose
This returns -1, 0, or 1, to indicate that a specified number is negative, zero, or positive (respectively).
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Sgn( num_expr )
Part Description
Remarks
The Sgn( ) function returns a value of -1 if the num_expr is less than zero, a value of 0 (zero) if
num_expr is equal to zero, or a value of 1 (one) if num_expr is greater than zero.
Sin( ) function
Purpose
This returns the sine of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
Syntax
[ float= ]Sin( num_expr )
Part Description
Remarks
The Sin( ) function returns the sine of the numeric num_expr value, which represents an angle in
radians. The result returned from Sin( ) will be between one and minus one.
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
Space$( ) function
Purpose
This returns a string consisting only of spaces.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Space$( num_expr )
Part Description
Remarks
The Space$( ) function returns a string num_expr characters long, consisting entirely of space
characters.
If the num_expr value is less than or equal to zero, the Space$( ) function returns a null string.
Sqr( ) function
Purpose
This returns the square root of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Sqr( num_expr )
Part Description
Remarks
The Sqr( ) function returns the square root of the numeric expression specified by num_expr. Since the
square root operation is undefined for negative real numbers, num_expr should represent a value
greater than or equal to zero.
Taking the square root of a number is equivalent to raising that number to the power 0.5. Accordingly,
the expression Sqr(n) is equivalent to the expression n ^ 0.5; the Sqr( ) function, however, provides the
fastest calculation of square roots.
StringCompare( ) function
Purpose
Performs case-sensitive string comparisons.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
StringCompare( string1, string2 )
string1 and string2 are String expressions
Return Value
SmallInt: -1 if first string precedes second; 1 if first string follows second; zero if strings are equal
Remarks
The StringCompare( ) function performs case-sensitive string comparisons. MapX string comparisons
which use the "=" operator are case-insensitive. Thus, a comparison expression such as the following:
If "ABC" = "abc" Then
evaluates as TRUE, because string comparisons are case-insensitive.
The StringCompare( ) function performs a case-sensitive string comparison and returns an indication
of how the strings compare.
StringCompareIntl( ) function
Purpose
Performs language-sensitive string comparisons.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
StringCompareIntl( string1 , string2 )
string1 and string2 are the string expressions being compared
Return Value
SmallInt: -1 if first string precedes second; 1 if first string follows second; zero if strings are equal.
Remarks
The StringCompareIntl( ) function performs language-sensitive string comparisons. Call this function
if you need to determine the alphabetical order of two strings, and the strings contain characters that
are outside the ordinary U.S. character set (e.g. umlauts).
The comparison uses whatever language settings are in use on the user's computer. For example, a
Windows user can control language settings through the Control Panel.
-1 first string precedes the second string, using the current language setting
0 the two strings are equal
1 first string follows the second string, using the current language setting
StringToDate( ) function
Purpose
The StringToDate( ) function returns a Date value, given a string that represents a date.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
StringToDate ( datestring )
Return Value
Date
Remarks
MapX interprets the date string according to the date-formatting options that are set up on a user's
computer. Computers within the United States are usually configured to format dates as Month/Day/
Year, but computers in other countries are often configured with a different order (e.g. Day/Month/
Year) or a different separator character (e.g. a period instead of a /). The sequence of m/d/y in the
string needs to match the Windows system's short-date-format setting. If the setting is MM/DD/YY,
then the example above of "51/01/01" will be invalid because month "51" does not exist.
To force the StringToDate( ) function to apply U.S. formatting conventions, use the Set Format
statement.
Note: When U.S. formatting conventions apply, the datestring parameter must use the forward-
slash character (/) to separate the day, month, and year components of the date.
The datestring argument must indicate the month (1 - 12, represented as one or two digits) and the day
of the month (1 - 31, represented as one or two digits).
You may specify the year as a four-digit number, or you may omit the year entirely. If you do not
specify a year, MapX uses the current year.
Note: MapInfo Corporation recommends using a 4-digit format for years in any date variable or
date string. @-digit years return unexpected results.
If you're using a MapX variable object with a date type, and you DO supply 2-digit year
representation, then the development environment (not MapX) will determine the century.
StringToDate takes only a string variable as a parameter. It does not take a MapX date type variable.
Str$( ) function
Purpose
This returns a string representing an expression (e.g. a printout of a number).
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]Str$( expression )
Part Description
Remarks
The Str$( ) function returns a string which represents the value of the specified expression.
If the expression is a negative number, the first character in the returned string is the minus sign (-). If
the expression is a positive number, the first character in the string is a space.
Depending on the number of digits of accuracy in the expression you specify, and depending on how
many of the digits are to the left of the decimal point, the Str$( ) function may return a string which
represents a rounded value. If you need to control the number of digits of accuracy displayed in a
string, use the Format$( ) function.
If the expression is an Object expression, the Str$( ) function returns a string, indicating the object type:
Arc, Ellipse, Frame, Line, Point, Polyline, Rectangle, Region, Rounded Rectangle, or Text.
If the expression is an Object expression of the form tablename.obj and if the current row from that
table has no graphic object attached, Str$( ) returns a null string. Note: Passing an uninitialized Object
variable to the Str$( ) function generates an error.
If the expression is a Date, the output from Str$( ) depends on how the user’s computer is configured.
If the expression is a number, the Str$( ) function uses a period as the decimal separator, even if the
user’s computer is set up to use another character as decimal separator. The Str$( ) function never
includes thousands separators in the return string. To produce a string that uses the thousands
separator and decimal separator specified by the user, use the FormatNumber$( ) function.
Tan( ) function
Purpose
This returns the tangent of a number.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Tan( num_expr )
Part Description
Remarks
The Tan( ) function returns the tangent of the numeric num_expr value, which represents an angle in
radians.
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
UCase$( ) function
Purpose
This returns a string, converted to upper-case.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ string= ]UCase$( string_expr )
Part Description
Remarks
The UCase$( ) function returns the string which is the upper-case equivalent of the string expression
string_expr.
Conversion from lower to upper case only affects alphabetic characters (A through Z); numeric digits
and punctuation marks are not affected. Thus, the function call:
UCase$("A#12a")
returns the string value "A#12A".
Val( ) function
Purpose
This returns the numeric value represented by a string.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ float= ]Val( string_expr )
Part Description
Remarks
The Val( ) function returns a number based on the string_expr string expression. Val( ) ignores any
white spaces (tabs, spaces, line feeds) at the start of the string_expr string, then tries to interpret the
first character(s) as a numeric value. The Val( ) function then stops processing the string as soon as it
finds a character that is not part of the number.
If the first non-white-space character in the string is not a period, a digit, a minus sign, or an
ampersand character (&), Val( ) returns zero. (The ampersand is used in hexadecimal notation; see
example below.)
Note: If the string includes a decimal separator, it must be a period, regardless of whether the
user’s computer is set up to use some other character as the decimal separator. Also, the
string cannot contain thousands separators. To remove thousands separators from a
numeric string, call the DeformatNumber$( ) function.
Weekday( ) function
Purpose
This returns an integer from 1 to 7, indicating the weekday of a specified date.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ SmallInt value from 1 to 7, inclusive; 1 represents Sunday= ]Weekday( date_expr )
Part Description
Remarks
The Weekday( ) function returns an integer representing the day-of-the-week component (one to
seven) of the specified date.
The Weekday( ) function only works for dates on or after January 1, in the year 100. If date_expr
specifies a date before the year 100, the Weekday( ) function returns a value of zero.
Year( ) function
Purpose
This returns the year component of a date value.
Note: Functions in MapX are used to create expressions and are passed as arguments. They can
ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[ SmallInt value from 1 to 7, inclusive; 1 represents Sunday= ]Year( date_expr )
Part Description
Remarks
The Year( ) function returns an integer representing the year component of the specified date. For
example, if the specified date is 12/17/93, the Year( ) function returns the value 1993.
Geosets are files (ending in .GST) that contain information about a set of layers, and can be loaded at
one time. A geoset is loaded by specifying one at design time (as a property), or using the
AddGeosetLayers method of the Layers object. A geoset file is an ASCII file containing strings. These
strings consist of keys and values. The keys correspond to properties in MapX – properties for the
main Map object, as well as for Layer objects.
Keys are hierarchical in nature, and are specified as quoted strings. Key values are also quoted values
– even number are quoted. The following is a sample showing some keys and values:
Sample Geoset
!GEOSET
!VERSION 100
begin_metadata
"\GEOSET" = ""
"\GEOSET\NAME" = "SAMPLE GEOSET"
"\GEOSET\PROJECTION" = "3,62,7,-96,23,20,60,0,0"
"\GEOSET\CENTER" = "-54851.35483414936,1844196.997419479"
"\GEOSET\MBR" = ""
"\GEOSET\MBR\LOWERLEFT" = "-3093309.705881681,-450646.671927353"
"\GEOSET\MBR\UPPERRIGHT" = "2983606.996213382,4139040.666766311"
"\GEOSET\ZOOMLEVEL" = "4019.82"
"\GEOSET\AUTOLAYER" = "FALSE"
"\GEOSET\MAPUNIT" = "0"
"\GEOSET\ROTATION" = "0"
"\TABLE" = ""
"\TABLE\1" = ""
"\TABLE\1\FILE" = "usa_caps.tab"
"\TABLE\1\DESCRIPTION" = "US Capitals"
"\TABLE\1\ISVISIBLE" = "TRUE"
"\TABLE\1\AUTOLABEL" = "FALSE"
"\TABLE\1\DRAWLABELSAFTER" = "FALSE"
"\TABLE\1\SHOWLINEDIRECTION" = "FALSE"
"\TABLE\1\SHOWNODES" = "FALSE"
"\TABLE\1\SHOWCENTROIDS" = "FALSE"
"\TABLE\1\EDITABLE" = "FALSE"
"\TABLE\1\SELECTABLE" = "TRUE"
"\TABLE\1\REGISTERINGEOODICT" = "TRUE"
"\TABLE\1\DISPLAY" = ""
"\TABLE\1\DISPLAY\BRUSH" = ""
"\TABLE\1\DISPLAY\BRUSH\Pattern" = "2"
"\TABLE\1\DISPLAY\BRUSH\Forecolor" = "16777215"
"\TABLE\1\DISPLAY\BRUSH\Backcolor" = "16777215"
"\TABLE\1\DISPLAY\BRUSH\Transparent" = "FALSE"
"\TABLE\1\DISPLAY\PEN" = ""
"\TABLE\1\DISPLAY\PEN\LineWidth" = "1"
"\TABLE\1\DISPLAY\PEN\LineStyle" = "1"
"\TABLE\1\DISPLAY\PEN\Pattern" = "2"
"\TABLE\1\DISPLAY\PEN\Color" = "0"
"\TABLE\1\DISPLAY\LINEPEN" = ""
"\TABLE\1\DISPLAY\LINEPEN\LineWidth" = "1"
"\TABLE\1\DISPLAY\LINEPEN\LineStyle" = "1"
"\TABLE\1\DISPLAY\LINEPEN\Pattern" = "2"
"\TABLE\1\DISPLAY\LINEPEN\Color" = "0"
"\TABLE\1\DISPLAY\FONT" = ""
"\TABLE\1\DISPLAY\FONT\Style" = "3"
"\TABLE\1\DISPLAY\FONT\ExtStyle" = "1"
"\TABLE\1\DISPLAY\FONT\Description" = "Arial"
"\TABLE\1\DISPLAY\FONT\Size" = "36"
"\TABLE\1\DISPLAY\FONT\Forecolor" = "0"
"\TABLE\1\DISPLAY\FONT\Backcolor" = "16777215"
"\TABLE\1\DISPLAY\FONT\Opaque" = "FALSE"
"\TABLE\1\DISPLAY\SYMBOL" = ""
"\TABLE\1\DISPLAY\SYMBOL\Type" = "1"
"\TABLE\1\DISPLAY\SYMBOL\Code" = "35"
"\TABLE\1\DISPLAY\SYMBOL\Color" = "255"
"\TABLE\1\DISPLAY\SYMBOL\Pointsize" = "14"
"\TABLE\1\DISPLAY\SYMBOL\Font" = ""
"\TABLE\1\DISPLAY\SYMBOL\Font\Style" = "0"
"\TABLE\1\DISPLAY\SYMBOL\Font\ExtStyle" = "0"
"\TABLE\1\DISPLAY\SYMBOL\Font\Description" = "Map Symbols"
"\TABLE\1\DISPLAY\SYMBOL\Font\Size" = "14"
"\TABLE\1\DISPLAY\SYMBOL\Font\Forecolor" = "255"
"\TABLE\1\DISPLAY\SYMBOL\Font\Backcolor" = "16777215"
"\TABLE\1\DISPLAY\SYMBOL\Font\Opaque" = "FALSE"
"\TABLE\1\DISPLAY\SYMBOL\Font\Rotation" = "0"
"\TABLE\1\LABEL" = ""
"\TABLE\1\LABEL\FONT" = ""
"\TABLE\1\LABEL\FONT\Style" = "0"
"\TABLE\1\LABEL\FONT\ExtStyle" = "0"
"\TABLE\1\LABEL\FONT\Description" = "Arial"
"\TABLE\1\LABEL\FONT\Size" = "9"
"\TABLE\1\LABEL\FONT\Forecolor" = "0"
"\TABLE\1\LABEL\FONT\Backcolor" = "16777215"
"\TABLE\1\LABEL\FONT\Opaque" = "FALSE"
"\TABLE\1\LABEL\DUPLICATE" = "TRUE"
"\TABLE\1\LABEL\PARALLEL" = "TRUE"
"\TABLE\1\LABEL\OVERLAP" = "FALSE"
"\TABLE\1\LABEL\PARTIALSEGMENTS" = "FALSE"
"\TABLE\1\LABEL\LINETYPE" = "2"
"\TABLE\1\LABEL\OFFSET" = "2"
"\TABLE\1\LABEL\POSITION" = "5"
end_metadata
The first eleven lines show keys beginning with the word 'GEOSET' – these are keys that set properties
for the entire map, or properties for the Map object. Notice that some keys, like GEOSET\MBR are
multi-level – there is a LOWERLEFT and an UPPERRIGHT.
Then next thirteen lines show keys setting properties for one layer – usa_caps. The keys begin with
'TABLE'. The next word is any keyword to refer to the set of properties for a specific layer – in this case
they are the same word as the table file name. Then follow the hierarchical key values for the specified
layer.
Supported Keys
Below is the list of keys that are supported in a geoset file:
\GEOSET\
\TABLE\<number>\
\TABLE\<number>\
DISPLAY\BRUSH\
DISPLAY\PEN\
DISPLAY\LINEPEN\
DISPLAY\FONT\
STYLE Number – Bit Mask (BOLD 0x01, ITALIC 0x02, UNDER 0x04,
STRIKEOUT 0x08, OUTLINE 0x10, SHADOW 0x20, INVERSE
0x40, BLINK 0x80)
EXTSTYLE Number – Bit Mask (HALO 0x01, ALLCAPS 0x02, DBLSPACE
0x04)
DESCRIPTION String – font name
SIZE Number – font size in points
FORECOLOR Number – Corresponds to Style.TextFontColor
BACKCOLOR Number – Corresponds to Style.TextFontBackColor
DISPLAY\FONT\
DISPLAY\SYMBOL\
FONT This is the font of the symbol. This key is present if the symbol
type is miSymbolTypeTrueTypeFont. It has the same sub-keys
as DISPLAY\FONT
FONT\ROTATION The rotation angle of the font symbol. Corresponds to
Style.SymbolFontRotation.
BitmapSymbol Keys
LABEL\
LABEL\
An OLE_COLOR value is a BGR (Blue, Green, Red) value. To determine the BGR value, specify blue,
green, or red (each of which has a value from 0 – 255) in the following formula:
BGR value = (blue * 65536) + (green * 256) + red
Note: If you have used the MapBasic programming language, please note that MapBasic uses
the following formula to calculate the RGB values:
RGB value = (red * 65536) + (green * 256) + blue
If you are working with RGB color values (e.g. values used with a MapBasic application), you will
need to convert the colors to BGR before you can use those color values in MapX.
See Also
ColorConstants
Method/Property IDispatch
AffineTransform.A 2
AffineTransform.B 3
AffineTransform.C 4
AffineTransform.D 5
AffineTransform.E 6
AffineTransform.F 7
AffineTransform.Set 8
AffineTransform.Units 1
Annotation.Graphic 2
Annotation.Type 1
Annotations.ActiveAnnotation 8
Annotations.AddSymbol 3
Annotations.AddText 6
Annotations.Count 2
Annotations.Editable 1
Annotations.Item 4
Annotations.Remove 5
Annotations.RemoveAll 7
BindLayer.CoordSys 6
BindLayer.Filespec 7
BindLayer.KeyLength 8
BindLayer.LayerName 1
BindLayer.LayerType 4
BindLayer.RefColumn1 2
BindLayer.RefColumn2 3
BindLayer.ReferenceLayer 5
BindLayer.ReferenceLayerField 9
Method/Property IDispatch
BitmapSymbol.Name 1
BitmapSymbols.Count 1
BitmapSymbols.Item 2
BitmapSymbols.Refresh 3
BitmapSymbols.Unload 4
CoordSys.AffineTransform 14
CoordSys.Azimuth 9
CoordSys.Bounds 4
CoordSys.Clone 17
CoordSys.Datum 2
CoordSys.FalseEasting 11
CoordSys.FalseNorthing 12
CoordSys.OriginLatitude 6
CoordSys.OriginLongitude 5
CoordSys.PickCoordSys 16
CoordSys.Range 13
CoordSys.ScaleFactor 10
CoordSys.Set 15
CoordSys.StandardParallelOne 7
CoordSys.StandardParallelTwo 8
CoordSys.Type 1
CoordSys.Units 3
DataSet.AddField 14
DataSet.Fields 3
DataSet.GeoField 5
DataSet.Layer 7
DataSet.Name 1
DataSet.ReadOnly 12
DataSet.Refresh 8
DataSet.RowCount 2
DataSet.RowValues 13
Method/Property IDispatch
DataSet.SecondaryGeoField 6
DataSet.SourceRows 10
DataSet.Themes 4
DataSet.Type 11
DataSet.Value 9
DataSets.Add 2
DataSets.BuildSourceRows 7
DataSets.Count 1
DataSets.Item 3
DataSets.Remove 4
DataSets.RemoveAll 6
DataSets.Restore 5
Datum.Eccentricity 13
Datum.Ellipsoid 1
Datum.Flattening 12
Datum.PrimeMeridian 9
Datum.RotateX 5
Datum.RotateY 6
Datum.RotateZ 7
Datum.ScaleAdjust 8
Datum.SemiMajorAxis 10
Datum.SemiMinorAxis 11
Datum.Set 14
Datum.SetFromList 15
Datum.ShiftX 2
Datum.ShiftY 3
Datum.ShiftZ 4
Feature.Area 10
Feature.Attach 20
Feature.Bounds 7
Feature.Caption 8
Method/Property IDispatch
Feature.CenterX 4
Feature.CenterY 5
Feature.Clone 21
Feature.FeatureID 1
Feature.FeatureKey 23
Feature.HasMultipoint 29
Feature.HasPolyline 28
Feature.HasRegion 27
Feature.Multipoint 26
Feature.Polyline 25
Feature.Region 24
Feature.KeyValue 17
Feature.LabelPoint 13
Feature.Layer 11
Feature.Length 3
Feature.Name 16
Feature.Nodes 22
Feature.Offset 19
Feature.Parts 9
Feature.Perimeter 14
Feature.Point 12
Feature.Smooth 15
Feature.Style 6
Feature.Type 2
Feature.Update 18
FeatureFactory.BufferFeatures 1
FeatureFactory.CombineFeatures 2
FeatureFactory.CreateArc 9
FeatureFactory.CreateCircularRegion 11
FeatureFactory.CreateEllipticalRegion 10
FeatureFactory.CreateLine 7
Method/Property IDispatch
FeatureFactory.CreateCollectionFeature 14
FeatureFactory.CreateMultipoint 15
FeatureFactory.CreateRegion 6
FeatureFactory.CreateSymbol 5
FeatureFactory.CreateText 8
FeatureFactory.EraseFeature 4
FeatureFactory.IntersectFeatures 3
FeatureFactory.IntersectionPoints 13
FeatureFactory.IntersectionTest 12
Features.Add 4
Features.AddByID 9
Features.Bounds 8
Features.Clone 3
Features.Common 5
Features.Count 1
Features.Item 2
Features.Remove 6
Features.RemoveByID 10
Features.Replace 7
Field.AggregationFunction 3
Field.Name 2
Field.Type 1
Fields.Add 2
Fields.Count 1
Fields.Item 3
Fields.Remove 4
Fields.RemoveAll 5
Find.Abbreviations 2
Find.CloseMatchMax 10
Find.ClosestAddr 3
Find.FindDataSet 7
Method/Property IDispatch
Find.FindField 5
Find.OtherBoundary 4
Find.RefineDataSet 8
Find.RefineField 6
Find.RefineLayer 1
Find.Search 9
Find.SearchEx 11
FindFeature.Area 65546
FindFeature.Bounds 65543
FindFeature.Caption 65544
FindFeature.CenterX 65540
FindFeature.CenterY 65541
FindFeature.FeatureID 65537
FindFeature.FindRC 1
FindFeature.KeyValue 65553
FindFeature.LabelPoint 65549
FindFeature.Layer 65547
FindFeature.Length 65539
FindFeature.Name 65552
FindFeature.Offset 65555
FindFeature.Parts 65545
FindFeature.Perimeter 65550
FindFeature.Point 65548
FindFeature.Smooth 65551
FindFeature.Style 65542
FindFeature.Type 65538
FindFeature.Update 65554
FindMatch.FeatureID 1
FindMatch.FeatureKey 4
FindMatch.Name 2
FindMatch.Score 3
Method/Property IDispatch
FindMatches.Count 1
FindMatches.Item 2
FindResult.AddressOutOfRange 3
FindResult.ExactMatch 1
FindResult.FindRC 7
FindResult.IntersectionNotFound 4
FindResult.MatchedFeature 9
FindResult.Matches 8
FindResult.MultipleMatches 5
FindResult.RefineRegion 6
FindResult.Substitute 2
Geoset.Centroid 1
Geoset.PathName 2
Geoset.UserName 3
Geosets.Count 1
Geosets.Item 2
Graphic.Caption 1
Graphic.Position 4
Graphic.Style 5
Graphic.X 2
Graphic.Y 3
IndividualValueCategories.AllOthersCategory 3
IndividualValueCategories.Count 1
IndividualValueCategories.Item 2
IndividualValueCategory.NumItems 2
IndividualValueCategory.Style 1
IndividualValueCategory.Value 3
LabelProperties.DataField 13
LabelProperties.DataSet 9
LabelProperties.Duplicate 10
LabelProperties.LabelMax 12
Method/Property IDispatch
LabelProperties.LabelZoom 3
LabelProperties.LabelZoomMax 5
LabelProperties.LabelZoomMin 4
LabelProperties.LineType 6
LabelProperties.Offset 7
LabelProperties.Overlap 11
LabelProperties.Parallel 8
LabelProperties.PartialSegments 15
LabelProperties.Position 14
LabelProperties.Style 1
LabelProperties.Visible 2
Layer.AddFeature 21
Layer.AllFeatures 26
Layer.AutoLabel 6
Layer.BeginAccess 41
Layer.Bounds 32
Layer.ClearCustomLabels 19
Layer.CoordSys 17
Layer.DataSets 39
Layer.DeleteFeature 22
Layer.DrawLabelsAfter 37
Layer.DrillDownAddFeatures 31
Layer.DrillDownRemoveFeatures 30
Layer.DrilldownReset 34
Layer.Editable 46
Layer.EndAccess 42
Layer.FeatureIDFromFeatureName 38
Layer.FeatureKeyFromFeatureName 48
Layer.FileSpec 4
Layer.Find 14
Layer.GetDrilldownFeaturesByID 33
Method/Property IDispatch
Layer.GetFeatureByID 35
Layer.GetFeatureByKey 47
Layer.Invalidate 23
Layer.KeyField 16
Layer.LabelAtPoint 18
Layer.LabelProperties 5
Layer.Name 1
Layer.NoFeatures 27
Layer.OverrideStyle 8
Layer.PredominantFeatureType 13
Layer.Refresh 36
Layer.Search 40
Layer.SearchAtPoint 29
Layer.SearchWithinDistance 24
Layer.SearchWithinFeature 28
Layer.SearchWithinRectangle 25
Layer.Selectable 3
Layer.Selection 12
Layer.ShowCentroids 44
Layer.ShowLineDirection 45
Layer.ShowNodes 43
Layer.Style 9
Layer.Type 15
Layer.UpdateFeature 20
Layer.Visible 2
Layer.ZoomLayer 7
Layer.ZoomMax 11
Layer.ZoomMin 10
LayerInfo.AddParameter 2
LayerInfo.Type 1
Layers.Add 4
Method/Property IDispatch
Layers.AddGeoSetLayers 5
Layers.AddServerLayer 13
Layers.AddUserDrawLayer 8
Layers.AnimationLayer 9
Layers.Bounds 12
Layers.ClearSelection 2
Layers.Count 1
Layers.CreateLayer 10
Layers.InsertionLayer 15
Layers.Item 6
Layers.LayersDlg 11
Layers.Move 3
Layers.Remove 7
Layers.RemoveAll 14
Legend.BodyTextStyle 6
Legend.Compact 1
Legend.CompactTitle 11
Legend.CompactTitleStyle 5
Legend.CurrencyFormat 8
Legend.ExportLegend 18
Legend.Height 15
Legend.Left 12
Legend.LegendDlg 16
Legend.LegendTexts 7
Legend.PaperHeight 21
Legend.PaperWidth 22
Legend.PrintLegend 20
Legend.ShowCount 19
Legend.ShowEmptyRanges 17
Legend.SubTitle 10
Legend.SubTitleStyle 4
Method/Property IDispatch
Legend.Title 9
Legend.TitleStyle 3
Legend.Top 13
Legend.Visible 2
Legend.Width 14
LegendText.Text 1
LegendText.Visible 2
LegendTexts.AllOthersText 4
LegendTexts.AutoGenerate 1
LegendTexts.Count 2
LegendTexts.Item 3
Map.AboutBox -552
Map.Annotations 3
Map.AreaUnit 28
Map.AutoRedraw 6
Map.BackColor -501
Map.Bounds 29
Map.CenterX 8
Map.CenterY 9
Map.ClipLine 44
Map.ClipLineV 45
Map.ConvertCoord 34
Map.ConvertCoordV 41
Map.CreateCustomTool 36
Map.CurrentTool 20
Map.DataSet 4
Map.DataSetGeoField 1
Map.DataSetTheme 19
Map.DataSets 22
Map.DefaultConversionResolution 50
Map.DefaultStyle 17
Method/Property IDispatch
Map.DisplayCoordSys 30
Map.Distance 37
Map.ExportMap 39
Map.ExportSelection 32
Map.FeatureFactory 49
Map.GeoDictionary 18
Map.GeoSet 10
Map.GeoSetWidth 11
Map.Geosets 27
Map.hWnd -515
Map.InfotipPopupDelay 61
Map.InfotipSupport 63
Map.IsPointVisible 43
Map.Layers 5
Map.MapPaperHeight 12
Map.MapPaperWidth 13
Map.MapScreenHeight 54
Map.MapScreenWidth 53
Map.MapUnit 25
Map.MatchNumericFields 52
Map.MatchThreshold 57
Map.MaxSearchTime 14
Map.MouseIcon 62
Map.MousePointer 21
Map.MousewheelSupport 51
Map.NumericCoordSys 31
Map.Pan 64
Map.PanAnimationLayer 60
Map.PaperUnit 15
Map.PreferCompactLegends 16
Map.PrintMap 38
Method/Property IDispatch
Map.PropertyPage 40
Map.RedrawInterval 55
Map.Refresh -550
Map.Rotation 26
Map.SaveMapAsGeoset 47
Map.SearchPath 56
Map.SelectionStyle 33
Map.SetSize 42
Map.Title 23
Map.TitleText 24
Map.Version 2
Map.WaitCursorEnabled 58
Map.Zoom 7
Map.ZoomTo 35
MultivarCategories.Count 1
MultivarCategories.Item 2
MultivarCategory.Style 1
NotesQueryInfo.BeginDate 4
NotesQueryInfo.Database 2
NotesQueryInfo.DefaultNumericValue 8
NotesQueryInfo.DefaultStringValue 7
NotesQueryInfo.EndDate 5
NotesQueryInfo.FullTextSearch 6
NotesQueryInfo.MaxNumDocs 9
NotesQueryInfo.Query 3
NotesQueryInfo.Server 1
NotesViewInfo.Database 2
NotesViewInfo.Server 1
NotesViewInfo.View 3
ODBCQueryInfo.ConnectString 3
ODBCQueryInfo.DataSource 1
Method/Property IDispatch
ODBCQueryInfo.SqlQuery 2
Parts.Add 4
Parts.Count 1
Parts.Item 2
Parts.Remove 3
Parts.RemoveAll 5
Point.Offset 4
Point.Set 3
Point.X 1
Point.Y 2
Points.Add 4
Points.AddXY 5
Points.Count 1
Points.Item 2
Points.Remove 3
Points.RemoveAll 6
RangeCategories.AllOthersCategory 3
RangeCategories.Count 1
RangeCategories.Item 2
RangeCategory.Max 2
RangeCategory.Min 1
RangeCategory.NumItems 3
RangeCategory.Style 4
Rectangle.Height 5
Rectangle.Offset 8
Rectangle.Set 7
Rectangle.Width 6
Rectangle.XMax 3
Rectangle.XMin 1
Rectangle.YMax 4
Rectangle.YMin 2
Method/Property IDispatch
ResolveObject.SourceMatch 2
ResolveObject.TableMatch 3
ResolveObject.TableName 1
ResolveObjects.Add 4
ResolveObjects.Count 1
ResolveObjects.Item 2
ResolveObjects.Remove 3
ResolveObjects.RemoveAll 5
RowValue.DataSet 2
RowValue.Field 3
RowValue.ReadOnly 1
RowValue.Value 4
RowValues.Add 4
RowValues.Clone 6
RowValues.Count 1
RowValues.Item 2
RowValues.ReadOnly 7
RowValues.Remove 3
RowValues.RemoveAll 5
Selection.Add 65540
Selection.ClearSelection 2
Selection.Clone 65539
Selection.Common 65541
Selection.Count 65537
Selection.Item 65538
Selection.Remove 65542
Selection.Replace 65543
Selection.SelectAll 6
Selection.SelectByID 7
Selection.SelectByPoint 3
Selection.SelectByRadius 4
Method/Property IDispatch
Selection.SelectByRectangle 5
Selection.SelectByRegion 1
SourceRow.Row 1
SourceRows.Count 1
SourceRows.Item 2
Style.Clone 41
Style.DrawLineSample 32
Style.DrawRegionSample 31
Style.DrawSymbolSample 30
Style.DrawTextSample 29
Style.ExportLineSample 51
Style.ExportRegionSample 50
Style.ExportSymbolSample 49
Style.ExportTextSample 52
Style.LineColor 2
Style.LineInterleaved 44
Style.LineStyle 3
Style.LineStyleCount 42
Style.LineSupportsInterleave 47
Style.LineWidth 4
Style.LineWidthUnit 45
Style.MaxVectorSymbolCharacter 56
Style.MinVectorSymbolCharacter 55
Style.PickLine 26
Style.PickRegion 25
Style.PickSymbol 28
Style.PickText 27
Style.RegionBackColor 7
Style.RegionBorderColor 9
Style.RegionBorderStyle 8
Style.RegionBorderWidth 10
Method/Property IDispatch
Style.RegionBorderWidthUnit 46
Style.RegionColor 5
Style.RegionPattern 6
Style.RegionTransparent 43
Style.SupportsBitmapSymbols 39
Style.SymbolBitmapColor 35
Style.SymbolBitmapName 36
Style.SymbolBitmapOverrideColor 34
Style.SymbolBitmapSize 38
Style.SymbolBitmapTransparent 33
Style.SymbolCharacter 1
Style.SymbolFont 12
Style.SymbolFontBackColor 16
Style.SymbolFontColor 15
Style.SymbolFontHalo 19
Style.SymbolFontOpaque 17
Style.SymbolFontRotation 40
Style.SymbolFontShadow 20
Style.SymbolType 37
Style.SymbolVectorColor 53
Style.SymbolVectorSize 54
Style.TextFont 11
Style.TextFontAllCaps 23
Style.TextFontBackColor 14
Style.TextFontColor 13
Style.TextFontDblSpace 24
Style.TextFontHalo 21
Style.TextFontOpaque 18
Style.TextFontRotation 48
Style.TextFontShadow 22
Theme.AutoRecompute 5
Method/Property IDispatch
Theme.ComputeTheme 13
Theme.DataMax 12
Theme.DataMin 11
Theme.Fields 10
Theme.Layer 9
Theme.Legend 4
Theme.Name 6
Theme.Properties 3
Theme.ThemeDlg 8
Theme.ThemeProperties 7
Theme.Type 2
Theme.Visible 1
ThemeProperties.AllowEmptyRanges 15
ThemeProperties.ApplyAttribute 31
ThemeProperties.BarFrameStyle 28
ThemeProperties.BarFramed 38
ThemeProperties.BarGraduatedStack 30
ThemeProperties.BarIndependentScale 26
ThemeProperties.BarStacked 20
ThemeProperties.BarWidth 25
ThemeProperties.BorderStyle 24
ThemeProperties.ColorMethod 34
ThemeProperties.DataValue 10
ThemeProperties.DistMethod 1
ThemeProperties.DotColor 16
ThemeProperties.DotSize 5
ThemeProperties.GraduateSizeBy 23
ThemeProperties.Graduated 6
ThemeProperties.Independent 8
ThemeProperties.IndividualValueCategories 4
ThemeProperties.InflectRanges 35
Method/Property IDispatch
ThemeProperties.InflectionColor 37
ThemeProperties.InflectionRange 36
ThemeProperties.MultivarCategories 7
ThemeProperties.NegativeSymbolStyle 21
ThemeProperties.NumRanges 2
ThemeProperties.PieClockwise 17
ThemeProperties.PieGraduated 29
ThemeProperties.PieHalfPies 18
ThemeProperties.PieStartAngle 19
ThemeProperties.PositiveSymbolStyle 27
ThemeProperties.RangeCategories 3
ThemeProperties.RoundBy 33
ThemeProperties.RoundRanges 32
ThemeProperties.ShowNegativeValues 22
ThemeProperties.Size 11
ThemeProperties.SpreadBy 14
ThemeProperties.SymbolStyle 13
ThemeProperties.ValuePerDot 9
ThemeProperties.Width 12
Themes.Add 2
Themes.Count 1
Themes.Item 3
Themes.Remove 4
Themes.RemoveAll 5
Title.Border 8
Title.Caption 1
Title.Editable 6
Title.Position 7
Title.TextStyle 2
Title.Visible 3
Title.X 4
Method/Property IDispatch
Title.Y 5
Remote spatial tables Replace method (Selection collec- ScaleFactor property (CoordSys
making mappable 185–186 tion) 492 object) 291
MapInfo Map Catalog 181– RequestData event 561 Score property (FindMatch object)
186 Reset method (State object) 502 355
specifying styles 187–188 ResolveDataBind event 561 SDO_GEOMETRY 169
Remove method (Annotations ResolveDataBindConstants 601 Search method (Find object) 352
collection) 277 ResolveDataBindEx event 562 Search method (Layer object) 395
Remove method (DataSets collec- ResolveObject object 483 Search type constants
tion) 303 ResolveObjects collection 483 selections 106
Remove method (Features collec- Restore method (DataSets collec- SearchAtPoint method (Layer ob-
tion) 320 tion) 297 ject) 396
Remove method (Fields collec- Restore method (State object) 502 SearchEx method (Find object) 350
tion) 347 Result codes SearchPath property (Map object)
Remove method (Layers collec- Find object 131 456
tion) 410 Right$( ) function 635 SearchResultTypeConstants 602
Remove method (Parts collection) RollUp tools SearchTypeConstants 601
471 creating 158 SearchWithinDistance method
Remove method (Point object) 476 RotateX, RotateY, RotateZ proper- (Layer object) 397
Remove method (RowValues ob- ties (Datum object) 305 SearchWithinFeature method
ject) 486 Rotation property (Map object) (Layer object) 398
Remove method (Selection collec- 456 SearchWithinRectangle method
tion) 491 Round( ) function 636 (Layer object) 398
Remove method (Theme object) RoundBy property (ThemeProp- Secondary Geofield parameter 81
532 erties object) 544 SecondaryGeoField property
Remove method (Variables collec- RoundRanges property (Theme- (DataSet object) 298
tion) 551 Properties object) 544 Selectable property (Layer object)
RemoveAll method (Annotations Row property (SourceRow object) 399
collection) 277 497 SelectAll method (Selection collec-
RemoveAll method (DataSets col- RowCount property (DataSet ob- tion) 492
lection) 303 ject) 297 SelectByID method (Selection col-
RemoveAll method (Fields collec- RowValue object 485 lection) 492
tion) 348 RowValues collection 485 SelectByPoint method (Selection
RemoveAll method (Layers col- RowValues property (Dataset ob- collection) 493
lection) 411 ject) 296 SelectByRadius method (Selection
RemoveAll method (Parts collec- RTrim$( ) function 637 collection) 494
tion) 471 SelectByRectangle method (Selec-
RemoveAll method (Point object) S tion collection) 494
476 Sample application SelectByRegion method (Selection
RemoveAll method (RowValues Visual C++ 212 collection) 495
collection) 487 Sample applications Selected property (Label object)
RemoveAll method (Theme ob- additional programs 5 370
ject) 532 Sample Connection Strings 173 Selection collection 489
RemoveAll method (Variables Sample Geoset 648 description 102
collection) 552 Save method (Map object) 504 methods 106
RemoveByID method (Features SaveMapAsGeoset method (Map Selection property (Layer object)
collection) 320 object) 456 399
Removing Saving SelectionChanged event 563
labels 64 geosets 143 Selections
Replace method (Features collec- ScaleAdjust property (Datum ob- creating at specific point 106
tion) 321 ject) 305 search type constants 106