MAPX45 DevGuide
MAPX45 DevGuide
MapInfo MapX
Developer Guide
v4.5
MapInfo Corporation
Troy, NY
2 MapInfo MapX Developer Guide v4.5
Information in this document is subject to change without notice and does not represent a commitment on the part of the vendor
or its representatives. No part of this document may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying without the written permission of MapInfo Corporation, One Global View, Troy, New York
12180–8399.
©1992–2000 MapInfo Corporation. ALL RIGHTS RESERVED.
MapInfo Help ©1992–2000 MapInfo Corporation. ALL RIGHTS RESERVED.
MapInfo, MapInfo Professional, MapBasic, MapXtreme, MapInfo MapX, and the MapInfo Logo are registered trademarks of
MapInfo Corporation. All other marks used herein are the property of their respective owners.
Contact MapInfo Corporation on the Internet at: http://www.mapinfo.com
MapInfo Corporate Headquarters: MapInfo Europe Headquarters: Germany:
Voice: (518) 285-6000 Voice: +44 (0)1753 848 200 Voice: +49 (0)6142-203-400
Fax: (518) 285-6060 Fax: +44 (0)1753 621 140 Fax: +49 (0)6142-203-444
Technical Support Hotline: (518) 285-7283 Toll-free telephone support is available in the U.S. and Canada. Contact
Technical Support Fax: (518) 285-6080 your MapInfo sales representative for details. For international custom-
ers, please use the Technical Support Fax number.
WARNING: This software uses patented LZW technology for .GIF image compression and/or decompression. (Unisys United
States patent No. 4,558,302 and corresponding patents in Canada, France, Germany, Italy, Japan and the United Kingdom). GIF
images compressed or decompressed for transmission via the Internet or via any other on–line communication capability may
not be sold or licensed for revenue, or used by an Internet Service Provider or in paid advertisements unless the user first enters
into a written license agreement with Unisys. For information concerning licensing, please contact: Unisys Corporation Welch
Licensing Department C1SW19 Township Line & Union Meeting Roads P.O. Box 500 Blue Bell PA 19424 Fax: 215–986–3090
Portions of the data are the proprietary information of Roadnet Technologies, Inc., a United Parcel Service Company, and are
Copyright 1993. Roadnet Technologies, Inc. Portions of the software are derived from the Standard C Library, and are Copyright
1992, by P.J. Plauger, published by Prentice-Hall, and are used with permission.
This documentation reflects the contributions of almost all of the women and men who work for MapInfo Corporation. It was
specifically produced by Max Morton. Colleen Cox, Editor. Juliette Funiciello-Vunk, Associate Editor. These members of the
Documentation Department are indebted to MapInfo’s Quality Assurance Department and, of course, to all the members of the
Engineering team who labored on this project.
MapInfo welcomes your comments and suggestions.
MapInfo MapX v4.5
June 2000
4 MapInfo MapX Developer Guide v4.5
Table of Contents
Preface: An Introduction to MapX
Welcome... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Document Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
About MapInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
New in MapInfo MapX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
New in MapX v4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
New in MapX v4.0 & 4.0.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Enhancements and Additions to MapX v3.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Enhancements and Additions to MapX v3.5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Enhancements and Additions to MapX v3.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Upgrading MapX v2.0 Applications to MapX Version 3 . . . . . . . . . . . . . . . . . . . . 18
Part I:
The MapX User Guide
Mapping at a Glance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Making MapX Work for You. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Overview of Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Learning About MapX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Part II:
The MapX Objects
Affine Transform object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Annotation Object and Annotations Collection . . . . . . . . . . . . . . . . . . . . . . . . . . 269
BindLayer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
BitmapSymbol Object and BitmapSymbols Collection . . . . . . . . . . . . . . . . . . . . . 281
CoordSys Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Dataset object and Datasets collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Datum Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Part III:
MapX Reference Informatio
tMapX Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Note: Code samples for MapInfo MapX are still available in the MapX Online Help
System. In fact, the reasoning behind the decision to remove them from the printed
manual was that since we’ve added such a significant number of examples in three
different languages (Visual Basic, C++, & Delphi), printing them made the
documentation overly cumbersome to use.
Part I: The MapX User’s Guide, is a narrative on mapping concepts and information on how
to effectively use the of functionality within MapInfo MapX.
Part II: The MapX Objects, is an alphabetically organized reference that describes the objects,
properties, methods, and events associated with MapInfo MapX. Most entries includes a
purpose, syntax, remarks, and cross-references to other entries (if necessary). In previous
releases of MapInfo MapX, we had printed example code for a few methods and properties.
Now, example code has been written in Visual Basic, C++, and Delphi for more than 75% of all
methods & properties of MapX. Because of this exponentially expanding page count, we have
decided to make most code samples available exclusively in the MapX Online Help System.
Part III: MapX Reference Information contains many useful topics. There are topics on MapX
Events, a complete listing of MapX error codes and descriptions of each, Constants,
Expressions, Geoset Key information, OLE_Color values, IDispatch, topics on the Geoset and
Geodictionary Managers, and Custom Dataset Support. Much of the information in this
section is new to MapX documentation.
The material in this book reflects the information available at the time of publication and is
essentially the same as the information contained in the MapX Online Help System. However,
in some cases, more up-to-date information may become avail able and will appear in the
MapX Online Help before the actual release of the next version of MapInfo MapX. Be sure to
visit www.MapX.com to download the most current version of the Help System.
The MapInfo Documentation department welcomes all comments and suggestions. You may
eMail them to MapXDocs@MapInfo.com.
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.
About MapInfo
MapInfo MapX is produced by MapInfo Corporation. MapInfo makes and sells a full line of
mapping software and data products.
If you need information on other mapping solutions or data products, contact us at the
phone and fax numbers listed below, or visit our web sites.
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.
• Dataset.RowValues: Determines what a row can be: long row ID, string serialized
key, or feature object to get key from.
• Feature.FeatureKey: Returns the Key of the feature. Each feature in a layer contains a
unique key within the layer. This is a string value and is read-only. 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).
• Feature.Nodes: This read-only property exposes the node data in such a way that
the user can query for all the nodes in an object with one pass, then have them
returned in a single, contiguous block of memory
• Find.CloseMatchMax: This returns the maximum number of close matches loaded in
FindResult from SearchEx.
• LabelProperties.PartialSegments: Setting this value to true enables MapX to label
polylines, even if only a small part of the polyline is currently visible. However, this
will not work for other features/objects, as it only applies to autolabels.
• Layer.DataSets: This read-only property is a DataSets collection that is bound to
the map layer it is associated with. This collection is a subset of the full DataSets
collection (Map.DataSets). The objects within Layer.DataSets are the same as the
objects within Map.DataSets.
• Layer.Editable: This property allows a selection in the layer to be edited (moved, resized,
or deleted).
• Layer.ShowCentroids: This read/write property draws object centroids (regions
only) when set to true.
• Layer.ShowLineDirection: This read/write property draws an arrow indicating
line direction (lines and poly lines only) when set true.
• Layer.ShowNodes: This read/write property draws a small box around the node of
an object when true.
• Layers.InsertionLayer: This read only property specifies what layer new objects
will be inserted into by the built-in object editing tools.
• LayerInfo.Type : This is a read/write property whose value is one of the
LayerTypeConstants.
• Map.MatchThreshhold: This is the minimum threshold percentage required for matching
a map layer with a data source. It is used to control auto-matching during Datasets.Add.
• Map.PanAnimationLayer: This property controls whether the animation layer (if there is
one) is drawn into the backing store when the pan tool is in use so that the contents of the
layer are dragged around with the rest of the map. The default is FALSE.
• RowValue.Dataset: This property is used to specify which dataset the value is for.
• RowValue.Field: This property is used to specify the field in the dataset that the
value is for.
• RowValue.ReadOnly: This property determines whether or not the properties can
be set on the object.
• RowValue.Value: This property is used to specify the value for the field.
in the ranged theme will spread from the top range color to the InflectionColor, then
from the InflectionColor to the bottom range color.
• ThemeProperties.NegativeSymbolStyle: The style of the negative symbol in a
graduated symbol theme.
• ThemeProperties.PieClockwise: Controls whether the pie wedges are drawn in
clockwise order
• ThemeProperties.PieGraduated: This property replaces the
ThemeProperties.Graduated property.
• ThemeProperties.PieHalfPies: Specifies whether to draw half pies instead of
whole pies.
• ThemeProperties.PieStartAngle: The start angle that the first pie wedge is drawn.
• ThemeProperties.PositiveSymbolStyle: This property replaces the
ThemeProperties.SymbolStyle property.
• ThemeProperties.RoundBy: This specifies the interval to round the ranges to.
• ThemeProperties.RoundRanges: This controls whether the boundaries of the ranges are
rounded off.
• ThemeProperties.ShowNegativeValues: This property specifies whether to show
negative values in the graduated symbol theme.
Performance Enhancements
• Improved XY and PointRef Binding speed.
• Improved speed of the Lotus Notes datasets.
• Improved map drawing speed.
• Support for more raster import formats including GIF, JPEG, and PNG.
• New Delphi Native Dataset for Delphi 3.0.
Feature Enhancements
• Create Themes Faster for Server and Drilldown Layers: When creating a theme
with Themes.Add, computing ranges for layers with large numbers of rows, such as
drilldown or server layers, can take some time. The new ComputeTheme parameter
of the Add method 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. See Themes.Add, DataMin, DataMax,
ComputeTheme, and Value. This feature also works in conjunction with
IndividualValueCategories, MultivarCategories, and RangeCategories.
• MapX now provides support for coordinate systems and map projections, including
support for custom datums and affine transformations. For details, see the
discussion of Coordinate Systems.
• A new type of map layer, the Drilldown layer, allows users to explore the map by
pointing and clicking. If you want to see more detail about a particular region, click
on that region; the region is replaced by smaller, more detailed features.
• Spatial Server Access (SSA) is a powerful new feature that allows developers to
connect to live data stored in spatial servers, such as MapInfo's SpatialWare running
on Oracle and Informix databases. Spatial servers allow companies to host their
map data in their enterprise database for central management and security. Spatial
servers like SpatialWare offer advanced query processing and increased
performance on the server for an organization's spatial data. For details, see
Accessing Remote Spatial Data.
• A new Dynamic Data Binding feature improves performance when you use ODBC
to access live data on a large database server. Ordinarily, when you bind data, MapX
makes a static copy of data when the database is opened. A new, optional argument
of the Datasets.Add method lets you specify that the data binding should be
dynamic, in which case MapX grabs data in a live mode, only copying data as it is
needed. Dynamic data binding is also supported if you develop your own custom
dataset support.
• New object processing capabilities allow you to combine, buffer, intersect, or erase
point, line and region features. For details, see the new FeatureFactory object.
• The list of standard tools now includes a polygon select tool. This tool allows the
user to draw a polygon, and then selects features inside the polygon. Also, the
CreateCustomTool method now takes additional, optional parameters, allowing
you to specify different cursors that should be used if the user holds down SHIFT or
CTRL while using the tool.
• You now can display point features using either TrueType font symbols (as in earlier
versions of MapX) or bitmap symbols. TrueType font symbols now support a new
Style.SymbolFontRotation property, which allows you to rotate symbols. Also, the
Style object now supports a new LineStyleCount property, and a new
RegionTransparent property that lets you create transparent fill patterns.
• MapX now includes a new utility, GeosetManager.exe, which makes it easier to
create your own geosets. You can run this utility from the Start menu.
Note: MapX 3.0 also provides source code for a sample Visual Basic 5 project called
GeosetManager, which provides functionality very similar to GeosetManager.exe.
However, you do not need to install this sample VB project to run the
GeosetManager.exe utility.
• The BindLayer object has several new properties: The CoordSys property specifies a
coordinate system when you create a layer in xy or pointref binding. The Filespec
property allows you to create a permanent layer instead of a temporary one. The
KeyLength property specifies the length of the character column in the resulting
layer.
• A new Bounds property returns a rectangle that represents the minimum bounding
rectangle. Several objects—the Map object, Layers collection, Layer object, Features
collection, and Feature object—all support the Bounds property. The Bounds
property is useful when you need to determine the geographic extents of one or
more features on the map (e.g. so you can zoom out far enough to see all of the
features). For an example see Zooming to Show an Entire Layer.
• In version 2, the standard labeling tool (miLabelTool) had a value of 1010. In version
3, the labeling tool's new value is 1011; the new miPolygonSelectTool has the value
1010. If you used the label tool's literal value (1010) instead of its define, you will
need to update your code to use the new value.
• The PolyToolUsed event now takes additional parameters (added to provide
support for modifier keys, and to allow you to cancel a tool's action).
• The DrawUserLayer event now takes an additional parameter (added to address
problems when drawing to a metafile).
• The SearchWithinDistance method now expects an additional Units parameter,
which explicitly specifies the map units that apply to the search distance.
• Stand-alone features must be "attached to the map," so that a coordinate system is
associated with the feature. You can explicitly attach a feature to the map through
the new Feature.Attach method. Note that you do not need to use the Attach
method with objects that were created through the new FeatureFactory object;
FeatureFactory methods create features that are already attached to the map.
• The Map.MBR property has been renamed to Map.Bounds, and the Feature.MBR
property has been renamed to Feature.Bounds.
• If you modify a feature in a layer (not a stand-alone feature), and you have not yet
performed an Update to save the changes, then the Feature object's Bounds, Length,
Perimeter and Area properties return values that are based on the "modified"
version of the object (the object as it exists in memory). In earlier versions of MapX,
the values returned by these properties did not reflect modifications made to the
feature.
• The Title.Position and Graphic.Position properties behave differently in version 3;
as a result, titles and text annotations may be positioned differently than they were
in version 2. For example, suppose you assign the value miPositionTL ("Top Left")
to the Graphic.Position property. MapX version 3 positions the text annotation so
that the text is above and to the left of the anchor location; MapX version 2 used the
opposite orientation (placing the anchor location at the top left corner of the text).
Also, changing the Position property on the title (or an annotation) will keep the
object's (X, Y) properties constant and reposition the object using the new position
value. (In version 2, MapX left the object in place, and changed (X,Y) to reflect the
new position value.)
• The ODBC library used in version 2 (mideodbc.dll) has been replaced by a new
library: MODBCDataset.dll. ODBC access also requires a new library:
MMapXColumnInfo.dll.
• The Lotus Notes library used in version 2 (midenote.dll) has been replaced by a new
library: MNotesDataset.dll. Lotus Notes access also requires a new library:
MMapXColumnInfo.dll.
• MapX version 3 includes an updated set of DLLs that provide support for exporting
images. The new DLLs have slightly different names to reflect the new version (e.g.
the GIF export DLL has been renamed from lfgif60n.dll to lfgif70n.dll).
• If you have created your own installer to install MapX version 2, you may need to
modify the part of the installation script that creates registry keys. Instead of
MapInfo MapX is a mapping ActiveX (OCX) 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 and Microsoft Map. If you have created or purchased MapInfo map
data (tables) for use with MapInfo Professional or Microsoft Map, you can use those same
files with 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.
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.
performing searches, or selecting map features within a specific radius, rectangle, or specific
points.
For example, MapX can show which branch store is the closest to your biggest customers. It
can calculate the distances between customers and stores; it can show you the customers
who spent the most last year; it can color-code the store symbols by sales volume. What
makes it all come together is a visual display of your data on the map.
• Thematic mapping Visualize your data with thematic mapping. Associate data
with each feature on the map, then use color-coding (or other styles) to present your
data visually. With thematic mapping, you can see your data, using any of six
different styles (colored ranges, dot-density,individual values, graduated symbols,
pie charts, or bar charts).
• Drill-down mapping Explore your data with point-and-click simplicity. For
OLAP/DSS, you can allow the user to drill down into a region on the map by
pointing and clicking.
• Data binding Your map can incorporate data from the container in which the OCX
is embedded, an ODBC, or a DAO data source such as MSAccess. MapX provides
several different types of data binding, including ZIP Code-level geocoding.
• Annotations Provide orientation, highlight specific data, and make your map more
informative by adding text, symbols, and labels.
• Layering Display and control the display of a map layer so it displays only when a
map's zoom level falls within a preset distance. Also use or create a seamless map
layer to treat a group of base tables as if they were one. Special types of applications
are supported by special layer types, such as Animation Layer (for real-time
tracking) and UserDraw layer (for drawing special map elements, such as logos, on
top of the map).
• Raster Images Include a raster image underlay to give your map an attractive,
detailed background.
• Automatic Labeling Add labels to your maps automatically, as well as control their
attributes and display.
• Selections Unleash MapX’s analytical features by grouping and organizing data.
Select map features within a specific radius, rectangle or specific points.
If you are upgrading from an earlier version of MapX, see : "New in MapX ".
If you are using MapX for the first time, here are some pointers for how to learn about
MapX:
MapX Basics
1
Chapter
➤ Map Object
In the Getting Started chapter, we created a simple
➤ Property Page
MapX map using the MapInfo MapX Control, and
in the previous chapter we introduced you to some ➤ Layers
MapX mapping concepts. This chapter is an ➤ GeoSets
overview of the major components behind MapX
➤ Datasets
map creation and manipulation within an
application. Selected topics will be discussed in ➤ Annotations
detail in subsequent chapters. ➤ Creatable Objects in MapX
• Map Object
• Property Page
• Layers
• GeoSets
• Datasets
• Annotations
Chapter 2: MapX Basics
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 and y coordinates which may be Map1.CenterX = -
Longitude or Latitude. This is dependent upon 79.4458
the projection of the map.
CenterY Sets the x and y coordinates which may be Map1.CenterY = 44.9932
Longitude or Latitude. This is dependent upon
the projection of the map.
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:
1. 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 "Mapping in Layers", 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 "Features and Selections".
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.
GeoDictionary
The GeoDictionary is used when trying to match a data source and a map layer for
databinding or creating a theme map. The GeoDictionary is a file (typically named
geodict.dct) that maintains information about which map layers can be matched, and which
fields can be used as match fields. Files need to be registered in the Geodictionary if you
wish to take advantage of automatching/autobinding. For example, if you have data that
has sales by state, the GeoDictionary may determine that that data should be matched
against the “USA” map layer.
You can specify programatically or explicitly the column(s) to match from the map against
which column in your data file/table, or you can let MapX reference the GeoDictionary to
try and find a match.
the Add button and select the existing GeoSet you wish to add the table to.
If the path for the new table you have registered is not listed within the MapX search path,
the Map Manager program will then ask if you wish to copy the data into the MapX data
directory or simply add the path to MapX’s search path.
Something to keep in mind when distributing your application and associated data is that
there are copyright laws involving many types of data. Make sure that you have the rights
to distribute the data. If you are not sure, contact your data provider
For more information on the GeoDictionary, see "Using the GeoDictionary Manager".
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. Data Binding is discussed in
chapter: "Putting Your Data on the Map". Theme mapping is discussed in chapter, "Theme
Mapping and Analysis".
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 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. Note that
programming languages like Visual Basic, Delphi and PowerBuilder require you to specify
the MapX version number after the object name (e.g. "MapX.Style.4").
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.3"),
// 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.3');
s.PickRegion;
MapObject.Layers.Item(1).Style := s;
end
PowerBuilder Example
OLEObject s
long oleStatus
s = CREATE OLEObject
oleStatus = s.ConnectToNewObject("MapX.Style.3")
ole_1.Object.Layers.Item(1).Style = s
Mapping Concepts
2
Chapter
Now that you have installed MapX and been ➤ Organizing Your Data and
enticed by the wide variety of features and
Maps: An Overview of
Tables
functionality in the What’s New chapter, you are
probably anxious to get mapping. But, first, take a ➤ What Are GeoSets?
few minutes to read this chapter, especially if you ➤ Map Features
are new to MapX. This chapter gives you a solid
➤ Putting Your Data on the
understanding of the concepts for successful Map
mapping with MapX.
➤ The Power of MapX
Chapter 3: Mapping Concepts
• <Somefile>.tab: This file describes the structure of the MapInfo table. It is a small
text file describing the format of the file containing the data.
• <Somefile>.dat(.mdb, .aid, or .dbf): These files contain the tabular data.
• <Somefile>.map: This file describes the graphic objects (will not exist if the table has
no map objects).
• <Somefile>.id: This file is a cross reference file that links the data with the objects
(will not exist if the table has no map objects).
• <Somefile>.ind: This is an index file. The index file allows you to search for map
objects using the Find object.
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.
When a geoset is opened, it automatically opens all of the files included in the geoset to a
default display. The developer can change the default display to meet their individual
needs. A geoset's settings include projection, default zoom, auto-labeling of objects, zoom
layering and whether the table is visible when opened. MapX will also open any single (.tab)
map file the developer specifies. Geosets are provided for convenience and are not required
for MapX to function.
DC Geoset DC Landmarks
DC Roads
DC State Roads
DC Interstate Roads
DC Highways
DC Zips
Dc Area Landmarks
Dc Water Layer
Dc City Boundaries
US Geoset US Cities
US top 20 Cities
US Major Cities
US Highways
US State Boundaries
US State Capitals
World Ocean (Lat / Long)
Mexico State Boundaries
Canadian Province Boundaries
US County Boundaries
The MapStats.mdb
This is not a geoset, rather, an access database containing demographic information that
matches many of the geosets that in MapX.
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.
There are many different types of databases in businesses today; therefore, MapX lets you
bind to several different types of DataSources. The first argument to the Datasets.Add
method lets you specify a DatasetTypeConstants value, which dictates the type of data
binding you wish to perform. Types of data sources you can bind to include:
Datasource Description
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.
Datasource Description
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/NotesQuery These types of data binding deal specifically with Lotus Notes.
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
safearray.
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.
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.
As you become better acquainted with MapX, you will find that its applications are limited
only by your imagination.
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 an OCX
component that can be quickly integrated into client applications using object-oriented
languages such as Visual Basic, PowerBuilder, Delphi, Visual C++, and Lotus Script with
Lotus Notes v4.5.
System Requirements
Because MapX is a 32-bit OCX, it requires a 32-bit version of Windows (Windows 95/98/
2000 or Windows NT 4.0). MapX applications cannot run on Windows 3.1.
MapX works with object-oriented programming languages (such as Visual Basic, Visual
C++, PowerBuilder, or Delphi) or with Lotus Notes using Lotus Script.
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 4.0
MapX Contents
Program Files
The MapX OCX, along with an assortment of DLLs and other support files.
Sample Maps
A collection of map files (in MapInfo table format) of different regions around the
world. The number of sample maps included with MapX depends on which version of
MapX you install; the full version of MapX includes more maps than the 30-day
evaluation software.
Sample Data
A Microsoft Access database containing sample demographic data.
Sample Applications
Program examples in various languages, showing you MapX in action. For the latest
sample programs, visit the MapX web site: http://www.mapx.com
Utilities
The MapInfo Geodictionary Manager (GeoDictionaryManager40.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 MapX and 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:). Click on the Windows Start button
and select Run.
2. Type or select [ CD Drive Letter ]\Setup.exe (e.g., D:\Setup.exe) in the Open drop-
down list and click OK.
The Welcome screen displays. Choose Next to continue the installation process.
3. The Software License screen displays. Choose YES to accept the terms of the
agreement and to continue the installation process.
4. 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 4.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
If you save your project, the next time you re-load your project the Map icon will appear in
the toolbox automatically.
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.
You may need to modify the strings that you pass to CreateDispatch. With an earlier version
of MapX , you may have used a string to specify an object name; for example:
Flds.CreateDispatch("MapX.Fields")
With the current version of MapX, you need to specify a different string:
Flds.CreateDispatch("MapX.Fields.4")
To make your code more compatible with future versions of MapX, you may want to use
GetClsid instead of a string. The result returned by GetClsid will work in current and future
versions of MapX. For example:
Flds.CreateDispatch(Flds.GetClsid())
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 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 4.0\Samples40
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
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: "Finding Features on a Map".
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.
MapInfo\MapX 4.0\Samples40
As you study the sample C++ application mapxsamp.cpp, refer to"Working With Visual
C++, to help you understand how to use MapX with C++.
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 theTools 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.
Notes client applications cannot call Datasets.Add with type miDataSetUnbound. This
restriction is due to a bug in Notes 4.5 (related to type conversion for booleans) which
prohibits using the MapX RequestData method for unbound data sets through LotusScript.
Lotus plans to fix this problem in an upcoming release of Notes.
MapX accesses Lotus Notes by using the support files MNotesDataset.dll and
MMapXColumnInfo.dll, which are stored in the MapX Program directory. If you check the
Lotus Notes Data Driver option at install time, the MapX installer attempts to register these
dlls. Note: If the file nnotes.dll (which is part of Lotus Notes) is not in your path, the MapX
installer will not be able to register these dlls, and an error message will be displayed during
installation.
To correct this error, modify your SYSTEMPATH to include your Lotus Notes directory.
Then register the dlls manually (by running regsvr32.exe) or re-run the MapX installer with
the Lotus Notes data driver option checked.
Note: To access a database on a Notes server, there must be at least one database from
that server located on your Notes desktop (desktop.dsk).
• The Server property specifies the name of the Notes server. If the file is being
accessed locally, this can be set to the null string.
• The Database property is used to specify the path to the database file. On a Server,
this path would be relative to the Notes data directory; locally, this would be a full
path beginning with a drive letter. NOTE: Because UNC path specifications are not
supported by the Notes API, drive mappings must be used for accessing a database
across a network.
• The View property represents the name of the Notes View being referenced.
Notes View will typically be used with a MapX Fields object to define specifically which
columns of the View are to be used. The MapX Fields object is used in the normal way,
although it is important to note that column title references are case specific.
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. MapX displays 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.
The MapX web site also provides sample applications, as well as a Discussion Area where
you can post questions and interact with other MapX users.
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.
➤ Maps as Layers
Mapping in Layers ➤ The Layers Collection:
Building Blocks of Your
This chapter presents the relationship between Map
tables and maps, and shows how they are layered ➤ Properties of the Layers
to create the level of detail you want. Collection
• Maps as Layers ➤ Methods of the Layers
• The Layers Collection: Building Blocks of Collection
Your Map ➤ The Layer Object
• Some Properties of the Layers Collection
➤ Layer Order
• Some Methods of the Layers Collection
• The Layer Object ➤ Examining Layers
• Layer Order ➤ Checking a Layer’s Feature
• Examining Layers Type
• Checking a Layer’s Feature Type
➤ Zoom Layering
• Zoom Layering
• Generating Labels for a Layer
➤ Generating Labels for a
Layer
• Annotations
• Raster Images ➤ Annotations
• Animation Layers ➤ Raster Images
➤ Animation Layers
➤ Drawing Layers
Chapter 5: Mapping in Layers
Let’s say you want to write an application that begins with a map of World Countries, that
is, a collection of Layers that together make up a map of the World.You can do this by
specifying the World Countries Geoset at design time:
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: The "MapX Objects" section has a complete listing of Layers Collection methods
and properties.
Dim x as integer
For x = 1 to Map1.Layers.Count
Print Map1.Layers(x).Name
Next
Map1.Layers.Item(3)Visible = False
Map1.Layers(3).Visible = False
Map1.Layers.Item(“Highways”).Visible = False
Map1.Layers(“Highways”).Visible = False
'This sets the map bounds to the geographic extents of all layers
in 'the collection effectively bringing the entire map into view.
On Error Resume Next
Set Map1.Bounds = Map1.Layers.Bounds
End Sub
Note: The "MapX Objects" section has a complete listing of Layers Collection methods
and properties.
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.
Create a Layer
Allows you to create a new temporary or permanent MapInfo table layer. The method
returns a Layer object—the Layer object that was added to the collection.
Add a Layer
Adds an existing layer to the collection and displays it on the map.
When adding a layer, you can specify the position of the layer in the collection with the
optional Position parameter. If no Position parameter is specified, the layer is positioned
automatically with respect to other layers in the map. For example, a layer with points is
placed above a layer with regions.
Map1.Layers.Add “C:\Data\Counties.tab”
-or-
Private Sub mnuAddLayers_Click()
'This uses the common dialog to open a MapInfo Table and add
it
as a layer.
Dim sFile As String
With dlgCommonDialog
.DialogTitle = "Add Layer"
.Filter = "MapInfo Tables (*.tab)|*.tab"
.ShowOpen
If Len(.filename) = 0 Then
Exit Sub
End If
sFile = .filename
End With
On Error Resume Next
Map1.Layers.Add sFile
End Sub
Remove a Layer
The Remove method removes a specified layer from the map.
Map1.Layers.Remove 3
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
You may manipulate the layer object at any time within a program. You can also use the
Property Page to set layer properties at design-time, as discussed above. The Layer object
has many properties and methods. The methods used to get features from a Layer are
discussed in "Features and Selections".
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
See "The MapX Objects" section of this book or on-line help system for a complete list of
Layer properties.
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. Tools are discussed in "Tools".
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 i as Integer
For i = 1 To Map1.Layers.Count
Select Case Map1.Layers(i).PredominantFeatureType
Case miFeatureTypeRegion
MsgBox “Layer ” & lyr.Name & “ contains regions”
Case miFeatureTypeLine
MsgBox “Layer ” & lyr.Name & “ contains lines”
Case miFeatureTypeSymbol
MsgBox “Layer ” & lyr.Name & “ contains symbols”
Case miFeatureTypeMixed
MsgBox “Layer ” & lyr.Name & “ contains mixed
features”
Case miFeatureTypeUnknown
MsgBox “Layer ” & lyr.Name & “ contains unknown _
features”
Case miFeatureTypeText
MsgBox “Layer ” & lyr.Name & “contains text features”
Next
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.
Different layers in the same Map window can be displayed at different zoom levels. For
example, you have a layer of streets, a layer of county boundaries, and a layer of state
boundaries. You want the streets layer to be visible only when the zoom level is less than
eight miles. You want the county boundary layer to display when the zoom level falls
between 20 miles and 200 miles. You want the states boundary layer to be visible only when
the zoom level is greater than 100 miles. You can set a different zoom level for every layer in
your map.
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.
Each Layer object has a LabelProperties object, which controls many aspects of labels. For
example, to hide all of a layer's labels, set the LabelProperties.Visible property to False. To
specify the maximum 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.
Dim DS As Object
Dim DB As Object
Dim RS As Object
Dim Temp As Object
Set DB = Workspaces(0).OpenDatabase("Mapstats.mdb")
Set RS = DB.OpenRecordset("USA")
Set DS = Map1.Datasets.Add(miDataSetDAO, RS)
Set Map1.Layers("usa").LabelProperties.Dataset = DS
Set Temp = DS.Fields("GEONAME")
Set Map1.Layers("usa").LabelProperties.DataField = Temp
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.
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.
Although a raster image can be a picture of a map, the image cannot have data attached to it.
The image is for viewing, as a backdrop or "underlay."
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 Map.Layers.AnimationLayer = Layers(3)
The property can be used to identify what layer is currently the animation layer (if any):
for each lyr in Map.Layers
if Map.Layers.AnimationLayer = lyr the ...
end if
next
To turn off the animation layer, you assign null to it:
Drawing Layers
The AddUserDraw Layer method of the Layers collection gives developers the ability to
draw layers on a map. It is used in conjunction with the DrawUserLayer event, which is
fired when the layer needs to get drawn. The method returns a newly created Layer object.
There can be any number of user draw layers.
How It Works
First, you add a user draw layer to your layers collection:
There are many different types of databases in businesses today; therefore, MapX lets you
bind to several different types of DataSources. In MapX, the data is represented as a Dataset
object. The first argument to the Datasets.Add method lets you specify a
DatasetTypeConstants value, which dictates the type of data binding you wish to perform.
Types of data sources you can bind to include:
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
ODBC MapX can use ODBC to retrieve data from any ODBC data source.
OLE Data This is for containers such as PowerBuilder.
Oracle Express This allows access to the datacube as a Dataset.
Objects
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.
• You can view the data as features on a map. Let’s say you have a Microsoft Access
table of your sales office locations for the United States. Through data binding you
can add your table as a Dataset with the Datasets.Add method using a BindLayer
object as one of the parameters. This will create a new layer in your map and
display each sales location as a point on the United States map. Once you add the
data to the map, you can use MapX to easily create an application that finds the
nearest sales location to an address entered by a customer. Finding features on a
map is discussed in "Finding Features on a Map".
• You can bind your attribute data to a map and then use it to create a thematically
shaded map based on your data. Let’s say your Microsoft Access table of sales
locations also contains a column of total sales volume for each location. Using the
Datasets.Add method you can add the column containing total sales volume to
your United States map. Once you add the data to the map, you can create a theme
shading sales volume by state. Theme mapping is discussed in "Theme Mapping
and Analysis".
• 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. With this method,
you can tell MapX which data source to use, some information about it, and which
map layer to bind it to. Alternately, the Add method allows you to bind data
without explicitly specifying the nature of the data; in this case, MapX analyzes
your data and automatically determines the best way of binding your data to the
map.
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 property you can use to access the computed value for each row
(that is, feature) of the map.
With most types of data binding, the DataSource (the second parameter for Dataset) 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.
Dataset Object
The Dataset Object is the result of binding data from a data source into MapX.
A Dataset contains computed values for features in the map layer to which the data is
bound. The data sources may be a DAO Recordset, ODBC data source, Global Handle (this
is a way to pass in a block of tab delimited data), OLE Data (this is for containers such as
PowerBuilder), and Unbound Data (where MapX asks the container for data values, a cell at
a time).
Datasets Collection
The Datasets collection is an object representing all of the Datasets for a map. The Datasets
collection has methods and properties used to add, remove, or work with existing Dataset
objects in the collection.
designate a specific Dataset and add it to a collection of Datasets. Let’s look at the syntax of
the Datasets.Add method.
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
miDatasetDrelphi5 Borland Delphi 5
miDatasetGlobalHandle Tab delimited data
miDatasetLayer MapInfo Table
miDatasetNotesQuery Lotus Notes Query
miDatasetNotesView Lotus Notes View
miDatasetODBC ODBC Database
miDatasetOEO Oracle Express Objects
miDatasetOLEData OLE datasource
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.
Here are valid data sources for each of Dataset type:
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.
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.
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.
method (or with the Themes.Add method; see "Thematic Mapping and Analysis"). The
Fields parameter of Datasets.Add takes a Fields collection, and is built using this Add
method. The Add method cannot be used on a Dataset’s Fields collection once the Dataset
has been created.
For an in depth look at the Fields.Add method, see the reference entry for Fields.Add in the
"The MapX Objects" section.
Data Aggregation
The Aggregate Function parameter of the Fields.Add method determines how MapX
computes the Field value when multiple matches are found.
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.
Constant Description
• When your data contains x and y coordinates (such as longitude and latitude).
Points are created at the specified location. See "Displaying Your X / Y Data as a
Layer of Points on a Map".
• When your data contains reference information, such as Zip Codes.
Points are created at the Zip Code location (approximate location). See "Displaying
Your ZIP Code Data as a Layer of Points on a Map".
The BindLayer object is required when binding data that has X/Y coordinates or point
information such as Zip Codes, and you want to see points created in a new or existing layer
at the locations specified by your data.
When you add the Dataset using a BindLayerObject, the points automatically show up on
the map. This is not the case when adding a Dataset without the BindLayerObject. Only
BindLayer Objects have this behavior.
The points will be brought in as gray stars. If you wish to change the style, you must set the
Layer.OverrideStyle property equal to True and change the style properties. The style
changes will not show up unless Layer.OverrideStyle is set to True.
MapX supplies a table called Us_zips.tab in the \MapInfo\MapX 4.0\Maps directory which
you can use as your reference layer for US ZIP Codes. Us_zips.tab also has a “friendly
name” (the description that is assigned to the layer through the geodictionary) which is “US
5 Digit ZIP Code Centers.”
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.
When you use the Datasets.Add method, MapX can analyze your data to determine how the
data might be bound to the map. Specifically, the method has these automated behaviors:
During automatic data binding, MapX calls the ResolveDataBind event if the data is
ambiguous.
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
miBindLayerTypeX . 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.
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.
The Following methods of the Layers collection provide various ways to get a Features
collection.
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 associ-
ates the map's coordinate system with the feature.
To examine the list of selected features, use the Selection collection, which is a collection of
Feature objects. The Selection collection also provides various methods (such as
SelectByRadius) that allow you to perform various types of selection, for example, selecting
all of the features within a certain radius of a city. The selected features will show up
highlighted on the map. Each layer has a collection of selected feature objects
(Layer.Selection).
The Selection collection has methods to add and remove features to and from the collection.
Also, if you have an existing Selection or Features collection, you may append, remove,
copy, or find the intersection of the two collections.
The following table lists some of the Selection collection methods. For a complete listing,
see the Object Model Diagram:
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.
• How to Create New Map Features
• Allocating a New Feature Object
• FeatureFactory Methods
• How to Modify Existing Features
• How to Delete Existing Features
• How to Obtain a Feature to Edit
• Examining the Parts of a Region or Line
A feature that comes from a layer is not a stand-alone feature, and all properties and
methods work on it.
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.
These are the methods of the FeatureFactory object:
• BufferFeatures
• CombineFeatures
• CreateArc
• CreateCircularRegion
• CreateEllipticalRegion
• CreateLine
• CreateRegion
• CreateSymbol
• CreateText
• EraseFeature
• IntersectFeatures
• IntersectionPoints
• IntersectionTest
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.
Once you start modifying a feature by setting its style or points or location, your changes do
not take effect until you 'update' the feature. This arrangement allows you to make many
changes to a feature without waiting for the database to update and the screen to redraw
after each change. As a side effect, the MBR, area, length, etc. are not changed until you
update the feature.
• 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.
The Layer object has various methods (described above), such as SearchAtPoint, that allow
you to obtain a Features collection.
You can use the Find.Search method to perform a query that returns a FindFeature object (a
super class of the Feature object).
Note that the Style object does not provide a "Size" property, nor does it provide "Bold" or
"Italic" properties. If you need to set a symbol's font size, bold or italic settings, you must
obtain and modify a Font object, as follows:
1. Reference the Style.SymbolFont property to obtain a Font object.
2. Modify properties of the Font object to control the appearance of the symbol.
The Font object is not a part of the MapX object model; instead, it is a standard object
(OLE_FONT, IFontDispatch).
Setting a text feature's font properties is very similar, except that you reference
Style.TextFont instead of Style.SymbolFont.
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.
➤ What Is Thematic
Thematic Mapping and Mapping?
➤ Planning Your Thematic
Analysis Map
➤ Types of Thematic
Thematic mapping is a powerful way to analyze
Mapping
and visualize your data. You give graphic form to
your data so that you can see it on a map. Patterns ➤ Manipulating a Theme
Map
and trends that are almost impossible to detect in
lists of data reveal themselves clearly when you use ➤ Customizing a Thematic
thematic shading to display data on a map.
Legend
There are many ways that thematic maps can illustrate your data. The most commonly
known example of a thematic map is a weather map. Where you see red, you know it is hot
(high number of degrees); where you see blue, it is cold (low number of degrees). Thematic
mapping also allows you to discover trends in data that would be difficult to see through
tabular data.
Using the properties and methods in the Themes collection, Theme object, and the Theme-
Properties object, you can create and define your own thematic shading. A Legend object
holds the theme’s key,describing what the theme’s colors, shapes, and sizes represent.
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 Collectio
Each dataset has a collection of themes. A Themes collection creates, counts, adds, or
removes a Theme object from a collection of themes.
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:
Syntax
Themes.Add [Type], [Field], [Name]
Part Description
Type Specifies the type of thematic map to create. This takes a
ThemeTypeConstants. This is an optional parameter, and if not
specified (or specified as miThemeAuto), MapX will attempt to
choose a good default based on the number of fields passed in as
well as what other theme types are already being displayed. If
MapX cannot choose a default theme type, an error is generated.
Field(s) Specifies the field or fields to use in the thematic map. A field
can be specified by name, index, or by a Field object. If you are
creating a theme using multiple variables, pass in an array of
field names, indexes or Field objects. This is an optional
parameter, and if not specified, MapX uses the first numeric
field of the DataSet.
Name Specifies the name of the thematic map. This is a String
parameter. This is an optional parameter, and if not specified,
MapX generates a name such as StatesBySales.
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).
Type Description
miThemeRanged Ranges Theme
miThemeBarChart Bar Chart Theme
miThemePieChart Pie Chart Theme
miThemeGradSymbol Graduated Symbol Theme
miThemeDotDensity Dot Density Theme
miThemeIndividualValue Individual Values Theme
miThemeAuto MapX “best guess” Theme
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.
Properties Description
AutoRecompute Controls when theme ranges are recomputed when theme
properties are changed (i.e., number of ranges). Defaults to True.
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.
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 NewYork 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.
To create a bivariate map in MapX, you create two thematic maps, and layer one over the
other so that the objects display two variables.
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:
• Theme.ThemeDlg method.
• ThemeProperties object of a theme.
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 ar
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.
Property Description
AllowEmptyRanges Controls whether empty ranges are allowed in a ranged
theme.
DataValue Applies to graduated symbol, pie, and bar themes. This
is the value at which the thematic graphic is drawn at
the size specified by the Size property.
DistMethod Controls how ranges are created when a Theme object is
recomputed. This is a DistribMethodConstants value
and defaults to MiEqualCountPerRange. Other method
constants are miEqualRangeSize, MiCustomRanges,
miNaturalBreakRange, miStandardDeviation.
DotSize Controls the dot size used by dot density thematic
maps.
Graduated Controls whether the size of the pie charts is graduated
based on the total value of the pie.
IndividualValueCategory IndividualValueCategory collection.
Independent Controls whether the data values for the bars charts
should be treated independently.
MultivarCategories There is one MultiVarcategory object per variable or
field mapped in a pie or bar theme.
NumRanges Controls the number of ranges for a ranged thematic
map.
RangeCategories A ranged thematic map has a collection of
RangeCategory objects.
Size Works in conjunction with the DataValue property to
control how big the thematic graphics are at particular
values in pie and bar themes.
Property Description
A ranged thematic map has a collection of RangeCategory objects, one for each range sorted
in ascending order. The ThemeProperties.RangeCategories property stores the collection.
If ThemeProperties.DistMethod is MiCustomRanges, MapX will assume that you have set
this value yourself, and will use the ranges that you have defined when grouping data
values. An error is generated if there are ranges that overlap when the theme is
recomputed.
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
➤ Find Object
The Find method of the Layer object allows you to
➤ FindFeature Object
search a layer in a map object and locate a specific
feature within the layer.
Chapter 9: Finding Features on a Map
For instance, if you wish to locate the city of Albany within NY state, you can use the Find
Object Search method to search a city layer and a state layer for the specified feature.
The Find Object properties allow you to specify the parameters of your find. For a complete
listing of all methods and properties associated with the Find object, please see the Find
Object topic in the MapX Objects section.
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.
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.
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.
➤ What Is a Drilldown
Using Drilldown Layers Layer?
➤ Terms and Concepts You
In this chapter, you'll learn about a special type of Should Know
map layer, known as a Drilldown layer, that lets the ➤ How To Develop a
user perform "drill-down" analysis and exploration. Drilldown Application
If your map includes a Drilldown layer, your user
➤ Preparing a Drilldown
can point and click on part of the map to see more Layer
detail about that region. Drilldown layers provide
➤ Creating a Drilldown Tool
an intuitive, easy to use interface that allows users
to explore data by pointing and clicking. ➤ Resetting the Drilldown
Layer
➤ Drilldown Layer
Limitations and
Requirements
➤ For More Information...
Chapter 10: Using Drilldown Layers
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.
• Requirements for the Component Tables
• Requirements for the Drilldown Table
• Component Table Metadata Keys
• Sample Drilldown Table
The .tab file is a text file, which you can view or edit in any text editor.
The Drilldown table's .tab file must define specific columns and metadata keys, as described
below. As you read the following requirements, please refer to the “Sample Drilldown
Table” for an example.
The Drilldown table must define three standard columns: Key, Level, and Label. All three
columns are character (string) columns, 32 characters wide.
The Drilldown table must contain a set of metadata keys. Metadata key syntax is as follows:
• The keyword begin_metadata marks the beginning of the metadata portion of the
.tab file.
• Each line of metadata has two elements: a key, and a value. For example, the key
"\IsDrilldown" has the value "True". All keys and values are enclosed within double
quotation marks.
• 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:
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.
You can implement a Drilldown tool by using the CreateCustomTool method. The set of
CursorConstants includes two cursors provided specifically for Drilldown applications:
miDrilldownExpandCursor and miDrilldownContractCursor. For example:
Once you have created the custom tool, you can make the tool active by setting the
CurrentTool property.
Map1.CurrentTool = 1
Each use of the custom Drilldown tool will trigger the ToolUsed event. Within the ToolUsed
event procedure, you will need to execute code that causes the drill-down behavior. This is
basically a four-step process:
1. Determine which map feature the user clicked on, using methods such as
SelectByPoint or SearchAtPoint.
2. Determine which set of child features should replace the feature the user clicked on.
For example, you might use one or more nested Case statements to determine
which child features replace the chosen parent feature.
3. Call the DrilldownAddFeatures method to add the child features to the map.
4. Call the DrilldownRemoveFeatures method to remove the parent feature (the
feature that the user clicked on) from the map.
Note: These add/remove actions do not modify the component tables in any way; you
are not "editing" the tables. When you use the DrilldownAddFeatures method to
add features, the only effect is that the features are copied into the set of features
You can create a Roll-Up tool in much the same way that you create a Drilldown tool. You
will need to use the same methods (DrilldownAddFeatures and
DrilldownRemoveFeatures). The difference is that instead of adding child features and
removing parent features, you'll do the opposite — you'll add parent features and remove
child features.
For example, you might include a "Reset button" in your user interface. When the user clicks
the button, you could call the DrilldownReset method to restore the original state of the
Drilldown layer.
Including a reset button is a good idea, because it gives your users a quick, easy way of
restoring the drilldown layer to a homogeneous state.
• Each feature in a Drilldown layer must contain an ID that is unique within that
component table (although the ID does not need to be unique among all of the
component tables that make up the Drilldown layer).
• You cannot use a raster image underlay table in a Drilldown layer.
• When creating a theme with Themes.Add, computing ranges for layers with large
numbers of rows, such as drilldown or server layers, can take some time. The
ComputeTheme parameter of the Add method 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.
• A Drilldown layer does not "remember" the status of the various drill-down levels
(which features have been expanded, etc.). If you want your application to restore
the precise status of the map's last use, you will need to write code to store the
map's drill-down settings when exiting, and restore the drill-down settings when
starting.
• Although you can edit the features in a Drilldown layer, the edits are not saved, and
the component tables are not affected by your edits. When you edit a feature in a
Drilldown layer, you are not modifying the component table, you are modifying a
temporary copy of a feature from a component table.
The Layer.DrilldownReset method clears an entire Drilldown layer, then shows only one
level of detail from the layer.
To determine whether a layer is a Drilldown layer, test whether the Layer.Type property
returns the value miLayerTypeDrilldown (value: 7).
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.
• Use the Layers.Add method with the LayerInfo object when the query needs to be
calculated dynamically at run time. This would be appropriate for a case with
newly entered data. For example, you have an application that determines locations
of stores that have generated a user-entered amount of revenue. The revenue value
entered via the application could not be known at design time and, therefore, can
only be added to the query at run time. This replaces the previous AddServerLayer
method.
• Use the Layers.Add with a .tab file when the query is known at design time. For
example, if an application requires a display of all of the fire hydrants that are in
service, the query can be set to select all hydrants where the in-service condition is
true. This can be set at design time. A .tab file can be placed directly into a geoset,
ensuring that the file is loaded when any application using that geoset is initialized.
The details of each technique for adding spatial data are included in the following sections.
Once you have decided how to handle your data, follow the instructions in the appropriate
section.
Note: MapX 4.0 does not support opening SpatialWare 3.0 or lower tables.
You can create a .tab file to provide access to remote maps. To generate a .tab file using
MapInfo Professional, choose File -> Open a DBMS table.
The .tab file is a text file; you can create a .tab file using any text editor. Once you have
created the .tab file, you can access it the way you access any other MapInfo .tab file
programmatically through the Layers.Add method or through the Geoset Manager.
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 4.02 edits are
made.
Geometry Conversion
The table below describes the translation from MapInfo Spatial Objects to Oracle8i Spatial
(SDO_Geometry).
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
• GTYPE4 - heterogenous collection of elements
• GTYPE 5 - Multi Point
These types are interpreted(when possible) as single point SDO_POINTTYPE values if
not already NULL. They "grab" the first point in the ordered array which would be
interpreted as a NULL geometry.
Note: Any other SDO_GEOMETRY values that contain circles or arc components are
translated into line strings contaning 25 lines per 360 degrees.
Professional Coordsys string as indicated in the SR_ID of the data, since it is the Coordsys
in the MapInfo_MapCatalog that is currently used to interpret and update the data.
If the Spatial column does NOT contyain an SR_ID value, (the value is NULL), MapX will
also be able to interpret the data via the MapInfo Professional Coordsys defined in the
MapCatalog.
A way around this is to write a simple connect dialog that gets the password from the user
and does a Layers.Add for a DBMS layer using layerinfo with a connection string using the
userID/password for the database you wish to access. An Oracle connection string should
be specified as follows:
"SRVR=superior;UID=user1;PWD=secret;"
Add a temporary layer. This will also add the connection desired to the connection pool.
That connection will be used by all tab files opened on the same database with the same
userid since the password has already been authenticated. Thus the .tab files will be opened
successfully.
For these tab files to work in a geoset, you may have to put this login in the application
startup. You can connect to/login to multiple servers in this way and tables opened from
them will succeed.
Parameter Description
Parameter Description
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.
MapX generates several internal queries based on your query to access the data in the
mapper as well as selection/key based queries. The table from which the object column is
selected from MUST be registered in the MapInfo Mapcatalog on the server. MapX requires
this to obtain certain metadata about the geometry column such as the coordinate system,
storage format, and default styles used to draw the layer.
In order for a query to succeed in adding a new layer, the query must contain both a
geometry column and a key column. Sometimes for more complex queries on small sets of
data (where the spatial indexing or spatial predicate cause the query to fail), you can turn
the predicate off specifying MBRSEARCH “OFF” to enable the results to be mapped.
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 alis 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.
To access the attribute data selected in the query with the spatial object in a DBMS layer, use
the datasets.add method with dataset type midatasetlayer (to get the attributes from the
existing layer).
When you add a DBMS layer, for performance sake, you should only specify the columns in
the query that you intend to use in your application. These are the spatial column, the key
column(s), which are added automatically if you do not specify them, and columns you
want to label with, or create a theme from. You may use the pseudo columns "OBJECT" for
any mappable table to refer to the column(s) containing the spatial data. This is required for
a table using the MapMarker MDIGEOADDRESS column on a table with an X/Y column.
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.
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.
Caching
A DBMS layer can be cached to improve performance if your application specifies redraws,
themes, and labeling (CACHE ON is the default). It requires significant amounts of
memory to cache all of the layer data in the map, so be selective about which layers you
create.
ODBC layer data is cached internally as it is read and drawn to the MapX Map window. All
subsequent redraws will read from this cache instead of going to the server database for the
same data. The cache is able to offer significant redraw performance improvement.
If you pan or zoom out of the region loaded in the cache as defined by the MBR of the Map
window, the cache will automatically be flushed and reloaded with the data from the server
database within the new MBR.
If you want to reload the cache from the database without panning or zooming out to obtain
a fresh view of potentially modified data within that geographic area, use the Layer.Refresh
method.
A good strategy for harnessing the full power of the cache is to try to load as much data as
possible in your initial view and have all subsequent options zoom in and pan around
within the cache.
Note: If you try to cache too much data or too many layers, virtual memory usage may
be forced, and performance gain would in turn be lost.
Note: RDB layers get their style from from the MapCatalog. There is no individual
feature style to set. That is, attempting to change a feature style with the
Feature.Update method will not change style properties for RDB Layers. The
entire RDB layer is represented by the style property which MUST be set in the
MapInfo catalog.
Your MapX application can use a Map Catalog that already exists on the server. (This same
catalog is shared by various MapInfo client applications, including MapInfo Professional.) If
there is no Map Catalog on the server, you will need to create it.
A Map Catalog that was created by MapInfo Professional can be used by MapX
applications. For example, in a corporate setting, one user—a database administrator,
perhaps—can use MapInfo Professional to create the Map Catalog, and then numerous end
users can run MapX applications that read from that Map Catalog.
• To load data into SpatialWare for Oracle, use the MISWUP32.MBX utility that is
provided with MapInfo Professional (located in the SpatialWare client install
directory).
• To load data into DB2 SpatialWare, IUS/UDO SpatialWare, and Oracle Spatial, use
The MapInfo EasyLoader, that is distributed with MapInfo Professional and also
available for download from www.mapinfo.com.(For DB2 and IUS/UDO you must
have the SpatialWare extender/cartridge installed on the server)
• To load non-mappable tables, or Point-only tables, into any DBMS, use
MIUPLOAD.MBX utility provided with MapInfo professional in the tools directory.
This will store the Point object coordinates in separate x/y numeric columns.You
may map these tables by registering them in the MapCatalog as "X/Y Schema"
tables.
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 Data binding is not currently
matchable." attempted against a supported for SpatialWare layers.
SpatialWare layer.
No object was found using A query was made against a Check that the table name is
the index that you specified. table that does not exist. correct and in the proper case.
No spatial object is Also, the table may need to be
contained in the result of mappable.
the spatial query. Use the EasyLoader Upload utility
A query was made against a to make the table a mappable
non-spatial table. table.
Check the query for possible
syntax 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 The dataset was created MapX datasets.rowcount will
has the value of zero. from a DBMS server. always have a value of zero for
datasets created from a DBMS
server. When iterating through a
dataset, a trappable error is
generated when you exceed
dataset bounds. Use this trappable
error as a flag for iteration.
Map appears to have The MBR for a DBMS layer Edit the extents (DB_X_LL,
incorrect zoom level. For is determined by the DB_X_UR, DB_Y_LL, DB_Y_UR)
example, the map may be MapInfo_MapCatalog table. in the MapInfo_MapCatalog
zoomed out too far to The table extents in the using the MapInfo Professional
identify any geography. MapCatalog result in a MDX tool, MISETMBR.MDX.
different zoom level than
the one you desire for your
output.
➤ Basic Concepts of
Using Coordinate Systems Coordinate Systems
➤ Obtaining a Coordinate
In this chapter, you'll learn how to use Coordinate System Object
Systems (sometimes called "map projections") to ➤ Querying the Properties of
change the appearance of a map, or to change the a CoordSys Object
units in which map coordinates are processed by
➤ Displaying a Map in a
MapX. Different CoordSys
➤ Specifying X-Y Coordinates
in a Different CoordSys
➤ Displaying the Choose
Projection Dialog
➤ Using Settings From
MAPINFOW.PRJ
➤ Applying an Affine
Transformation
➤ Defining Custom Datums
➤ Datum Conversion
➤ For More Information...
Chapter 12: Using Coordinate Systems
The coordinate system affects how X-Y coordinates are processed. For example, a location
can be expressed in terms of degrees longitude/latitude, or it can be expressed in terms of
other units, such as meters.
The coordinate system affects the appearance of the map. Changing a map's coordinate
system can make the map appear stretched or distorted. Coordinate systems represent a
complex, advanced area of computer mapping. This discussion assumes that you are
already familiar with concepts of mapping, such as false eastings and map projections.
There are several ways to obtain a CoordSys object. Which technique you use depends on
what you are trying to accomplish.
The Map.DisplayCoordSys property returns a read-write CoordSys object. You can use this
object to control the coordinate system and map projection used to display the map. For
details, see, "Displaying a Map in a Different CoordSys", later in this chapter"
The Map.NumericCoordSys property also returns a read-write CoordSys object. Use this
object to set the coordinate system that MapX uses to process X-Y coordinates. For details,
see "Specifying X-Y Coordinates in a Different CoordSys".
The Layer.CoordSys property returns a read-only CoordSys object, which tells you the
coordinate system used to store features in a specific map layer. If you set the
Map.DisplayCoordSys to match a Layer.CoordSys, you maximize the display speed of that
layer. (When the DisplayCoordSys is different than the CoordSys in which a layer was
saved, MapX converts features on the fly, which slows down the display.)
You can query all of the properties for any CoordSys object—even properties that are not
applicable for that type of coordinate system. If a property is not applicable given the
CoordSys Type, MapX returns a default value. If you need to persist a CoordSys object, you
can do so by querying and saving all of its properties, without worrying about whether each
property is applicable.
Dim iProjectionType As
Integer
Dim iDatumNumber As
Integer
Dim iUnits As Integer
Dim dOriginLongitude As Double
Initialize the variables to be used by coordsys.set.
' Values were obtained from the "Robinson" entry
' in the file MAPINFOW.PRJ, which looks like this:
' "Robinson", 12, 62, 7, 0
iProjectionType = miRobinson '(value: 12)
iDatumNumber = 62 'North American 1927 (NAD 27)
iUnits = miUnitMeter '(value: 7)
dOriginLongitude = 0
Map1.DisplayCoordSys.Set iProjectionType, iDatumNumber, _
iUnits, dOriginLongitude
• When you specify map coordinates (as object properties or method parameters),
MapX assumes the coordinates are in this coordinate system.
• When MapX returns map coordinates (as object properties or events), the
coordinates are in this coordinate system.
By default, the coordinate system is Longitude/Latitude WGS-84. In other words, if you do
not modify the NumericCoordSys, MapX assumes that map coordinates are in degrees
Longitude/Latitude.
There are two ways an application can specify the coordinate system used to process
numeric coordinates:
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.
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. Par. Fact. East. Nor.
1 2
Albers Equal- X X X X X X X X
Area Conic
Azimuthal X X X X* X
Equidistant
Cylindrical X X X X
Equal Area
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 X X X X X X X X
Oblique
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. Par. Fact. East. Nor.
1 2
Swiss X X X X X X
Oblique
Mercator
Transverse X X X X X X X
Mercator
* 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.
Suppose you have used a specific projection in MapInfo—the Robinson projection, for
example—and you want to specify that projection in a MapX application. The
MAPINFOW.PRJ file gives you the information you need to fill in the various parameters to
MapX methods, such as CoordSys.Set.
Entries in MAPINFOW.PRJ have the following parameters. Parameters are separated by
commas.
Part Description
Part Description
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
For example, the following line from a hypothetical MAPINFOW.PRJ file represents a
coordinate system with both an affine transformation and a bounds definition. This
coordinate system uses UTM Zone 10 (coordinate system type: miTransverseMercator
which has a value of 8). However, because this coordinate system includes both an affine
transformation and a bounds description, the number following the description is 3008 (8 +
1000 + 2000).
name,
CoordSysType + 3000,
the projection parameters (Transverse Mercator uses 7 _
parameters),
the 7 affine transformation parameters,
The 4 bounds parameters (in the order: xmin, ymin, xmax, ymax)
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:
This discussion provides examples for both MapX and MapInfo Professional, for the sake of
those users who use both products. If you have already gone through the process of creating
a custom datum in MapInfo, you should find it easy to adapt your datum to MapX. If you
do not use MapInfo Professional, you can simply ignore the MapInfo-specific examples.
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.)
• An ellipsoid, also called a spheroid. This is an ellipse rotated around its minor axis
to form a three-dimensional surface. The ellipsoid is described by two mathematical
parameters: the length, in meters, of its semi-major axis (denoted by the letter a)
and its degree of flattening (denoted by the letter f). Over 40 predefined ellipsoids
are supported; see Ellipsoids Supported by MapX.
• Three shift parameters specifying the distance, in meters, to shift the ellipsoid along
each of its axes. These parameters are usually denoted by dX, dY, and dZ. You may
also see them denoted by u,v, and w. The MapX Datum.Set method identifies these
parameters as ShiftX, ShiftY, and ShiftZ.
• Three rotation parameters specifying the angle, in arc-seconds, to rotate the
ellipsoid around each of its axes. These parameters are usually denoted by EX, EY,
and EZ. The Datum.Set method identifies these parameters as RotateX, RotateY, and
RotateZ.
• A scale correction factor specifying the amount, in parts per million, to adjust the
size of the ellipsoid. This parameter is denoted by the letter m.
• The longitude of the prime meridian, in degrees east of Greenwich. The prime
meridian specifies which location on earth is assigned longitude 0°. Most datums
use Greenwich as the prime meridian, so this parameter is usually zero. 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.
It’s also very important to list the parameters in the correct order. Some documents list the
rotation parameters with EZ first, like this: EZ, EY, EX. In those cases, you must reverse the
order of the rotation parameters when defining the custom datum. This is especially easy to
overlook when your document uses Greek letters to denote the parameters.
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
If you created a MapX application using an earlier version of MapX, see “Upgrading C++
Applications from an Earlier Version of MapX”
You may need to modify the strings that you pass to CreateDispatch. With an earlier version
of MapX , you may have used a string to specify an object name; for example:
Flds.CreateDispatch("MapX.Fields")
With the current version of MapX, you need to specify a different string:
Flds.CreateDispatch("MapX.Fields.4")
To make your code more compatible with future versions of MapX, you may want to use
GetClsid instead of a string. The result returned by GetClsid will work in current and future
versions of MapX. For example:
Flds.CreateDispatch(Flds.GetClsid())
This change applies to all objects that you create.
In the MapX object model, you can create stand-alone objects with these object classes:.
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 asVARIANTs.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.
Caution! Do not choose Project > Components And Controls command. Doing so would
create a .cpp file, but it would be incomplete.
#include "MapX.h"
:
:
:
class CMapxSampleView : public CView
{
:
:
:
protected:
CMapX m_ctrlMapX;
:
:
}
In our example, we want to make sure that MapX gets the focus whenever the window is
active:
m_ctrlMapX.SetFocus();
}
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_MAPXSATYPE, //Menu items to control MapX
RUNTIME_CLASS(CMapxSampleDoc),
RUNTIME_CLASS(CChildFrame), //custom MDI child frame
RUNTIME_CLASS(CMapxSampleView));
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.
"&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.
Once the tool is selected, built-in MapX functionality handles the zooming, selecting, etc.
// From MapX.h
#define MAPX_DISPID_SELECTION_CHANGED 0x1
#define MAPX_DISPID_RESOLVEDATABIND 0x2
#define MAPX_DISPID_TOOLUSED 0x3
#define MAPX_DISPID_REQUESTDATA 0x4
#define MAPX_DISPID_DATAMISMATCH 0x5
#define MAPX_DISPID_MAPVIEWCHANGED 0x6
#define MAPX_DISPID_ANNOTATIONADDED 0x7
#define MAPX_DISPID_ANNOTATIONCHANGED 0x8
#define MAPX_DISPID_THEMEMODIFYREQUESTED 0x9
#define MAPX_DISPID_DRAWUSERLAYER 0x0a
#define MAPX_DISPID_POLYTOOLUSED 0x0b
// From <olectl.h>
#define DISPID_CLICK (-600)
#define DISPID_DBLCLICK (-601)
#define DISPID_KEYDOWN (-602)
#define DISPID_KEYPRESS (-603)
#define DISPID_KEYUP (-604)
#define DISPID_MOUSEDOWN (-605)
#define DISPID_MOUSEMOVE (-606)
#define DISPID_MOUSEUP (-607)
#define DISPID_ERROREVENT (-608)
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.
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:
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();
}
}
}
See the mapxsampview.cpp file to examine the examples. Below is one of the menu
command handlers for adding data from a file using the miDataSetGlobalHandle type. The
format of the data needs to be: quotes around strings, tabs between fields, and carriage
return/line feed at the end of the record. For example:
"\"NY\"\t105.34\t100\t1\r\n"
"\"MA\"\t245.19\t200\t2\r\n"
"\"NY\"\t195.0\t300\t3\r\n"
"\"AK\"\t195.0\t125\t4\r\n"
"\"CA\"\t56.453\t200\t5\r\n";
Note that this type of data binding (miDataSetGlobalHandle) is only one of several dataset
types that are supported.
void CMapxSampleView::OnMapAdddata()
{
:
:
CFileDialog dlgFile(TRUE, "*.txt", NULL, 0, szDataFilter,
this);
// DataSets.Add()
short Type;
VARIANT SourceData, Name, GeoField,
SecondaryGeoField, BindLayerName, Fields;
CString strName= "TestData";
SetMenuDefaultItem(pMenu->m_hMenu, ID_VIEW_PROPERTIES,
FALSE);
pMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
pt.x, pt.y, this, NULL);
// Destroy the menu.
menu.DestroyMenu();
}
return TRUE;
}
ON_COMMAND(ID_VIEW_PROPERTIES, OnViewProperties)
And the handler:
void CMapxSampleView::OnViewProperties()
{
// easiest way to bring up property page
try {
m_ctrlMapX.PropertyPage();
}
catch (COleDispatchException *e) {
e->ReportError();
e->Delete();
}
catch (COleException *e) {
e->ReportError();
e->Delete();
}
}
Note: It is not recommended that you include the property page in your finished
application. It is a great help when writing and debugging applications, but it is
not intended to be used by the end-user because it provides direct access to too
many properties and is not configurable. Use the stock dialogs (such as
LayersDlg) instead.
Similarly, the Layer Control Dialog:
void CMapxSampleView::OnViewLayercontrol()
{
try {
// mark as optional since we don't have a helpfile
COptionalVariant vHelpFile, vHelpID;
e->ReportError();
e->Delete();
}
}
If there is a general OLE error when trying to call MapX (as could happen if you are using an
out-of-date version of MapX.h or MapX.cpp) MFC throws a COleException. It is
recommended that you catch both exception types when calling MapX.
MapX can also (although rarely) pass errors in the Error event. This only happens if there is
some kind of error during asynchronous processing (like a redraw) that wasn’t directly
called from a MapX property or method.
/////////////////////////////////////////////////////////////
// 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
13 Chapter
To activate one of the standard tools, set the property to one of the ToolConstants. For
example, to change the tool to the Zoom In tool:
Map1.CurrentTool = miZoomInTool
To activate a custom tool, use the ToolNumber value that you specified when you used the
CreateCustomTool method.
Map1.CurrentTool = 99
Nodes can be selected from any selected, editable node object when the map is in "Node
Edit Mode". This includes multiple non-contiguous nodes, from multiple objects, on
multiple layers. By default, MapX is in "Feature Edit Mode". In order to select and edit
node objects, MapX must be set to "Node Edit Mode".
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.
When you create a custom tool, you control which 'type' of tool you create -- in other words,
you choose whether this tool allows the user to click, or click and drag to draw a line, click
and drag to draw a rectangle, etc. You also choose which cursor appears when a custom tool
is in use.
When you create a custom tool for any application there are three generic steps:
1. Create the tool.
2. Write the tool handler (the code for what the tool actually does).
3. Use the tool (put the tool in the user’s hand).
This example creates a custom Ruler tool. The purpose of the Ruler tool is to determine the
distance between two points on the map. First, we declare a constant RULERTOOLID equal
to 500 to represent our custom tool. Then, when we load the main form of the application we
create the tool.
CreateCustomTool has two optional parameters that also take a CursorConstants value.
The CursorConstants specify the cursors that you can use with a custom tool. They define
the cursor shape when your custom tool is the CurrentTool.
ShiftCursor specifies the the cursor shape of the tool when the <SHIFT> key is held down.
CtrlCursor specifies the Cursor shape when the <CTRL> key is held down. These are useful
if you want to give your tool behavior associated with those keys.
To make your custom tool the active tool, set the CurrentTool property. For example, you
could place a button on a Visual Basic form, and when the user clicks the button, you would
set the CurrentTool property.
Constant Behavior
Now that the Ruler custom tool is created, we have to write the code for what the tool
actually does.
The way the custom Ruler tool will operate is: when the user clicks with it on a map
location, the start point for the tool’s distance measurement will be marked. The user holds
the mouse button down and moves the mouse across the map, then stops the mouse at
another location. This will mark the end point of the tool’s distance measurement. The Ruler
tool calculates the distance between the two points. To do this, we need to execute code for
the Ruler tool when the user holds the mouse button down, and when the user moves the
mouse across the map and stops at another spot. To capture the start point when the user
clicks down, we write code in the MouseDown event:
Then
Map1.ConvertCoord X, Y, XDown, YDown, miScreenToMap
End If
End Sub
When the user clicks down on the mouse, the MouseDown event is fired. The code in the
MouseDown event takes the X,Y point where the user clicked, then converts it from screen
coordinates to map 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:
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 theToolUsed event of the Map object to place your code.
Map1.CurrentTool = miZoomInTool
-or-
Map1.CurrentTool = 99
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.
Part Description
Location File specification of the place to put the output. If the keyword
‘CLIPBOARD’ is used, the image is put on the clipboard.
Format Output format. This takes an ExportFormatConstants value.
W Width of output. This is a double value, and specifies width in
terms of Paper Units (Map.PaperUnit). This is an optional
parameter, and if not specified, Map.MapPaperWidth is used.
H Height of output. This is a double value, and specifies height in
terms of Paper Units (Map.PaperUnit). This is an optional
parameter, and if not specified, Map.MapPaperHeight is used.
Format Constants
Format Description
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:
Printing Maps
To print a map, use the PrintMap method.
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.
OBJECT.PrintMap (hDC, x, y, w, h)
Parts Description
➤ MapX Customer
Distributing Your MapX Installation
➤ Installing the MapX OCX
Application
➤ Installing Support for
Spatial Server Access
The MapX product you have purchased from
MapInfo is a developer's kit. It contains the MapX ➤ Installing Raster Format
OCX, sample programs, an on-line help system, Handlers
sample maps and geosets, and various utilities and ➤ Installing Maps and
other support files. This chapter deals with Geosets
distributing your MapX application(s) to your ➤ Adding Keys to the
customers. Please be reminded that you must Windows Registry
purchase a Use License (i.e., seat) as evidenced by a ➤ Passing in the MapX
MapInfo License certificate for each user of each license String
application that you distribute with MapX
➤ Redistributing Your MapX
functionality as described in the MapInfo Standard Application With MrSID
License/Development Environments, which is
included in your product packaging.
Chapter 16: Distributing Your MapX Application
• Use the MapX OCX Installer that is provided on the MapX CD. This is the easiest
method of distribution as it entails very little effort on the part of a MapX developer
because certain procedures and tasks are automated.
• Integrate MapX control at runtime within the application you wish to distribute.
This method of distribution is labor intensive and requires a substantial level of
detail orientation, but provides programmers with the highest degree of control and
customizing capabilities possible.
ChangeDirectory(MapXOcxPath );
LaunchAppAndWait(MapXOcxPath^"setup.exe","",WAIT)
// Done setting up, remove sessage
SdShowMsg (@MSG_OCX_MESSAGE, FALSE);
endif;
Required files:
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 common directory should be: \Program Files\Common
Files\MapInfo Sharred\MapXCommon.
The following table describes what files need to be installed and where they should be
installed to.
Where to Install
Other Special
Files Files
Requirements
Where to Install
Other Special
Files Files
Requirements
Where to Install
Other Special
Files Files
Requirements
Where to Install
Other Special
Files Files
Requirements
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
MapX allows you to bind data to a map layer. Please see, "Putting Your Data on the Map"
for additional information.
Note: All of these dataset drivers should be installed in the same directory as the MapX
OCX, which is usually found in the MapX common directory: \Program
Files\Common Files\MapInfo Shared\MapX Common
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.
MapX can use one of many different libraries to load a raster image. When a raster image is
loaded by MapX, it will search for these DLLs and ask them if the given file can be read by
that DLL. Once one answers yes, MapX knows which DLL will be doing format handling
for the file. The Format handlers will be named "xxxxxxxx.RHx". The base part of the name
is based on the format. The extension always begins with RH, but can end in any letter (A-
Z). When searching for a format handler, MapX starts with RHA, then RHB, and so forth
until RHZ. This allows MapX to prioritize which handlers are used. For example, SPOT
files need to be checked for before any other formats since they are just raw data that can be
confused with other formats. The SPOT handler's extension is RHD. The Halo format
handlers (the standard built in ones) are named RHV. The Lead Tools are named RHX.
The LEADTOOLS Win32 Pro provided by ©LEAD Technologies, Inc and HALO Imaging
libraries provided by Media Cybernetics are included with MapX.You may use either of
these to display most raster files in MapX. LeadTools will load the entire raster image into
memory at the time the image is referenced in MapX. This will mean that the image will
take longer to load, but panning and zooming will be faster. HALO will only load what it
needs to display into memory, so it will load the image faster, but panning and zooming will
be slower. By default, HALO will be attempted first. You may change this order by either
not including the HALO libraries when distributing your application, or by renaming the
LeadTools handler from a .rhx to a .rhu or anything else not used before the letter “x”. There
may also be some formats which are not supported by either library and therefore will have
their own separate library.
Note: All of these raster handlers should be installed in the same directory as the MapX
OCX, which is usually found in the MapX common directory: \Program
Files\Common Files\MapInfo Shared\MapX Common.
If it is determined that you need to use the GeoDictionary, when you register a geoset,
GeoDictionaryManager40.exe adds appropriate entries into the Geodictionary (geodict.dct).
If the Geodictionary does not exist, GeoDictionaryManager40.exe creates one.
This step must be done after all of the Geosets and associated tables are installed on the
user’s machine. Double check your geoset to see what the expected paths are for each table.
For example, if you created a geoset using MapInfo tables on different areas of your hard
drive, the geoset will specify the full path to anything not in the same directory as the
geoset. If redistributing this geoset, the tables will have to be found in the same paths as the
original geoset. To avoid this problem, copy all MapInfo tables into the same directory prior
to creating the geoset. Then create the geoset in that same directory.
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().
MrSID software (specifically the mrsid32.dll) is used under license and is Copyright ©
1995-99, LizardTech, Inc., 1008 Western Ave., Suite 200, Seattle, WA 98104. All rights
reserved. MrSID is protected by U.S. Patent No. 5,710,835. Foreign patents are pending.
Unauthorized use or duplication prohibited.
Patented technology in the Software was developed in part through a project at the Los
Alamos National Laboratory, funded by the U.S. Government and managed by the
University of California. The U.S. Government has reserved rights in the technology,
including a non-exclusive, nontransferable, irrevocable, paid-up license to practice or
have practiced throughout the world, for or on behalf of the United States, inventions
covered by the patent, and has other rights under 35 U.S.C. § 200-212 and applicable
implementing regulations. For further information, contact Lizardtech.
Object Properties
• AffineTransform.A, B, C, D, E, F properties
• AffineTransform.Units property
Object Methods
• AffineTransform.Set method
Remarks
All properties are read-only. To modify the AffineTransform object, use the Set method.
See Also
For an introduction to affine transformations, see"Using Coordinate Systems" .
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:
Syntax
OBJECT.Set UNITS [A, B, C, D, E, F ]
Part Description
Remarks
All arguments are required.
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 messages (text) to a map or to put symbols on a map.
These annotations will scale with the map as you zoom in and out. They are not necessarily
associated with a particular layer of the map and 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, use the Annotation.Graphic property to obtain a
Graphic object, then modify it.
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
See Also
Graphic object
Annotation Object and Annotations Collection
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
Graphic.X property
Graphic.Y property
Syntax
OBJECT.AddText ( Text, X, Y, [Position] )
Part Description
OBJECT Represents a place holder for an Annotations object.
Text String value. Becomes the Caption of the new annotation.
X X coordinate to place the text. This is a double value, and specifies the map
coordinate (longitude).
Y Y coordinate to place the text. This is a double value, and specifies the map
coordinate (latitude).
Position Reference point to add text with respect to the x,y coordinates. This takes a
PositionConstants value.
See Also
Map.DefaultStyle property
Graphic.Caption property
Graphic.Position property
Graphic.X property
Graphic.Y property
See Also
Annotations.Count property
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
OBJECT Represents a place holder for an Annotations object.
Index Index of the annotation to use. This is an Integer, between the values of 1
and AnnotationCount.
See Also
Annotations.Count property
Syntax
OBJECT.RemoveAll
Part Description
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.RefColumn1 property
• BindLayer.RefColumn2 property
• BindLayer.ReferenceLayer property
• BindLayer.ReferenceLayerField property
See Also
Datasets.Add method
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.
BindLayer Object
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
BindLayer.ReferenceLayer property
BindLayer.LayerType property
BindLayer.RefColumn1 property
BindLayer.RefColumn2 property
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
BindLayerTypeConstants
BindLayer.ReferenceLayer property
BindLayer.LayerName property
BindLayer.RefColumn1 property
BindLayer.RefColumn2 property
See Also
BindLayer Object
BindLayerTypeConstants
See Also
BindLayer.LayerType
BindLayerTypeConstants
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).
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
BindLayerTypeConstants
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.
A BitmapSymbol object represents one of the bitmap symbols available on the user's system.
A BitmapSymbols collection represents the set of all bitmap symbols on the user's system.
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.
See Also
Bitmap symbols
BitmapSymbol Object and BitmapSymbols Collection
See Also
Bitmap symbols
Syntax
[ BitmapSymbol= ]OBJECT.Item (index)
Part Description
OBJECT Represents a BitmapSymbols object.
index An integer indicating which BitmapSymbol object to return.
See Also
Bitmap symbols
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 ()
See Also
Bitmap symbols
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 ()
See Also
Bitmap symbols
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.
See Also
Introduction to Using Coordinate Systems
See Also
AffineTransform object
CoordSys Object
Syntax
[ CoordSys= ]OBJECT.Clone ()
See Also
Datum object
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 mapx40.ocx.
Syntax
OBJECT.Set (Type, [Datum], [Units], [OriginLongitude], [OriginLatitude],
Part Description
OBJECT A CoordSys object.
Type A short CoordSysTypeConstants value, such as miRobinson (12).
Datum A Datum object or a supported datum number (such as 62 for the
“NAD 27” datum for the Continental US).
Units A MapUnitConstants value, such a miUnitMeter (7).
OriginLongitude Double values, indicating the standard parallels (in degrees of the
OriginLatitude latitude).
StandardParallelOne Double values, indicating the standard parallels (in degrees of
StandardParallelTwo latitude).
Azimuth Double value, representing the azimuth, in degrees.
ScaleFactor Double value, representing a scale factor.
FalseEasting Double values, representing Falseeasting and FalseNorthing (in
FalseNorthing Units specified by the Units argument).
Range Double value: Degrees of latitude from 1 to 180, indicating the
range (how what range of the earth will be visible).
Bounds A Rectangle object representing the outer bounds of the coordinate
system in Units specified by the Units argument. Required if Type
is miNonEarth; otherwise optional.
AffineTransformation An AffineTransform object; this argument is always optional.
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.
Each Map has a collection of Datasets. The Datasets collection has methods and properties
used to add and remove Dataset objects from the collection. An overview of databinding is
provided below. For an in depth information on see chapter, "Putting your Data on the Map".
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. Types of data sources you can bind to include:
ADO This type of databinding uses the MS Active data objects ADO
recordset.
DAO A daoRecordset object. You can get one from a Visual Basic data
control, an Access form, or by creating one in Visual Basic,
Access, or C++.
Global Handle This type of data binding lets you pass in a block of tab-delimited
data.
Dataset object and Datasets collection
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
ODBC MapX can use ODBC to retrieve data from any ODBC data
source.
RDO This uses MS Remote Data Objects and RDO Resultset object.
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.
For an in depth information on these datatypes, see topic "The Different Types of Data",
located in chapter, "Putting your Data on the Map".
Object Properties
• Dataset.Fields property
• Dataset.GeoField property
• Dataset.Layer property
• Dataset.Name property
• Dataset.ReadOnly property
• Dataset.RowCount property
• Dataset.RowValues property
• Dataset.SecondaryGeoField property
• Dataset.SourceRows property
• Dataset.Themes property
• Dataset.Type property
Object Methods
• Dataset.AddField method
• Dataset.Refresh method
• Dataset.Value method
Collection Properties
• Datasets.BuildSourceRows property
• Datasets.Count property
• Datasets.Item property
Collection Methods
• Datasets.Add 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.
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
Creating Expressions
Remarks
A given Dataset either supports or does not support the Datasets.GetSourceRows 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 collection
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 this data is bound to a layer, RowCount actually returns the number of features in the
layer. Therefore, items in a Dataset can have NULL values if no data was bound to the
feature.
See Also
RowValue object and RowValues collection
Layer.UpdateFeature method
Feature.Update method
Syntax
[ Dataset = ]OBJECT.Restore ( Name, SourceData )
Part Description
OBJECT A Datasets collection.
Name A string parameter. This is the name of the Dataset to restore; it
should be the name of a Dataset that existed when the map was
serialized.
SourceData A variant. This should be the same parameter as when the stored
Dataset was added in the original Datasets.Add. This data source
is then used to restore the contents of the dataset.
See Also
Datasets.Add method
See Also
SourceRow object and SourceRows collection
Feature.FeatureKey property
See Also
Theme object and Themes collection
Syntax
[value =] OBJECT.Value (Row, Column)
Part Description
OBJECT Represents a Dataset object.
Row Row in MapX to obtain value. Variant: can be one of:
*FeatureKey
*FeatureID
*Feature object
NOTE: If you are working with remote tables, you MUST use the
FeatureKey or Feature object. You may NOT use FeatureID.
Column Variant: can be column name or index.
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.FeatureKey property
Feature.Name property
Syntax
OBJECT.Add ( Type, SourceData, [Name], [Geofield], [SecondaryGeofield], [BindLayer],
[Fields], [Dynamic] )
Part Description
Part Description
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.
See Also
Field object and Fields collection
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
Dataset object and Datasets collection
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 Methods
• Datum.Set method
• Datum.SetFromList method
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
Remarks
All properties are read-only. To modify a Datum object, use the Set method or the
SetFromList method.
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
Syntax
OBJECT.Set DatumNumber
Part Description
OBJECT A Datum object.
DatumNumber A short value; must be one of the supported datum numbers (such
as 62 for the “NAD 27” datum for the continental United States).
Each Layer has a collection of selected Feature objects (Layer.Selection). Feature objects
correspond to features (actual entities) in a layer, such as New York or Chicago.
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.CenterX property, CenterYproperty
• Feature.FeatureID property
• Feature.FeatureKey property
• Feature.KeyValue property
• Feature.LabelPoint property
• Feature.Layer property
• Feature.Length property
• Feature.Name property
• Feature.Nodes property
• Feature.Parts property
• Feature.Perimeter property
• Feature.Point 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.Replace method
• Features.RemoveByID method
See Also
Selection Collection
Layer.Search method
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).
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).
Syntax
[= string] OBJECT.Caption
Part Description
OBJECT A Feature object.
string A text string, up to 255 characters long.
See Also
Feature Object
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
Dataset.Value
Dataset.Sourcerows
Features.AddbyID method
Features.RemovebyID method
Selection.SelectByID method
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
Layer object
See Also
Point object
See Also
Layer object
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 this property returns a value based on the "modified" version of the object (the
object as it exists in memory).
See Also
Feature.Perimeter
See Also
LabelProperties.DataField property
Syntax
[ SafeArray= ] OBJECT.Nodes ([CSys])
Part Description
Syntax
OBJECT.Offset (deltaX, deltaY)
Part Description
See Also
Parts object
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
See Also
Point object
See Also
Style object
Remarks
Style object default is '0' for each property of style object.
See Also
FeatureFactory.CreateText
Syntax
OBJECT.AddByID(FeatureKey)
Part Description
See Also
Feature.FeatureKey property
Syntax
OBJECT.Bounds
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in the
collection.
Examples
• Example in Visual Basic
• Example in C++
• Example in Delphi
Syntax
OBJECT.Clone (source)
Part Description
Syntax
OBJECT.Common (source)
Part Description
OBJECT Represents a place holder for a Features collection.
source This represents the set of features to be combined with the collection OBJECT
Syntax
OBJECT.Remove (source)
Part Description
Syntax
OBJECT.RemoveByID (*FeatureKey)
Part Description
OBJECT Represents a place holder for a Features object.
FeatureKey *FeatureKey of the feature to remove from the Features collection. This
is a replacement for FeatureID parameter. FeatureID still works as it
did before, but it is recommended that you use the new FeatureKey
parameter.
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.
Feature Object and Features Collection
Syntax
OBJECT.Replace (source)
Part Description
OBJECT Represents a place holder for a Features object.
source Represents a feature object or features collection, the contents of which
will replace the contents of "feature".
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.CreateEllipticalRegion method
• FeatureFactory.CreateLine 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.
Syntax
[Feature = ] OBJECT.BufferFeatures ( Source, Distance, [Units] , [Resolution] )
Part Description
Part Description
Source A Feature object or a Features collection object. Point, line, text and
region features can be buffered.
Distance The size of the buffer, in units specified by the units argument. If the
distance is positive, the buffer region is larger than the source feature(s).
When buffering a region, you can specify a negative distance, which
produces a buffer region that is smaller than the source region.
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.
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
Syntax
[Feature = ] OBJECT.CombineFeatures( feature1, [ feature2 ] )
Part Description
OBJECT A FeatureFactory object.
feature1 A Feature object or a Features collection object.
feature2 Variant: A Feature object or a Features collection object.
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
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
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.CreateEllipticalRegion method
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.CreateCircularRegion method
Syntax
[Feature = ] OBJECT.CreateLine( [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
OBJECT A FeatureFactory object.
SourceFeature A Feature object, part of which you want to erase; this can be a line
feature or a region feature.
EraserFeature A Feature object, which represents the area that you want to remove
from the SourceFeature. This must be a region feature.
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 featur
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. T
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.
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.
A Fields collection is used to describe or define the columnar structure of a data table and is
passed to Datasets.Add to inform MapX which fields from the source data to include in the
Dataset. If Fields collection is not specified, then all fields from the source data will be
included. A Fields collection can also be passed to the Themes. Add method to specify
which fields from an existing Dataset to base a theme on. If there is not a Fields collection
specified, MapX uses the first numeric field. A Fields collection can also be specified as a
parameter of a LayerInfo object passed as an argument/parameter to the Layers.Add
method when the layer being added is of type miLayerInfoTypeTemp or
miLayerInfoTypeNewTab. In this case, the Fields collection specifies the columnar structure
of the new table being created.
Object Properties
• Field.AggregationFunction property
• Field.Decimals property
• Field.Name property
• Field.Precision property
• Field.Width property
• Field.Type 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 method
• Fields.AddIntegerField method
• Fields.AddLogicalField method
• Fields.AddNumericField method
• Fields.AddSmallIntField method
• Fields.AddStringField method
• Fields.Remove method
• Fields.RemoveAll method
See Also
LayerInfo object
Dataset object
See Also
Fields.Add method
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 Add method can not be used on a Dataset's fields collection once the Dataset has been
created.
See Also
Datasets.Add method
Dataset.Fields property
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)
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)
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)
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)
Part Description
OBJECT This represents the Fields collection.
name This is the name of the the logical field.
Note: This method is specifically intended to be used when a Fields collection is being
passed in a LayerInfo object to Layers.Add.
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)
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.
Field object and Fields collection
Syntax
OBJECT.AddNumericField(name, width)
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
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.
property is eight and takes an integer value which must be >= 0 or MapX will throw an
error.
See Also
FindDataset property
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
OBJECT Represents a Find object.
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
FindMatches
Find object
When False, Find.Search will only return a match if it is within the refining boundary and
return no match otherwise. When True, Find.Search will first return a match within the
refining boundary; if there are none, it will return a match outside the refining boundary.
The default is False.
See Also
Find.RefineLayer property
Find.Search method
For example, there may be multiple BROADWAYs in a street map - one per ZIP code. You can
use the ZIP Code layer to refine. Then when finding, you specify the street AND ZIP Code.
See Also
Find.RefineField property
Find.RefineDataset property
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
OBJECT A Find object.
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”,
“21135”.
If a refine layer has been set, this argument is required;
otherwise it is optional.
See Also
Find object
FindFeature object
Find 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
To obtain the X,Y and/or object ID use the properties, CenterX, CenterY, FeatureID (see,
Feature objects). If an address was found FeatureID will be 0.
**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
The FindMatch object returns a match item returned from the SearchEx method defining close
matches or exact matches. The FindMatches collection is rated in order of score with best
score first.
Object Properties
• FindMatch.FeatureID property
• FindMatch.FeatureKey
• FindMatch.Name property
• FindMatch.Score property
Collection Properties
• FindMatches.Count property
• FindMatches.Item property
See Also
FindResult object
SearchEx method
Syntax
[FindMatch=]OBJECT.Item (index)
Part Description
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
SearchEx method
See Also
FindResult.MatchedFeature property
FindResult.Matches property
FindResult.MultipleMatches property
FindResult Object
See Also
Find.SearchEx method
See Also
Find.SearchEx method
See Also
Find.SearchEx method
The Geoset object is built off the Map object and allows you to define a geoset. A Geoset is a
collection of map layers and their settings. The Geosets collection object is a collection of
Geoset objects.
Object Properties
• Geoset.Centroid property
• Geoset.PathName property
• Geoset.UserName property
Collection Properties
• Geosets.Count property
• Geosets.Item property
See Also
Map object
See Also
Point object
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
See Also
Annotation.Type property
AnnotationTypeConstants
See Also
Annotation.Type property
See Also
Style object
Annotation.Type
See Also
Annotation.Type property
AnnotationTypeConstants
Graphic.Position property
See Also
Annotation.Type property
AnnotationTypeConstants
Graphic.Position property
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
ThemeProperties.IndividualValueCategories property
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
IndividualValueCategory object and IndividualValueCategories collection
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
LabelProperties Object
The LabelProperties object contains properties that control how labels are drawn for the
layer.
Object Properties
• LabelProperties.DataField property
• LabelProperties.Dataset property
• LabelProperties.Duplicate property
• LabelProperties.LabelMax property
• LabelProperties.LabelZoom property
• LabelProperties.LabelZoomMax property
• LabelProperties.LabelZoomMin property
• LabelProperties.LineType property
• LabelProperties.Offset property
• LabelProperties.Overlap property
• LabelProperties.Parallel property
• LabelProperties.PartialSegments property
• LabelProperties.Position property
• LabelProperties.Style property
• LabelProperties.Visible property
See Also
Layer object
See Also
LabelProperties.Dataset property
Field object
See Also
LabelProperties.DataField property
Dataset object
See Also
LabelProperties.LabelZoomMax property
LabelProperties.LabelZoomMin property
See Also
LabelProperties.LabelZoom property
Map.MapUnit property
See Also
LabelProperties.LabelZoom property
Map.MapUnit property
See Also
LabelProperties.Offset property
See Also
LabelProperties.Position property
Remarks
This property allows a label to be automatically displayed even if the centroid of the object
is not in the map view. Also, in order for a label to be displayed automatically, its centroid
must be within the viewable map area.
Each Map has a collection of layers. The Layers collection is made up of Layer objects. The
Layers collection has methods and properties used to add and remove Layer objects from
the collection.
Computer maps are organized into layers. Think of the layers as transparencies that are
stacked on top of one another. Each layer contains different aspects of the entire map. Each
layer contains different map objects, such as regions, points, lines and text.
For example, one layer may contain state boundaries, a second layer may have symbols that
represent capitals, a third layer might consist of text labels. By stacking these layers one on
top of the other, you begin to build a complete map. You can display multiple layers at a
time. Map layers form the building blocks of maps in MapX. Once you have created your
map of layers, you can customize the layers in a variety of ways, add and delete layers, or
reorder them.
You can set the following layer options by using the commands and properties in the Layers
collection and Layer object, and LabelProperties object.
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 ar
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.CoordSys property
• Layer.Datasets 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.ShowNodes property
• Layer.ShowCentroids property
• Layer.ShowLineDirection 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.EndAccess 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.Count property
• Layers.InsertionLayer property
• Layers.Item property
Collection Methods
• Layers.Add method
• Layers.AddGeosetLayers method
• Layers.AddServerLayer method
• Layers.AddUserDrawLayer method
• Layers.ClearSelection method
• Layers.CreateLayer method
• Layers.LayersDlg method
• Layers.Move method
• Layers.Remove method
• Layers.RemoveAll method
See Also
Map Object
Syntax
[feature=]OBJECT.AddFeature (Source, [RowValues])
Part Description
See Also
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
Feature.FeatureKey property
Syntax
[ Features= ]OBJECT.AllFeatures
See Also
Layer.AddFeature method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
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
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
See Also
CoordSys object
Map.DisplayCoordSys
Map.NumericCoordSys
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
Map.Datasets
Syntax
OBJECT.DeleteFeature (FeatureKey)
Part Description
See Also
Layer.AddFeature method
Layer.AllFeatures method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
By default, layers have this property set to False, and the labels are drawn after the topmost
layer, but before any animation layer.
Syntax
OBJECT.DrilldownAddFeatures (Level, FeatureKeys)
Part Description
OBJECT A Layer object that corresponds to a Drilldown layer.
Level String, indicating which level in the Drilldown layer contains the
features that are to be added.
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 ar
removing are not deleted from the table; by "removing" them, you simply make them
disappear.
Syntax
OBJECT.DrilldownReset (Level)
Part Description
OBJECT A Layer object that corresponds to a Drilldown layer.
Level String, indicating which level of detail should appear in the
Drilldown layer. If the string is empty, the layer will be cleared (all
objects will be removed from the Drilldown layer).
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
BeginAccess method
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
Syntax
[Feature=]OBJECT.GetDrilldownFeaturesByID( strLevel, FeatureID)
Part Description
Syntax
[Feature=]OBJECT.GetFeatureByID( FeatureKey )
Part Description
Syntax
[Feature=]OBJECT.GetFeatureByKey (FeatureKey)
Part Description
See Also
Feature.FeatureKey property
Syntax
OBJECT.Invalidate ([InvalidRect])
Parts Description
See Also
Layer.AddFeature method
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
Syntax
OBJECT.LabelAtPoint (x, y)
Part Description
See Also
LabelProperties object
Layer.AutoLabel property
Syntax
OBJECT.NoFeatures()
See Also
Layer.AddFeature method
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
See Also
Layer.Style property
Remarks
If the layer has an equal number of features of more than one type (eg 2 symbols and 2
regions) then predominantFeatureType uses this order of precidence to determine what to
return.
• symbol
• line
• region
• misc
Syntax
OBJECT.Refresh
See Also
LayerInfo object
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.
See Also
Creating Expressions
IDispatch Table
Geographic Operators
• Regions - if the point is within the region, the region is in the resulting collection.
• Lines and Symbols - The closest point(s) or line(s) (can be multiple if many points
have same coordinates) within a 3 pixels area around the given point are added to
the resulting collection.
Syntax
OBJECT.SearchAtPoint (Point)
Part Description
See Also
Layer.AddFeature method
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
Syntax
OBJECT.SearchWithinDistance(Source, double Distance, short Units, short SearchType)
Part Description
OBJECT Represents a layer object.
Source A Point object or a Feature object, representing the origin of the
search.
Distance The distance to search, in the map units specified by the Units
parameter.
Units A MapUnitConstants value, such as miUnitMile (0), that
identifies the unit of measure for the Distance argument.
SearchType A SearchTypeConstants value; controls the search criteria that are
used to determine whether a feature is ”within” the search area.
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.UpdateFeature method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.SearchWithinFeature method
Layer.SearchWithinRectangle
Layer.SearchAtPoint method
Layer.AllFeatures method
Layer.NoFeatures method
Syntax
OBJECT.SearchWithinFeature (Feature, SearchType)
Part Description
See Also
Selection.SelectByRegion method
Layer.AddFeature method
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinRectangle method
Layer.UpdateFeature method
Syntax
OBJECT.SearchWithinRectangle (Rectangle, SearchType)
Part Description
See Also
Layer.AddFeature method
Layer.AllFeatures method
Layer.DeleteFeature method
Layer.Invalidate method
Layer.NoFeatures method
Layer.SearchAtPoint method
Layer.SearchWithinDistance method
Layer.SearchWithinFeature method
Layer.UpdateFeature method
See Also
Selection collection
See Also
Layer.OverrideStyle property
• miLayerTypeNormal = 0
• miLayerTypeRaster = 2
• miLayerTypeSeamless = 4
• miLayerTypeUnknown = 5
• miLayerTypeUserDraw = 6
Syntax
OBJECT.UpdateFeature (FeatureKey, [Source], [RowValues])
Part Description
Remarks
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.
See Also
RowValue object and RowValues collection
Feature object
See Also
Layer.ZoomMin property
Layer.ZoomMax property
See Also
Layer.ZoomLayer property
Map.MapUnit property
See Also
Layer.ZoomLayer property
Map.MapUnit property
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:
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
OBJECT Represents a Layers object.
GeosetName Geoset 'friendly' name or full file specification.
See Also
Map.Geoset property
Part Description
The following table summarizes the effect of the Options parameter. The constants can be
bitwise "or-ed" together to combine options.
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.
Layer Object and Layers Collection
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.AddUserDrawLaye , 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
LayerInfo object
Syntax
OBJECT.AddUserDrawLayer (Name, Position)
Part Description
OBJECT Represents a Layers object.
Name Name of layer to create.
Position Where to add the layer in the layer list.
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.AddServerLaye , 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.
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
See Also
Selection.ClearSelection
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
OBJECT A Layers collection.
HelpFile Variant: The file name of a Windows Help file. (optional)
HelpID Variant: The ID number of a topic in the Help file. (optional)
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.
See Also
Layers collection
Syntax
OBJECT.Remove (Index)
Part Description
OBJECT Represents a Layer object.
Index Either an Integer index value (starting at 1), or the name of the layer to
remove.
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.
Layer Object and Layers Collection
If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
Syntax
Layers.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.
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.AddUserDrawLaye , 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.
miLayerInfoTypeNewTab is a layer that can be generated from external data (i.e. query
results).
Object Properties
• LayerInfo.Type property
Object Methods
• LayerInfo.AddParameter method
See Also
Layers.Add method
See Also
LayerInfo.AddParameter method
Layers.Add method
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
LayerInfo 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
Legend Object
See Also
Style object
See Also
Map.PreferCompactLegends property
See Also
Style object
Syntax
OBJECT.ExportLegend (Destination, Format)
Part Description
OBJECT Represents a Legend object.
Destination File specification of where to put the output, such as
”C:\Temp\Legend.bmp”. If you specify ”CLIPBOARD” instead of a file
path, the image is put on the clipboard.
Format Output format. This takes an ExportFormatConstants value. Note: If you
specify miFormatGIF (to generate GIF files), please read the Licensing
Requirements for Users of GIF Files. If you direct output to
CLIPBOARD, the format must be metafile or bitmap.
See Also
Map.ExportMap
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 andTop 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
OBJECT Represents a Legend object.
HelpFile HelpFile is an optional parameter that is a pathname to a .hlp file that
contains help topics for the dialog.
HelpID HelpID is an optional parameter that refers to the ID of a specific help
topic within the given .hlp file.
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
See Also
Map.PaperUnit property
See Also
Map.PaperUnit property
Syntax
OBJECT.PrintLegend (hDC, x, y, w, h)
Part Description
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
See Also
Style object
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.
Purpose
Each Theme has a collection of LegendText objects called LegendTexts. Each object (each
line under the title) of a legend has a LegendText object in this collection which may be
manipulated individually.
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
See Also
Theme object
Theme.AutoRecompute property
See Also
Theme.AutoRecompute
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.InfotipSupport property
• Map.InfotipPopupDelay property
• Map.Layers property
• Map.MapUnit property
• Map.MapPaperHeight property
• Map.MapPaperWidth property
• Map.MapScreenHeight property
• Map.MapScreenWidth property
• Map.MatchNumericFields property
• Map.MatchThreshold property
• Map.MaxSearchTime property
• Map.MouseIcon property
• Map.MousePointer property
• Map.MouseWheelSupport property
• Map.NumericCoordSys property
• Map.PanAnimationLayerproperty
• Map.PaperUnit property
• Map.PreferCompactLegends property
• Map.RedrawInterval property
• Map.Refresh method
• Map.Rotation property
• Map.SearchPath property
• Map.SelectionStyle property
• Map.SetSize method
• 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.ConvertCoordV method
• Map.CreateCustomTool method
• Map.Distance method
• Map.ExportMap method
• Map.IsPointVisible method
• Map.Pan method
• Map.PrintMap method
• Map.PropertyPage method
• Map.SaveMapAsGeoset method
• Map.ZoomTo method
See Also
Dataset objects
Layer object
Annotations objects
Syntax
OBJECT.AboutBox
See Also
Annotation object and Annotations collection
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
See Also
Rectangle object
Remarks
The CenterX property is set when a new Geoset is loaded.
See Also
Map.CenterY property
Map.ZoomTo method
Remarks
The CenterY property is set when a new Geoset is loaded.
See Also
Map.CenterX property
Map.ZoomTo method
Syntax
[ Boolean= ]OBJECT.ClipLine (X1, Y1, X2, Y2)
Part Description
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
Layers.AddUserDrawLayer method
DrawUserLayer event
Map.NumericCoordSys property
Syntax
[ Boolean= ] OBJECT.ClipLineV(X1, Y1, X2, Y2)
Part Description
OBJECT Represents a Map object.
X1 Variant (by Reference). On input: Longitude coordinate of the first
endpoint of the unclipped line. On output: longitude coordinate of the
first endpoint of the clipped line.
Y1 Variant (by Reference). On input: Latitude coordinate of the first
endpoint of the unclipped line. On output: latitude coordinate of the first
endpoint of the clipped line.
X2 Variant (by Reference). On input: Longitude coordinate of the second
endpoint of the unclipped line. On output: longitude coordinate of the
second endpoint of the clipped line.
Y2 Variant (by Reference). On input: Latitude coordinate of the second
endpoint of the unclipped line. On output: Latitude coordinate of the
second endpoint of the clipped line.
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.NumericCoordSys method
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.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
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
ToolUsed Event
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
ToolUsed Event
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,
Map.DatasetGeoField property
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.Dataset property
Datasets.Add method
See Also
Dataset object and collection
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.
See Also
Themes.Add method
Map.Dataset property
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.
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.CreateArc method
FeatureFactory.CreateCircularRegion method
FeatureFactory.CreateEllipticalRegion method
Layer.SearchWithinDistance method
See Also
Style object
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
Introduction to Using Coordinate Systems
CoordSys object
Map.NumericCoordSys
Syntax
[ distance = ]OBJECT.Distance( x1,y1,x2,y2 )
Part Description
Remarks
The distance is calculated using the Great Circle Calculation.
See Also
CoordSys object
Map.NumericCoordSys
Map.MapUnit property
BMP
Syntax
OBJECT.ExportMap (Location, Format, [Width], [Height])
Part Description
OBJECT Represents a Map object.
Location File specification of place to put the output. If the keyword
'CLIPBOARD' is used, the image is put on the clipboard.
Format Output format. This takes an ExportFormatConstants value.
Width Width of output. This is a double value, and specifies width in terms
of Paper Units (Map.PaperUnit). This is an optional parameter, and if
not specified, Map.MapPaperWidth is used.
Height Height of output. This is a double value, and specifies height in terms
of Paper Units (Map.PaperUnit). This is an optional parameter, and if
not specified, Map.MapPaperHeight is used.
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.PaperUnit property
To control the style in which the selection highlighting is drawn, set the Map.SelectionStyle
property.
See Also
Node Selecting and Editing
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
Remarks
When a map control is created, MapX will query the registry key:
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX\4.0\<Value of GeoDictonary
Property>
• 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:
• Could contain a 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.
• Could contain just a 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.
• Could be empt . 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\4.0\GeoDictionary.
See Also
Map.GeoSet property
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 collection
This property is useful when you need to set the zoom to the extents of the map.
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.CreateCustomTool method
See Also
Map.InfotipSupport property
Syntax
[ bool= ] OBJECT.IsPointVisible (X, Y )
Part Description
See Also
Layer object and Layers collection
If you specify a date or numeric GeoField in Datasets.Add, MapX will use it whether or not
MatchNumericFields is TRUE.
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
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
Introduction to Using Coordinate Systems
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
OBJECT Represents a Map object.
hDC Printer device context. Can be any device context.
x Upper left corner X in HIMETRIC units.
y Upper left corner Y in HIMETRIC units.
w Width in HIMETRIC units.
Map object
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
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
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, those layers are left out of the new geoset file and
an exception is thrown (after the geoset has been otherwise completely saved) to indicate
such. This method also throws an exception if there are no layers in the map.
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.
Map object
Use the Title object to control the title's text, display style, and position. Tip: If you want to
set the title's text, and you do not care about its style or position, you can set the
Map.TitleText property at design time.
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
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.
Map object
A pie or 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, or one object for each wedge in the pie chart.
Object Properties
• MultivarCategory.Style property
Collection Properties
• MultivarCategories.Count property
• MultivarCategories.Item property
See Also
ThemeProperties.MultivarCategories property
See Also
Style 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.
Object Properties
• NotesQueryInfo.BeginDate property
• NotesQueryInfo.Database property
• NotesQueryInfo.DefaultNumericValue
• NotesQueryInfo.DefaultStringValue property
• NotesQueryInfo.EndDate property
• NotesQueryInfo.FullTextSearch property
• NotesQueryInfo.MaxNumDocs property
• NotesQueryInfo.Query property
• NotesQueryInfo.Server property
See Also
Datasets.Add
See Also
NotesQueryInfo.Query property
See Also
NotesQueryInfo.FullTextSearch property
See Also
NotesQueryInfo.Database property
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
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.
Object Properties
• ODBCQueryInfo.ConnectString property
• ODBCQueryInfo.DataSource property
• ODBCQueryInfo.SqlQuery property
See Also
Datasets.Add method
"DLG=" controls the display of the connection dialog box: DLG=0 means never put up a
dialog, DLG=1 means always put one up, DLG=2 displays the connection dialog, but only if
needed (i.e., if not all required information was provided).
A Parts object is a collection of Points collection objects. It 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 collection)
• Parts.Item property (Parts collection)
Collection Methods
• Parts.Add method (Parts collection)
• Parts.Remove method (Parts collection)
• Parts.RemoveAll method (Parts collection)
Syntax
OBJECT.Add(Points)
Syntax
OBJECT.Remove (index)
Syntax
OBJECT.RemoveAll
The Point object represents an XY coordinate pair. When a Point belongs to a Feature, the X
coordinate represents longitude, and the Y coordinate represents latitude.
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.Remove method
• Points.RemoveAll method
Syntax
OBJECT.Offset(double deltaX, double deltaY)
Part Description
See Also
Map.Numeric CoordSys
Syntax
OBJECT.Set(double X, double Y)
Part Description
See Also
Map.NumericCoordSys
See Also
Map.NumericCoordSys
Syntax
[ Point= ]OBJECT.Add(Point, [Position])
Part Description
Syntax
[ Point= ]OBJECT.AddXY (x, y, [Position])
Part Description
OBJECT Represents a Points object.
x Double numeric CoordSys.
y Double numeric CoordSys.
Position An integer between 1 and Points.Count, specifying the position in the
collection where the point should be added. If it is not specified or
invalid, the point will be appended to the end of the collection.
Point Object and Points Collection
Syntax
OBJECT.Remove (index)
Syntax
OBJECT.RemoveAll
A Ranged thematic map's settings are exposed through the RangeCategories collection, which
is a collection of RangeCategory objects, one object for each range, sorted in ascending order.
Each object in the collection describes one range (its display style, its minimum and maximum
values, etc).
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
See Also
ThemeProperties.DistMethod
Themes.Add
Theme.AutoRecompute
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 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
OBJECT Represents a Rectangle object.
deltaX Double value, representing the amount to shift the rectangle in the X
direction.
deltaY Double value, representing the amount to shift the rectangle in the Y
direction.
Syntax
OBJECT.Set (x1, y1, x2, y2)
Part Description
Object Properties
• ResolveObject.TableName property
• ResolveObject.SourceMatch property
• ResolveObject.TableMatch property
Collection Properties
• ResolveObjects.Count property
• ResolveObjects.Item property
See Also
ResolveDataBindEx event
The RowValue object represents a single value for a field in a Dataset. A collection of
RowValue objects is returned by Dataset.RowValues.
RowValues collection is a group of createable RowValue objects. The RowValues collection
can be passed to Layer.UpdateFeature, Layer.AddFeature, and Feature.Update to specify
data values for fields in Datasets that are bound to the layer being updated.
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.AddFeature method
Feature.Update method
Dataset.RowValues property
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
Syntax
[ RowValues= ]OBJECT.Clone
Part Description
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 object 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.
Collection 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
Feature object
Syntax
OBJECT.Add (Source)
Part Description
See Also
Feature object and collection
FindFeature Object
Syntax
OBJECT.ClearSelection
Part Description
Syntax
OBJECT.Clone
Part Description
Syntax
OBJECT.Common (Source)
Part Description
OBJECT Represents a Selection collection.
Source This is the Feature object , FindFeature object, or Features
collection you will combine with an OBJECT.
Syntax
OBJECT.Remove (Source)
Part Description
OBJECT Represents a Selection collection.
Source This is the Feature object , FindFeature object, or Features
collection you remove from OBJECT.
Syntax
OBJECT.Replace (Source)
Part Description
Syntax
Map.Selection.SelectAll SelectionTypeConstant
See Also
SelectionTypeConstant
Syntax
OBJECT.SelectByID (*FeatureID, Flag)
Part Description
Syntax
OBJECT.SelectByPoint (X, Y,Flag)
Part Description
OBJECT Represents a Selection collection.
X X coordinate of the point to select at. double value (Longitude).
Y Y coordinate of the point to select at. double value (Latitude).
Flag This controls whether this selected feature is added to, removed
from, or replaces the current selection. This takes a
SelectionTypeConstants value.
Remarks
If you are selecting regions, the 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.
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
Remarks
A feature is considered to be "within" the rectangle if and only if its centroid is within the
radius. If more control over selection criteria is needed, you may want to use the Layer
object's SearchWithinRectangle method.
See Also
Layer.SearchWithinRectangle method
Syntax
OBJECT.SelectByRegion (Layer, *FeatureKey, Flag)
Part Description
Part Description
Layer Layer that the region to select within resides. This takes a Layer object.
FeatureKey *FeatureKey (a string) of the region to select within. This is a
replacement for FeatureID parameter. FeatureID still works as it did
before, but it is recommended that you use the new FeatureKey
parameter. 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.
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 "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
Layer.SearchWithinFeature method
The Dataset.SourceRows property is used to get a collection of rows (as SourceRow objects)
from the original data source that were aggregated together for a row in the MapX Dataset.
Use this object to identify which row or rows in the original source data are represented by a
row in the MapX Dataset. This is particularly useful when working with Selections and
Feature objects.
Object Properties
• SourceRow.Row property
Collection Properties
• SourceRows.Count property
• SourceRows.Item property
The row numbers start at 1 and are sequential in the order that the data was read from the
original source data. This is a default property of the SourceRow object.
Syntax
[ SourceRow= ]OBJECT.Item (index)
Part Description
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.
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.RegionBackColor property
• Style.RegionBorderColor property
• Style.RegionBorderStyle property
• Style.RegionBorderWidth property (Style object)
• 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.MinVectorSymbolCharacter property
• Style.MaxVectorSymbolCharacter 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.TextFontShadow property
• Style.TextFontRotation property
• Style.SymbolType 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
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
OBJECT Represents a Style object.
HDC The HDC into which the sample is drawn.
Rectangle A MapXLib.Rectangle that defines the pixel coordinates in the DC that
the sample will be draw into. If the sample does not need the entire
rectangle to display, the sample will be centered in the rectangle.
SampleText The text that the function will use to draw the TextStyle sample.
Syntax
OBJECT.ExportLineSample (Destination, Format, Width, Height, [BackColor])
Part Description
OBJECT Represents a Style object
Destination File specification of where to put the output, such as
"C:\Temp\Symbol.bmp". If you specify "CLIPBOARD" instead of a
file path, the image is put on the clipboard.
Format Output format. This takes an ExportFormatConstants value. Note: If
you specify miFormatGIF (to generate GIF files), please read the
Licensing Requirements for Users of GIF Files.
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.
Part Description
Syntax
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
OBJECT Represents a Style object
Location File specification of where to put the output, such as
"C:\Temp\Symbol.bmp". If you specify "CLIPBOARD" instead of a
file path, the image is put on the clipboard.
Format Output format. This takes an ExportFormatConstants value. Note: If
you specify miFormatGIF (to generate GIF files), please read the
Licensing Requirements for Users of GIF Files.
Width Width of text output. This is a double value, and specifies width in
terms of pixels.
Height Height of text output. This is a double value, and specifies height in
terms of pixels.
SampleText String. The sample text to export.
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.)
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
See Also
Style.LineWidth
Syntax
OBJECT.PickLine
Syntax
OBJECT.PickRegion
Syntax
OBJECT.PickSymbol
Syntax
OBJECT.PickText
See Also
FillPatternConstants
See Also
Style.RegionBorderWidth
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
Bitmap Symbols
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.
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
Bitmap Symbols
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
Bitmap Symbols
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
Bitmap Symbols
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.
See Also
Bitmap Symbols
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
Bitmap Symbols
See Also
Style.SymbolFont
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
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
See Also
OLE_Color Values
Remarks
To use a TrueType font symbol, set this to miSymbolTypeTrueTypeFont.
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
Bitmap Symbols
Each Dataset has a collection of Themes (Dataset.Themes). The Theme collection has methods
and properties used to add and remove Theme objects from the collection.
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.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
Theme Object and Themes Collection
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
Theme.DataMin
See Also
Theme.ComputeTheme
Theme.DataMax
See Also
Legend object
Remarks
The Name property can be used with the Themes.Item property and the Themes.Remove
method.
See Also
Themes.Add method
Themes.Item property
Themes.Remove method
See Also
Theme.ThemeProperties
ThemeProperties object
Syntax
[Boolean=]OBJECT.ThemeDlg ([HelpFile], [HelpID])
Part Description
OBJECT Represents a Theme object.
HelpFile HelpFile is an optional parameter that is a pathname to a .hlp
file that contains help topics for the dialog.
HelpID HelpID is an optional parameter that refers to the ID of a specific
help topic within the given .hlp file.
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
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
Theme.DataMax property
Theme.DataMin property
Theme.Name property
Theme.Type property
Syntax
OBJECT.Item (index)
Part Description
See Also
Theme.Name property
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
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
See Also
ThemeProperties.Size property
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.
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
RangeCategories collection
See Also
ThemeProperties.PieGraduated
See Also
ThemeProperties.BarIndependentScale property
See Also
IndividualValueCategories collection
See Also
MultivarCategories collection
See Also
RangeCategories collection
See Also
Map.PaperUnit property
ThemeProperties.DataValue property
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
Style object
ThemeProperties.DataValue property
See Also
Map.PaperUnit property
ThemeProperties Object
See Also
ThemeProperties.PieStartAngle property
See Also
ThemeProperties.PieClockwise property
See Also
ThemeProperties.BarGraduatedStack property
See Also
ThemeProperties.BarStacked property
ThemeProperties.GraduateSizeBy property
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. This property replaces
ThemeProperties.Independent.
See Also
Map.PaperUnit property
See Also
Style object
ThemeProperties.BorderStyle property
See Also
Style object
ThemeProperties.BarFrameStyle property
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.NegativeSymbolStyle property
See Also
Style object
ThemeProperties.ShowNegativeValues property
ThemeProperties.NegativeSymbolStyle property
ThemeProperties.DataValue property
See Also
Style object
ThemeProperties.ShowNegativeValues property
ThemeProperties.PositiveSymbolStyle property
ThemeProperties.DataValue property
See Also
ThemeProperties.PieGraduated property
ThemeProperties.BarGraduatedStack property
See Also
ThemeProperties.RoundBy property
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
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.InflectionColor property
ThemeProperties.RangeCategories property
Remarks
This property only applies if ThemeProperties.InflectRanges is True. The default is 2 (the
second range).
See Also
ThemeProperties.InflectRanges property
ThemeProperties.InflectionColor property
See Also
ThemeProperties.InflectRanges property
See Also
ThemeProperties.SpreadBy property
See Also
ThemeProperties.RangeCategories property
RangeCategories collection
ThemeProperties.IndividualValueCategories property
IndividualValueCategories collection
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
MapX supports variable substitution in expressions. The Variable object and Variables
collection are key components in MapX’s ability to mix attribute and geographic criteria in
expressions. That is, an expression can contain a reference to any variable name in a MapX
application by passing a Variables Collection (i.e. a set of Variable objects) to the
Layer.Search method as an optional parameter.
Object Properties
• Variable.Name property
• Variable.Value property
Collection Properties
• Variables.Count property
Collection Methods
• Variable.Add method
• Variables.Clone method
• Variables.Item 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 theVariables 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.
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
Part Description
OBJECT This represents a Variable object.
Name This is a string value for the name of the variable to add.
Value Variant: This is the value of the variable that is being added. (see
"Remarks")
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
Syntax
[ Variable object= ]OBJECT.Clone
Part Description
OBJECT This represents a Variables collection.
Syntax
[ Variable object= ]OBJECT.Item(Index)
Part Description
OBJECT This represents a Variables collection.
Index Variant: This specifies which item to return from the Variables
collection. It can be a 1-based index number or a variable name.
Syntax
OBJECT.Remove(Index)
Part Description
OBJECT This represents a Variables collection.
Index Variant: This specifies which item to remove from the Variables
collection. It can be a 1-based index number or a variable name.
Syntax
[ Variable object= ]OBJECT.Clone
Part Description
OBJECT This represents a Variables collection.
Stock events
MapX supports the following stock events:
Custom Events
MapX supports the following custom events:
Dispatch ID = 16
Syntax
AddFeatureToolUsed(ToolNum, Flags, Feature, Shift, Ctrl, EnableDefault)
Part Description
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
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
Note: The event is only fired for changes brought about by user interaction (like
selecting the annotation, moving the annotation, resizing it, etc.), NOT through
programmatic changes in the annotations. For example, this will not fire the
AnnotationChanged event: annotation.X = 100. Even though it is moving the
annotation.
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) coordinate .
Remarks
You can also add a UserDrawLayer via Layers.Add.
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.
EnableDefault Boolean. This parameter controls whether MapX allows the
mousewheel's standard behavior to take effect. Default value is
True. If the programmer sets EnableDefault to FALSE, MapX
will not do anything in response to the MouseWheel.
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
Part Description
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
Syntax
ToolUsed(ToolNum, x1, y1, x2, y2, distance, shift, control, *EnableDefault)
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.
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. For C++ similar information on
programmers, see Working With Visual C++..
Error Description
Error Description
Error Description
1049 Invalid Row Parameter: Row out of range, or fetch past end of table.
1050 Invalid Column Parameter.
1051 Unable to find or load MIODBC.DLL
1052 Error initializing MIODBC.DLL Check DLL version.
1053 MIODBC.DLL called with an invalid handle.
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.
Error Description
Error Description
Error Description
Error Description
Error Description
Error Description
Error Description
Error Description
1260 Not enough ranges to use inflection. There must be at least three ranges to use
inflection.
1261 An invalid apply attribute was specified.
1262 Cannot apply size attributes on a layer which predominantly contains
bounded objects or text objects.
1263 Cannot spread by size on a layer which predominantly contains bounded
objects or text objects.
1264 Cannot spread by color when applying size attributes.
1265 Cannot spread by size when applying color attributes.
1266 Cannot apply size attributes on an individual value theme.
1267 Invalid label max value specified. Label max values must be between 0 and
32767.
1268 Attempt to set the Insertion Layer to an object which is not a valid layer object.
1269 Invalid RowValue object specified.
1270 Invalid RowValue object specified.
1271 Invalid UpdateFeature parameter specified.
1272 Error occurred while setting the current tool to a standard tool.
1273 The insertion layer is not set. The insertion layer must be set before the object
creation tools can be used.
1274 Error occurred while setting the current tool to a custom tool.
1275 Error occurred while creating a standard tool.
1276 Error occurred while creating a custom tool.
1277 Cannot create a theme automatically on Seamless table.
1278 Invalid Key Specified.
1279 The layer that was specified is read-only. A read-only layer cannot be editable.
1280 The layer that was specified is not editable. The insertion layer can only be set
to a layer that is editable.
1281 The layer specified does not contain any area objects. Centroids can only be
shown for layers that contain bounded area objects.
1282 The layer specified does not contain any line objects. Line direction can only
be shown for layers that contain line objects.
Error Description
1283 The layer specified does not contain any point objects or area objects. Nodes
can only be shown for layers that contain point objects 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.
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
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 = 0x8000001
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
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
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
miDataSetOEO = 10
miDataSetDelphi = 1010
miDataSetDelphi4 = 1011
miDatasetDelphi5 = 1012
miDataSetADO = 12
miDataSetRDO = 13
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
FieldTypeConstants
miTypeString = 0
miTypeNumeric = 1
miTypeDate = 2
miTypeInt = 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
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
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
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
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
Creating Expressions
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".
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.
When specifying dates as string constants, the following applies:
Contents
• Operators
• Functions
Operators
Operators:
• Geographic operators
• Mathematical operators
• String operators 903
• 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).
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:
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>”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>=”10–9–91”
Example
Records for all received before August, no matter what year.
• Month(RECEIVED)<8
Logical Compariso
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 ar
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” 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.
Date Clauses
Example
Records for all received in August 1990
Example
Records for all received in July or September of 1989
Keywords
MapX supports the use of keywords "like" and “between”.
Example
To determine if a string starts with "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.
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.
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
obj_expr An object expression.
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.).
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
num_expr An Integer value from 0 to 255 (or, if a double-byte character set
is in use, from 0 to 65,535), inclusive
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.
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( ) functio
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
numeric_string a string that represents a numeric value, such as "12,345,678"
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
x1 and x2 x-coordinates (e.g. longitude)
y1 and y2 y-coordinates (e.g. latitude)
unit_name A string representing the name of a distance unit (e.g. "km")
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 the Set Distance Units statement 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.
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
num_expr A numeric expression
Remarks
The Exp( ) function raises the mathematical value e to the power represented by num_expr
has a value of approximately 2.7182818.
Fix( ) functio
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$( ) functio
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( ) functio
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$( ) functio
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( ) functio
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
string_expr A string expression
position A numeric expression, indicating a starting position in the
string
length A numeric expression, indicating the number of characters to
extract
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
expr An object expression
unit_name A string representing the name of a distance unit (e.g. "mi" for
miles)
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( ) functio
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
num_expr A numeric expression.
round_to The number to which num_expr should be rounded off
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( ) functio
Purpose
This returns the sine 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= ]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$( ) functio
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 )
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:
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 )
datestring is a String expression representing a date, such as "10/17/96"
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
num_expr A numeric expression
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")
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.)
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
date_expr A date expression
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( ) functio
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.
Geoset Keys
Geosets are files (ending in .GST) that contain information about a set of layers, and can b
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\
NAME 'Friendly' name of geoset
PROJECTION Projection clause
CENTER Number, Number – Long/Lat of the center of the map
\MBR\LOWERLEFT Number,Number - Long/Lat of lower left corner
\MBR\UPPERRIGHT Number,Number - Long/Lat of upper right corner
ZOOMLEVEL Number - Zoom level of the map
AUTOLAYER TRUE or FALSE (1 or 0) - order layers automatically
MAPUNIT Number - corresponds to Map.MapUnit. Whenever the
geoset is loaded into the map control, if there are no
layers already loaded, the MapUnit will be set to the
geoset's MapUnit. However,if there are layers already
loaded, MapX will load the geoset and use the current
map unit.
ROTATION Number - Rotation angle of the map. Corresponds to
Map.Rotation
\TABLE\<number>\
\TABLE\<number>\
DISPLAY\BRUSH\
PATTERN Number – corresponds to Style.RegionPattern
FORECOLOR Number – corresponds to Style.RegionColor
BACKCOLOR Number – corresponds to Style.RegionBackColor
TRANSPARENT TRUE or FALSE – corresponds to
Style.RegionTransparent
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)
DISPLAY\FONT\
DISPLAY\SYMBOL\
TYPE Number – Corresponds to Style.SymbolType
CODE Number – Corresponds to Style.SymbolCharacter
COLOR Number – Corresponds to Style.SymbolFontColor
POINTSIZE Number – size of symbol in points
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\
OLE_COLOR Values
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:
See Also
ColorConstants
IDispatch Table
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
Method/Property IDispatch
BindLayer.ReferenceLayer 5
BindLayer.ReferenceLayerField 9
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
Method/Property IDispatch
DataSet.ReadOnly 12
DataSet.Refresh 8
DataSet.RowCount 2
DataSet.RowValues 13
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
Method/Property IDispatch
Datum.ShiftY 3
Datum.ShiftZ 4
Feature.Area 10
Feature.Attach 20
Feature.Bounds 7
Feature.Caption 8
Feature.CenterX 4
Feature.CenterY 5
Feature.Clone 21
Feature.FeatureID 1
Feature.FeatureKey 23
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
Method/Property IDispatch
FeatureFactory.CreateEllipticalRegion 10
FeatureFactory.CreateLine 7
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
Method/Property IDispatch
Find.ClosestAddr 3
Find.FindDataSet 7
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
Method/Property IDispatch
FindMatch.FeatureID 1
FindMatch.FeatureKey 4
FindMatch.Name 2
FindMatch.Score 3
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
Method/Property IDispatch
IndividualValueCategory.Style 1
IndividualValueCategory.Value 3
LabelProperties.DataField 13
LabelProperties.DataSet 9
LabelProperties.Duplicate 10
LabelProperties.LabelMax 12
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
Method/Property IDispatch
Layer.DrilldownReset 34
Layer.Editable 46
Layer.EndAccess 42
Layer.FeatureIDFromFeatureName 38
Layer.FeatureKeyFromFeatureName 48
Layer.FileSpec 4
Layer.Find 14
Layer.GetDrilldownFeaturesByID 33
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
Method/Property IDispatch
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
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
Method/Property IDispatch
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
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
Method/Property IDispatch
Map.CenterX 8
Map.CenterY 9
Map.ClipLine 44
Map.ClipLineV 45
Map.ConvertCoord 34
Map.ConvertCoord 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
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
Method/Property IDispatch
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
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
Method/Property IDispatch
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
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
Method/Property IDispatch
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
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
Method/Property IDispatch
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
Selection.SelectByRectangle 5
Selection.SelectByRegion 1
SourceRow.Row 1
SourceRows.Count 1
SourceRows.Item 2
Style.Clone 41
Style.DrawLineSample 32
Method/Property IDispatch
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
Style.RegionBorderWidthUnit 46
Style.RegionColor 5
Style.RegionPattern 6
Style.RegionTransparent 43
Style.SupportsBitmapSymbols 39
Method/Property IDispatch
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
Theme.ComputeTheme 13
Theme.DataMax 12
Theme.DataMin 11
Method/Property IDispatch
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
ThemeProperties.InflectionColor 37
Method/Property IDispatch
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
Method/Property IDispatch
Title.X 4
Title.Y 5
In addition to the MapX software, the MapX installer installs data products (maps and
demographic data) on your computer, so you can get started exploring the capabilities of
MapX.
Note: Use of data products is subject to the MapInfo Standard License Agreement -
Software & Data.
By default, maps and geosets are installed in the directory:
• C:\Program Files\MapInfo\MapX 4.0\Maps
Demographic data, in the form of a Microsoft Access table (MAPSTATS.MDB), is installed in
the directory:
Use the MapX GeoDictionary Manager to register information about the MapInfo tables that
can be matched by MapX during automatic databinding. By default, this utility is located at
the following path:
• C:\Program Files\Common Files\MapInfo Shared\MapX
Common\GeoDictionaryManager40.EXE
Use the MapX Geoset Manager to create and manage geosets. By default, this utility is
located at the following path:
Data Sources
The following sources provided the data released with MapInfo MapX. For more
information on MapInfo products, see the “MapInfo Data Products Catalog” or contact
MapInfo Corporation.
Japan Geoset
Japan Cased Roads GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Japan Cities MapInfo from Digital Chart of the World
Japan Country background GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Japan Highways GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Japan Major Cities MapInfo from Digital Chart of the World
Japan Rivers and Lakes GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
World Ocean (Lat / Long) MapInfo
Australia Geoset
Europe Geoset
Asia MapInfo from Digital Chart of the World
European Capitals MapInfo from Digital Chart of the World
European Cities MapInfo from Digital Chart of the World
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
France Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
France Cities MapInfo from Digital Chart of the World
France Highway Map GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
France Major Cities MapInfo from Digital Chart of the World
France NUTS 2 Level Administrative Copyright URPI 1998
Boundaries
World Ocean (Lat / Long) MapInfo
UK Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
United Kingdom Cities MapInfo from Digital Chart of the World
United Kingdom Class A Roads GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
United Kingdom Motorways GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
United Kingdom Standard Regions Copyright URPI 1998
World Ocean (Lat / Long) MapInfo
Canada Geoset
Canada Cities MapInfo from Digital Chart of the World
Canada Highways MapInfo from Digital Chart of the World
Canada Major Cities MapInfo from Digital Chart of the World
US Geoset
World Geoset
DC Geoset
Dc Area Landmarks MapInfo
Dc City Boundaries MapInfo
DC Highways MapInfo from the Bureau of Transportation
Statistics
DC Interstate Roads MapInfo from the Bureau of Transportation
Statistics
DC Landmarks MapInfo
DC Roads MapInfo from the Bureau of Transportation
Statistics
DC State Roads MapInfo from the Bureau of Transportation
Statistics
Dc Water Layer MapInfo
DC Zips © 1995 Geographic Data Technology, Inc.
Asia Geoset
Mid-Atlantic Geoset
China Geoset
Asia MapInfo from Digital Chart of the World
Asia Major Cities MapInfo from Digital Chart of the World
China Cities MapInfo from Digital Chart of the World
China Country Bdy MapInfo from Digital Chart of the World
Mexico Geoset
Mexico Cities MapInfo from Digital Chart of the World
Mexico Highways MapInfo from Digital Chart of the World
Mexico Major Cities MapInfo from Digital Chart of the World
Mexico State Boundaries MapInfo from the Bureau of Transportation
Statistics
Mexico State Capital Cities MapInfo from Digital Chart of the World
US State Boundaries MapInfo from Digital Chart of the World
World Ocean (Lat / Long) MapInfo
Germany Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Germany Cities MapInfo from Digital Chart of the World
Germany Highways GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Germany Major Cities MapInfo from Digital Chart of the World
Germany NUTS 2 Level Bdys MapInfo from Digital Chart of the World
World Ocean (Lat / Long) MapInfo
Italy Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Italy Cities MapInfo from Digital Chart of the World
Italy Highways GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Italy Major Cities MapInfo from Digital Chart of the World
Italy NUTS 2 Level Bdys Copyright URPI 1998
World Ocean (Lat / Long) MapInfo
Portugal Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Portugal Highways GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Portugal Major Cities MapInfo from Digital Chart of the World
Portugal NUTS 2 Level Boundary Copyright URPI 1998
World Ocean (Lat / Long) MapInfo
Argentina Geoset
Brazil Geoset
Israel Geoset
Spain Geoset
European Country Boundaries Data copyright and produced by URPI 1998 and
GisNET data licensed to MapInfo by GISdata
Limited. © GDC Ltd 1993
Spain Cities MapInfo from Digital Chart of the World
India Geoset
US Detail Geoset
Dallas, TX Geoset
Other Files
US 5-Digit ZIP Code Points (c) 1999 Geographic Data Technology, Inc.
US 5-Digit ZIP Code Points (c) 1995 Geographic Data Technology, Inc.
(compressed point file)
MapStats.mdb
Demographics for Asia Copyright United Nation Demographic Yearbook,
1994
Demographics for Australia MapInfo Australia
Demographics for DC copyright 1998, The Polk Company, All Rights
Reserved
Demographics for Mid-Atlantic States copyright 1998, The Polk Company, All Rights
Reserved
Demographics for the World Copyright United Nation Demographic Yearbook,
1994
Demographics for US copyright 1998, The Polk Company, All Rights
Reserved
US County Age Demographics copyright 1998, The Polk Company, All Rights
Reserved
US County Age Demographics by copyright 1998, The Polk Company, All Rights
Gender Reserved
US County Household demographics copyright 1998, The Polk Company, All Rights
Reserved
US County Household demographics copyright 1998, The Polk Company, All Rights
by Age, Income Reserved
US County Household Income copyright 1998, The Polk Company, All Rights
Reserved
US County Housing Values copyright 1998, The Polk Company, All Rights
Reserved
US County Population Demographics copyright 1998, The Polk Company, All Rights
Reserved
US Customer Database MapInfo
Use the Geoset Manager to keep a collection of map layers and their settings easily available
to you. Geosets help you to avoid the time consuming task of opening and displaying layers
individually each time you want to work with them.
Computer maps are organized into layers. Think of layers as transparencies that are stacked
on top of one another. Begin building a geoset by opening a map. Each map layer contains
different map objects, such as regions, points, lines, and text.
For example, one layer may contain state boundaries, a second layer may have symbols that
represent capitals, and a third layer might consist of text labels. By stacking these layers on
top of the other, you begin to build a complete map.
Once you have created your geoset, you can customize the way in which the layers display,
and add, delete, or reorder them.
From the Geoset Manager, work with sample geosets, or create your own.
To start the Geoset Manager, select Geoset Manager from the MapX Program Group on your
Start menu.
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.
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.
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.
Use this option if the map contains layers that cover different amounts of territory. For
example, you have a map containing New York counties, highways, ZIP Codes and streets
for Utica. If you choose All Layers, the view will be zoomed out to display the entire map.
But if you are only interested in viewing Utica streets, choose the Utica streets layer. The
zoom will be zoomed in to display those streets.
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:
• 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
To specify display attributes for a map layer, click the Display button from the Layer Control
dialog.
Display Mode
Part Description
Zoom Layering
Part Description
Display within zoom Check to activate zoom layering. Zoom layering allows you to
range 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.
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.
Part Description
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.
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.
For more information on the Geodictionary Manager, see Using the GeoDictionary
Manager.
This topic describes the features of the MapX Geodictionary Manager. The Geodictionary is
a file containing registration information about the MapInfo tables that can be matched by
MapX during automatic databinding. Only MapInfo tables that can or will be matched
against should be registered in the Geodictionary.
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 (GeoDictionaryManager40.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 new Geodictionary Manager will not modify geosets in any
way, nor will it delete files from a user’s disk.
In MapX 4.0 (or later versions), a permanent Geodictionary file is no longer required for
MapX to run.
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
• Could contain a full file spec for the Geodictionary file (e.g. "C:\Program
Files\MapInfo MapX\Maps\geodict.dct"). The effect is that the data directory is
set to be the path leading to the Geodictionary file named by this key. 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.
• Could contain just a path specification (e.g. "C:\Program Files\MapInfo
MapX\Maps\"). The data directory is set to be the path named by this key. 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.
• Could not exist at all. 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.
Note: An Uninstall of MapX will leave geodict.dct behind. This is the expected
behavior because 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\4.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\4.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.
User Interface
This section describes the user interface for the Geodictionary Manager.
Part Description
Part Description
Register This displays the common file open dialog, with the Files of
Type combo box set to "MapInfoTables (*.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), theTable
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 theTable 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.
Note: 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.
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:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<Dataset
ID>
Add the string value:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<Dataset
ID> \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 unregiste ed!
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.
helpstring("IMMapXStaticDataset Interface"),
version(1.0)
]
interface IMMapXStaticDataset : IMMapXDataset
{
HRESULT FetchData(
[in] long lColNum,
[in] long lIdxRow,
[in] VARTYPE vtRequested,
[out] VARIANT* pvarData,
[out] BOOL * pbNoMoreData);
HRESULT BeginFetch();
HRESULT EndFetch();
}
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::BeginFetc
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.
uuid(1e584f00-d2a5-11d0-9da3-00aa00a478cb),
helpstring("IMMapXColumnInfoContainer Interface"),
version(1.0
]
interface IMMapXColumnInfoContainer : IUnknown
{
HRESULT GetColumnInfoByName(
[in] BSTR bstrColumnName,
[out] IMMapXColumnInfo** ppIMMapXColumnInfo);
HRESULT GetColumnInfoByIndex(
[in] long lIndex,
[out] IMMapXColumnInfo** ppIMMapXColumnInfo);
HRESULT GetColumnInfoEnumerator(
[out] IMEnumMapXColumnInfo** ppIMEnumMapXColumnInfo);
}
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.
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.
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.
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.
IMMapXColumnInfo::GetDataType
HRESULT GetDataType(
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.
IMMapXColumnInfo::GetColumnNumber
HRESULT GetColumnNumber(
Description
Retrieves the column number of the source data column.
Return Value
S_OK is returned on success.