MapX Mobile Developer Guide

MapX Mobile Developer Guide
MapX Mobile
5.05
Developer Guide
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.
© 2004 MapInfo Corporation. All rights reserved. MapInfo, the MapInfo logo and CareInsite are trademarks of MapInfo Corporation and/or its affiliates.
MapInfo Corporate Headquarters:
Voice: (518) 285-6000
Fax: (518) 285-6070
Sales Info Hotline: (800) 327-8627
Government Sales Hotline: (800) 619-2333
Technical Support Hotline: (518) 285-7283
Technical Support Fax: (518) 285-6080
Contact information for North American offices is located at: http://www.mapinfo.com/company/company_profile/index.cfm.
Contact information for worldwide offices is located at: http://www.mapinfo.com/company/company_profile/worldwide_offices.cfm.
Adobe Acrobat® is a registered trademark of Adobe Systems Incorporated in the United States.
Portions © 2004 Earth Resource Mapping, Inc.
Products named herein may be trademarks of their respective manufacturers and are hereby recognized. Trademarked names are used editorially, to the benefit of the
trademark owner, with no intent to infringe on the trademark.
November 2004
Table of Contents
Chapter 1: Introduction to MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Mapping at a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Making MapX Mobile Work for You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Overview of Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Learning About MapX Mobile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Chapter 2: Getting Started with MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
What Is MapX Mobile? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's Included with MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The MapX Mobile Installation Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding the Map Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Simple Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MapX Mobile Sample Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MapX Mobile Documentation Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Where to Go Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
13
14
18
19
20
25
27
Chapter 3: MapX Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Map Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Property Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Layers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GeoSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creatable Objects in MapX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
29
30
32
33
34
35
Chapter 4: Mapping Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Organizing Your Data and Maps: An Overview of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Are GeoSets?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Map Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Putting Your Data on the Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Power of MapX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
38
39
39
40
Chapter 5: Mapping in Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Maps as Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Layers Collection: Building Blocks of Your Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Some Properties of the Layers Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Some Methods of the Layers Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Layers with the LayerInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Layer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
42
44
45
46
49
Developer Guide
Table of Contents
Layer Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Examining Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking the Feature Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zoom Layering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generating Labels for a Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Raster Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Animation Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
50
50
51
52
53
55
56
57
58
Chapter 6: Putting Your Data On The Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
What Is Data Binding? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Power of Adding Your Data to a Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How to Add Your Data to a Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Datasets Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Datasets.Add Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Fields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Fields.Add Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying Your Data as a Layer of Points (BindLayer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Making Your New Layer of Points a Permanent Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How Data Binding Uses the GeoDictionary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Different Types of Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
60
60
60
61
61
64
64
65
68
68
70
Chapter 7: Features and Selections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
What Is a Map Feature? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is a Features Collection? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is a Selection Collection? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Features Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding the Selection Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Feature Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
72
72
72
75
75
Chapter 8: Thematic Mapping and Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
What Is Thematic Mapping?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Planning Your Thematic Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Types of Thematic Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manipulating a Theme Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing a Thematic Legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Label Thematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
79
79
82
90
92
92
Chapter 9: Finding Features on a Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Using the Find Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Using the FindFeature Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 10: Using Drilldown Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
What Is a Drilldown Layer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Terms and Concepts You Should Know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
How to Develop a Drilldown Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Preparing a Drilldown Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
iv
MapX_Mobile_DevGuide.pdf
Developer Guide
Table of Contents
Creating a Drilldown Tool. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Resetting the Drilldown Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drilldown Layer Limitations and Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For More Information... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
102
103
104
104
Chapter 11: Using Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Basic Concepts of Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Obtaining a Coordinate System Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Querying the Properties of a CoordSys Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying a Map in a Different CoordSys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specifying X-Y Coordinates in a Different CoordSys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying the Choose Projection Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Summary of Parameters Used by Coordinate Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using Settings from MAPINFOW.PRJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Applying an Affine Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Custom Datums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datum Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For More Information... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
107
107
108
109
110
110
112
114
115
116
117
Chapter 12: MapX Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Overview of Standard Tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Editing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Node Selecting and Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Custom Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Polygon Drawing Tools (Polytools) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
120
121
121
125
127
Chapter 13: Distributing Your MapX Mobile Application . . . . . . . . . . . . . . . . . . . . . . . 129
MapX Mobile Customer Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Raster Format Handlers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Maps and Geosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Keys to the Windows Registry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Passing in the MapX License String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
130
132
134
135
136
136
Chapter 14: The MapX Object Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Affine Transform Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
AllFeaturesConstraint Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotation Object and Annotations Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BindLayer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BitmapSymbol Object and BitmapSymbols Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
BoundsConstraint Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CoordSys Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dataset Object and Datasets Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datum Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Feature Object and Features Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FeaturesConstraint Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FeatureFactory Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Field Object and Fields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
138
140
142
146
151
153
156
161
171
174
187
189
203
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
v
MapX_Mobile_DevGuide.pdf
Developer Guide
Table of Contents
Find Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FindFeature Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FindMatch Object and FindMatches Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FindResult Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Geoset Object and Geosets Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Graphic Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IndividualValueCategory Object and IndividualValueCategories Collection . . . . . . . . . . . .
Label Object and Labels Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LabelProperties Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Layer Object and Layers Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LayerInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Legend Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LegendText Object and LegendTexts Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Map Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MultivarCategory Object and MultivarCategories Collection . . . . . . . . . . . . . . . . . . . . . . . . .
NotesQueryInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
NotesViewInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
OCIQueryInfo Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ODBCQueryInfo Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parts Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Point Object and Points Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RangeCategory Object and RangeCategories Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Rectangle Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ResolveObject Object and ResolveObjects Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RowValue Object and RowValues Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selection Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SourceRow Object and SourceRows Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
State Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Style Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Theme Object and Themes Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ThemeProperties Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Title Object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Variable Object and Variables Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
212
216
218
220
222
224
226
228
234
239
271
277
283
285
315
316
319
320
321
322
324
329
332
335
336
340
347
349
356
374
381
392
394
Appendix A: MapX Field Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
What Constitutes a Valid Field Name? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Where Are Valid Field Names Enforced? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Appendix B: Custom Dataset Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Static Dataset Object Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ColumnInfo Enumerator object overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ColumnInfo Object Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
401
401
406
406
Appendix C: Glossary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Appendix D: Using the Geodictionary Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Background Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
vi
MapX_Mobile_DevGuide.pdf
Developer Guide
Table of Contents
The Geodictionary File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Appendix E: MapX Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Stock Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Custom Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Appendix F: MapX Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Appendix G: Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Appendix H: Creating Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Appendix I: Geosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Geoset Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Sample Geoset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Supported Geoset Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Appendix J: IDispatch Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Appendix K: Using the Geoset Manager. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
Appendix L: OLE_COLOR Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
Appendix M: Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Appendix N: Managing MapX Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
vii
MapX_Mobile_DevGuide.pdf
Introduction to MapX
Mobile
Welcome to the MapInfo family of products. As the field of enterprise
mapping continues to expand, MapInfo leads the way with new
products that are designed to fulfill users’ desktop, enterprise, and
now, hand-held mapping needs from our flagship product, MapInfo
Professional, to the most specialized with MapMarker, our premier
address-matching product.
MapInfo MapX Mobile is a mapping control that lets you easily add
powerful mapping capabilities to your Windows CE 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.
In this chapter:
Š
Š
Š
Š
Mapping at a Glance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Making MapX Mobile Work for You . . . . . . . . . . . . . . . . . . . . . . . . 9
Overview of Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Learning About MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
Developer Guide
Chapter 1: Introduction to MapX Mobile
Mapping at a Glance
Huge quantities of information are available today, far more than ever before. Data abounds in
spreadsheets, sales records, and marketing files. Paper and disks store masses of information on
customers, stores, personnel, equipment, and resources.
Nearly all of it has a geographic component. An estimated 85 percent of all databases contain
some sort of geographic information such as street addresses, cities, states, ZIP Codes, or even
telephone numbers with area codes and exchange numbers.
MapX Mobile 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.
Making MapX Mobile Work for You
With MapX Mobile, the power to add powerful mapping capabilities to your PocketPC applications
is at your disposal. MapX Mobile allows you to take your mapping applications off of the desktop
and into the field on hand held devices. Your maps are representations of real world objects. Now
you can map those objects while your standing on or next to them.
For example, MapX Mobile allows you to position the location of your fiber optic cable when you
are standing next to it in the street. You can use MapX Mobile in conjunction with GPS devices to
determine the accuracy of your data or you can log incident reports while still in the field. With
MapX Mobile your data goes where ever you do!
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
9
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 1: Introduction to MapX Mobile
Overview of Key Features
With MapX Mobile, you can analyze and visualize your business data, create or edit map features,
and display the results geographically. Key features of MapX Mobile are listed below.
•
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 MapX Mobile is
embedded, from an ADOCE data source such as MSAccess.
•
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 Mobile’s analytical features by grouping and organizing data.
Select map features within a specific radius, rectangle or specific points.
•
Feature Factory The FeatureFactory object allows you to create, combine, buffer, or
erase point, line, and region features.
•
Tools Your users interact with the map directly, by clicking and dragging. Use MapX
Mobile's built-in navigation, selection, and labeling tools, or create custom tools tailored to
suit your own application.
•
Map Editing You can give your users the power to add, modify, or delete features on the
map.
•
Projections and Coordinate Systems With full support of coordinate systems and map
projections, MapX Mobile allows you to fine-tune the map's display and process X-Y data
in native coordinates.
Learning About MapX Mobile
This document is written for anyone who wants to easily add mapping capabilities to their
applications using MapX Mobile and the hand-held object-oriented programming language
Embedded Visual C++.
If you are using MapX Mobile for the first time, here are some pointers for how to learn about
MapX Mobile:
•
Read Chapter 3: MapX Basics.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
10
MapX_Mobile_DevGuide.pdf
Developer Guide
•
Chapter 1: Introduction to MapX Mobile
Examine the sample applications and use them as a template for your own creations.
When you install MapX Mobile, sample applications are installed on your computer in:
<Path to MapX Mobile>\Samples.
For tips on using MapX with a specific development environment, see Chapter 2: Getting Started
with MapX Mobile.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
11
MapX_Mobile_DevGuide.pdf
2
Getting Started with
MapX Mobile
This chapter presents the information you need to install MapX
Mobile successfully and gives you a quick overview of MapX Mobile.
First-time users should read this chapter.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Š
What Is MapX Mobile? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What's Included with MapX Mobile . . . . . . . . . . . . . . . . . . . . . . .
The MapX Mobile Installation Process . . . . . . . . . . . . . . . . . . . .
Adding the Map Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Simple Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MapX Mobile Sample Applications . . . . . . . . . . . . . . . . . . . . . . .
MapX Mobile Documentation Set . . . . . . . . . . . . . . . . . . . . . . . .
Where to Go Next . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13
13
14
18
19
20
25
27
Developer Guide
Chapter 2: Getting Started with MapX Mobile
What Is MapX Mobile?
MapX Mobile is a tool for Windows Mobile application developers. It offers the easiest, most costeffective way to embed mapping functionality into new and existing hand-held device applications.
MapX Mobile is a DLL that can be quickly integrated into client applications using eMbedded C++.
System Requirements
•
Microsoft® Pocket PC 2003 SDK and Microsoft Windows® CE eMbedded Visual Tools
4.0 available here: http://www.microsoft.com/downloads/
details.aspx?FamilyId=9996B314-0364-4623-9EDE-0B5FBB133652&displaylang=en/
•
Pocket PC 2003 with StrongArm Processor
•
x86 emulator available here: http://www.microsoft.com/MOBILE/developer/
technicalarticles/debugapps.asp
•
PC with Pentium processor, 400MHz or higher recommended, Microsoft Windows 2000
operating system with Service Pack 2 installed or Windows XP, 128 MB RAM (196 MB
recommended)
What's Included with MapX Mobile
The MapX Mobile software package includes the components listed below.
Note:
If you clear options when installing MapX Mobile, 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 Mobile.
MapX Mobile Contents
Part
Description
Program Files
The MapX Mobile DLL, along with other DLLs and support files.
Sample Maps
A collection of map files (in MapInfo table format) of different regions
around the world.
Sample Data
A Microsoft Access database containing sample demographic data.
Sample Applications
Program examples in eMbedded Visual C++ that show you MapX Mobile
in action.
For in depth information on the MapX Mobile Sample Applications, see
MapX Mobile Sample Applications on page 20.
Utilities
The MapInfo Geodictionary Manager (GeoDictionaryManager50.exe),
which allows you to register tables for use with MapX Mobile, and the
GeosetManager, which allows you to easily create Geosets.
For additional information, see Appendix K: Using the Geoset Manager.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
13
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
Part
Description
MapX Mobile Device Files
These are MapX Mobile device specific files and emulator files. They are:
• ARM processor
• PocketPC 2003 Emulator (x86)
MapX Mobile Device Installer
This installer will place the necessary files on your mobile device to run
MapX Mobile applications.
MapX Mobile Documentation
Customers who purchase MapX Mobile receive the MapX Mobile Developer’s Guide in PDF format. It is a detailed work on mapping concepts
and how to use MapX Mobile effectively.
MapX’s comprehensive Online Help system is essentially an electronic
version of The MapX Mobile Developer’s Guide with the addition of
numerous code samples in The MapX Object Model section.
The MapX Mobile Installation Process
Before Installing MapX Mobile
Before installing MapX Mobile, make sure you record your serial number in an easy-to-remember
place. Also, be sure to fill out the postage-paid registration card provided and return it to MapInfo
Corporation.
In order to develop applications to be used on a mobile device you need to have the following
packages (in this order) installed on your machine:
1. The eMbedded Visual C++ 4.0 compiler. This is available at http://
www.microsoft.com/downloads/details.aspx?familyid=1DACDB3D-50D1-41B2A107-FA75AE960856&displaylang=en. Along with this compiler, download and install
Service Pack 3 (http://www.microsoft.com/downloads/
details.aspx?FamilyID=5bb36f3e-5b3d-419a-9610-2fe53815ae3b&DisplayLang=en).
2. The SDK for Windows Mobile 2003-based Pocket PCs. It can be downloaded at: http:/
/www.microsoft.com/downloads/details.aspx?FamilyId=9996B314-0364-4623-9EDE0B5FBB133652&displaylang=en.
3. Optionally, you may want to have the x86 Emulator on your machine if you do not have an
actual device to work with. It can be downloaded at: http://www.microsoft.com/
downloads/details.aspx?familyid=5C53E3B5-F2A2-47D7-A41D825FD68EBB6C&displaylang=en.
4. Lastly, make sure that the device you are developing for is running the Pocket PC 2003
operating system with the StrongArm chip.
Installing MapX Mobile
To install MapX Mobile:
1. Place your CD in the tray. This should start the Install Wizard that will lead you through the
MapX Mobile install procedure. If this does not occur, open the CD manually and doubleclick SETUP.exe.
The MapX Mobile Splash screen is displayed.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
14
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
2. Click “Install Products”.
The Install Shield window launches.
3. Click NEXT to proceed to the License Agreement screen.
4. On the License Agreement screen, choose the radio button “I accept the terms of this
license agreement” and click NEXT.
The Customer Information screen is displayed.
5. On the Customer Information screen, fill in your name and organization and choose the
users for the application.
Choose either “Anyone who uses this computer” or “Only for me (user’s name).”
6. Enter in your product serial number and click on NEXT.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
15
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
The serial number can be found on a sticker adhered to the envelope that holds your
distribution CD.
The Destination Folder screen is displayed.
7. If the default destination path is okay, click NEXT. Otherwise click on CHANGE… and use
the interface to locate a different folder in which to place your MapX Mobile installation.
Clicking on NEXT opens the Setup Type screen.
8. The Setup Type screen allows you to choose whether to install the complete program or to
customize which features you would like to install and their location on your hard drive. It
is recommended that you choose COMPLETE.
If you would like to customize your installation, choose Custom. This option allows you to
choose to install any or all of the following components:
•
•
•
•
•
MapX Mobile Samples
MapX Mobile Device Files
MapX Mobile Device Installer
MapX Mobile Data
MapX Mobile Help Files
Note:
Click on a component for an explanation of what is contained in it.
Click on NEXT to continue the installation.
9. The installer is now ready to copy the files. If you are uncertain about any the settings that
you have specified up to this point, you may review and change any previous screen by
clicking on BACK. Clicking INSTALL starts the installation of all the specified files.
The installation process starts and a status bar is displayed in the Installing MapX Mobile
Desktop screen. Once the status bar reaches about 75%, the installation program begins
trying to install the application onto your PocketPC 2003 device. Follow the on-screen
prompts to step through this process.
If your PocketPC 2003 device is installed and connected to your computer, the application
is installed onto your device. If the device is not connected, a message is displayed stating
that the application will be installed the next time that your device is connected to your
computer.
If you do not have any device installed onto your computer, the installer skips this step.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
16
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
10. When the installation is complete a screen is displayed indicating the completion of the
installation. Click FINISH to exit the installer.
If you are using a Pocket PC device your install is complete. You may run the sample applications
installed with MapX Mobile located in C:\Program Files\MapInfo\MapX Mobile\Samples.
If you are using a Desktop emulator you will need to complete the steps listed below.
Note:
We will soon release a utility which will automate the install of MapX Mobile on the
Emulators. Please check our web site at: http://www.mapxmobile.com under the
download section for this free utility. Until that time please use the following instructions for
installing MapX Mobile on an Emulator.
Installing MapX Mobile on Pocket PC 2003 Emulator
The default installation of MapX Mobile installs an x86 emulator onto your computer. You can use
this emulator to test your application without the use of a separate PocketPC 2003 device.
Make sure that you have installed the Microsoft® Pocket PC 2000 SDK from the Microsoft
eMbedded Visual Tools 3.0 install (http://www.microsoft.com/downloads/
details.aspx?FamilyId=9996B314-0364-4623-9EDE-0B5FBB133652&displaylang=en.).
We have provided a MapX Mobile target installer for you to use to put the requisite MapX Mobile
files onto your device emulator. The installation is as follows:
1. Launch the target installer bat file (C:\Program Files\MapInfo\MapX Mobile5.5\target\x86\TargetInstaller\setup_x86.bat).
The installer starts and then launches the emulator.
The installer copies all the necessary files to the emulator.
When the installation is complete a target installer message is displayed.
2. Soft-reset your emulator. Use the Emulator->Soft Reset menu option to do this. Any other
reset of your emulator causes you to lose anything installed in it.
This soft reboot necessary to have the newly installed MapX Mobile fonts available for the
system so that your map symbols display properly.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
17
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
You are now ready to use MapX Mobile from the emulator environment.
If you want to transfer any map files (such as geosets and map data) to your emulated device, use
the Windows CE Remote File Viewer (C:\Program Files\Common Files\Microsoft Shared\Windows
CE Tools\Platman\bin\cefilevw.exe). All MapX Mobile related files should be placed in the My
Documents\Maps directory on the Pocket PC device. The Pocket PC registry is already configured
to use this directory to find any geosets and map data.
Adding the Map Control
After installing MapX Mobile, you need to add the Map control.
To make a Map Control appear in the eMbedded C++ Toolbox do the following with an open
eMbedded C++ project.
1. Select PROJECT > ADD TO PROJECT > COMPONENTS AND CONTROLS
2. In the Components and Controls dialog box, click on the control named "MapInfo MapX
Mobile V5". If this control name is not present in the dialog, then click the "Add Control"
button and browse to find the MapX50.dll file, which is located in the MapX Mobile
installation directory (typically C:\Program Files\MapInfo\MapX Mobile-5.5).
3. Click on the "Insert" button to insert the control into the project. Click OK to verify that you
would like to insert a control.
4. In the resultant Control Classes dialog box, uncheck all of the classes, except for the
CMapX class and click OK. All of the wrappers in this list are unnecessary as we provide
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
18
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
our own wrappers. You need to leave at least one wrapper in the list active to allow the
control to be added.
5. You will now see the Map Control show up in the toolbox as well as two files named
CMapX.cpp and CMapX.h added to your project.
6. Remove the files, CMapX.cpp and CMapX.h, from your project and add the MapX Mobile
C++ wrapper class files, named MapX.cpp and MapX.h.
You may need to copy these files from their installation location (C:\Program
Files\MapInfo\MapX Mobile-5.5\Samples\eVC\MapXMobileViewer) to your project
directory.
The Map Control appears on the toolbox. To place a map on your C++ dialog, select the Map
Control and draw a box on the dialog.
If you save your project, the next time you re-load your project the Map icon will appear in the
toolbox automatically.
Creating a Simple Map
With MapX Mobile, it's easy to add a map to your application. In fact, you can add a working map
to an eMbedded Visual C++ form.
1. Click on the Map Control icon in your toolbox. If the Map control does not appear on the
toolbox, see Adding the Map Control on page 18.
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 Mobile Properties dialog box displays.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
19
MapX_Mobile_DevGuide.pdf
Developer Guide
4.
Chapter 2: Getting Started with MapX Mobile
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. Notice that whenever the cursor is over the map, it changes to a magnifying glass with a
plus sign. Run your program to view the map on your device or emulator.
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, select CTRL key on your soft keyboard and click the map again.
One way to learn MapX is to study sample applications. Look for sample applications in the folder:
\Program Files\MapInfo\MapXMobile\Samples
MapX Mobile Sample Applications
The following sections describe the sample MapX Mobile applications that are shipped with MapX
Mobile. Study these applications to learn about MapX Mobile and how to make it work for you.
About the DataBinding Sample Application
The DataBinding sample application is intended as a reference for the different types of
databinding that are available in MapX Mobile.
Application Features
•
Sample use of each of the databinding methods available in MapX Mobile.
•
Displaying a simple ranged theme using each of the types of databinds.
•
Using menus to choose databind types and MapX Mobile map tools.
•
Using eMbedded Visual Basic buttons to show or hide theme legends and the layers
dialog.
MapX Features Demonstrated
•
Loading Layers with a tab file
•
Adding a dataset to a layer with data from an ADO source
•
Adding a dataset to a layer with data from a SafeArray
•
Map zooming and positioning tools
•
Creating thematics and associated legends
MapX Objects Demonstrated
•
Map
•
Layers
•
Layer
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
20
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
•
LayerInfo
•
BindLayer
•
Datasets
•
Dataset
•
Themes
•
Theme
Installation
Make sure that you have installed MapX Mobile to the PocketPC. If you are using the emulator be
sure to follow the instructions for setting up MapX Mobile to run under the emulator.
To run this sample application, you will need two .TAB files -- DC_Zipcodes and DC_Cust, with
their associated background files (.MAP, .DAT, .ID, .IND) -- copied to the \My Documents\Maps
folder on the PocketPC (or emulator). A Microsoft Access Database file is also required to run the
sample application.
On the PocketPC 2003 Emulator (x86):
•
Copy the pre-converted Databind.cdb file from the \Samples\eVB\Data\x86 (pocket pc
2003 emulator) folder (installed in your MapX Mobile directory) to the emulator's \My
Documents\Data folder.
Using the DataBinding Sample Application
When the sample application is run, a background map of Washington, D.C. ZIP Codes will be
displayed. Choose one of the Tools menu options to select a map tool -- e.g., Zoom In, Zoom Out,
or Pan. Choose one of the DataBind Type menu options to add a dataset to the map, display the
resulting map objects as a layer, and add a theme to make data from the dataset visible on the
map.
Since this application is intended primarily as a code sample for use in programming other
applications, all of the databind menu options result in exactly the same collection of points being
displayed on the map! The same theme is added in each of the seven cases (the only difference
being the range of colors applied). The only difference is that, for different types of databinds,
different data is used to create the points or to look up their locations in the reference table.
Click on the More Info button after adding a dataset to find out more detail on the databinding
process for the dataset that has just been added.
To avoid confusion, in this sample application only one dataset may be added at a time. If a new
databind type is chosen from the menu, the application will remove any datasets and related
layers that have been added previously. However, it would be perfectly possible to add other
background layers, datasets or themes to this map; these would not be affected by the existing
code.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
21
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
Other tips on using the sample:
Click the 'Layers Dialog' button to display the MapX Mobile Layers dialog. This will give you a list
of the layers currently added to the map, and allow you to add or remove layers if you wish. Check
this list at various points to clarify the behavior of different types of databinds:
•
Adding a native .TAB dataset requires that the .TAB be an existing layer on the map;
•
XY and PointRef databinds add a new layer to the map;
•
Normal and PointRef databinds use an existing map layer as a reference layer.
Note:
Removing a layer which has an associated theme will automatically remove the theme as
well; also, removing DC_Cust_RefLayer will prevent you from completing the types of
databinds that require this reference layer.
Object Editing Sample Application
This sample application exhibits the feature editing capabilities of MapX Mobile. It also
demonstrates the SearchWithinDistance (searches for map features within a specified distance,
and returns search results as a Features collection) and Find.Search (searches the layer for a
street address or for the name of a feature on the map) methods.
Application Features
•
Sample use of SearchWithinDistance method available in MapX Mobile.
•
Displaying results of SearchWithinDistance and ability to display record value of a feature
that is returned.
•
Ability to add a new customer and edit table information for that customer.
•
Using menus to execute different functions and MapX Mobile map tools.
•
Ability to type in a customer name and find that customer on the map.
MapX Features Demonstrated
•
Using SearchWithinDistance method.
•
Using Find.Search method.
•
Setting a layer as the insertion layer to add new features to the layer.
•
Map zooming and positioning tools.
•
Creating and using custom tools.
•
Populating a combo box with values from a features collection.
•
Using the ToolUsed event.
•
Converting user click location to map coordinates.
MapX Objects Demonstrated
•
Map
•
Layers
•
Layer
•
Features
•
Feature
•
RowValues
•
Dataset
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
22
MapX_Mobile_DevGuide.pdf
Developer Guide
•
Chapter 2: Getting Started with MapX Mobile
Find
Installation
To run the application, you will need two .TAB files - DC_Zips and DC_Cust, with their associated
background files (.MAP, .DAT, .ID, .IND) - copied to the \windows\start menu\data folder on the
PocketPC (or emulator). The compiled ObjEditing.vb file may then be copied to any folder location;
click on it to run it.
Note:
Make sure that you have installed MapX Mobile to the PocketPC. If you are using the
emulator be sure to follow the instructions for setting up MapX Mobile to run under the
emulator.
Using the Object Editing Sample Application
When the sample application is run, a background map of Washington, D.C. ZIP Codes will be
displayed with customer points.
•
Choose one of the 'Tools' menu options to select a map tool -- e.g., Zoom In, Zoom Out,
Pan or View Entire Layer.
•
Choose the SearchWithinDistance tool and click on the map. The customer points within
½ mile radius will be selected and the last and first name will be populated into a combo
box.
•
Choose one of the customers to view the table information for this customer.
•
Choose the clear circle tool to remove the circle radius on the map.
•
Choose the add or edit customer location tools to add a new customer or to edit an
existing customers table information.
•
Choose the Find>Search menu item to type in a customer last name to locate that
customer on the map.
MapXMobileViewer Application (eMbedded Visual C++)
This sample app is meant to be a working and useful map viewer and editor. It shows how to use
many features of mapx using Embedded Visual C++.
Application Features
•
Using mapx.h and mapx.cpp wrapper classes.
•
Embedding MapX in an MFC View.
•
Embedding MapX in an MFC Dialog.
•
Using a CCmdBar for menus and buttons.
•
Using a CToolbar.
MapX Features Demonstrated
•
Loading geosets.
•
Loading Layers with a tab file.
•
Adding a Layer Dataset.
•
Loading self-registering raster layers without a tab file.
•
Exporting a Map to a .bmp file.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
23
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
•
Map zooming and positioning tools.
•
Selection Tools.
•
Object Editing Tools.
•
Creating a custom tool (Info Tool).
•
Creating and modifying thematics.
•
Use of the stock mapx dialogs.
•
Simple use of the Find object.
•
Buffering.
MapX Features NOT Demonstrated
Adding an ADO or SafeArray dataset.
MapX Objects Demonstrated
•
Map
•
FeatureFactory
•
Layers
•
Layer
•
LayerInfo
•
Find
•
Features
•
Feature
•
Selection
•
Datasets
•
Dataset
•
RowValues
•
RowValue
•
Themes
•
Theme
MapX Events Demonstrated
•
Tool Used
•
ThemeModifyRequested
Installation
Copy the compiled MapxMobileViewer.exe file to anywhere on your pocketpc (or emulator) and
click on it to run it. Make sure that you have installed MapX Mobile to the pocketpc. If you are using
the emulator be sure to follow the instructions for setting up mapx mobile to run under the
emulator. You will also need at least one tab file copied to the \my documents\maps folder for you
to view/edit.
Using MapXMobileViewer
To open a map file for viewing, do one of the following:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
24
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
•
Choose Map -> Open Table
•
Click the Open button on the toolbar.
You can choose which folder to list the MapInfo tables from. By default, tables in all folders in the
My Documents folder are listed. Also note that if you have a storage card, tables in the My
Documents folder there are also listed. Using the type drop-down list, you can specify what type of
file displays in the list, such as .tab files or .gst (geoset) files.
Note:
The Add... button in the Layer Control dialog also lets you open tables, but not geosets.
Object Editing Tips
•
The Map -> Create Scratch Layer command creates a temporary layer as the topmost
layer in the map, and sets it as the insertion layer. This is useful for experimenting with the
editing tools such as the Add Point Tool, Add Polygon Tool, etc.
•
You can change the Insertion layer to any layer in the map with the Editing->Insertion
Layer command.
•
Choosing Editing -> New Object Styles displays a style picker to choose the style of new
objects added with the Add tools. Note that the style picker displayed depends on the
current tool chosen. For example if the current tool is the Add Line Tool, then the Line
Style picker will be displayed. All new lines added will then have the new style.
•
To change the style of an existing object or objects, first select the object(s) using one of
the select tools, and then choose Editing -> Set Style.
Other Tips on Using the Sample
•
The Editing -> Delete menu item is the same as pressing the delete key on the soft input
panel keyboard.
•
The View -> Find method demonstrates using MapX in a dialog. It copies the layers from
the main map into the map in the dialog. You can then search for an item in the layer using
the first string field in the layer.
•
The info tool displays all objects under where the user clicked. You can edit the attributes
by clicking on the field and then changing the value.
MapX Mobile Documentation Set
MapX Mobile documentation includes a printed book entitled The MapX Mobile Developer Guide
and an Online Help system.
The MapX Mobile Online Help System
MapX Mobile’s comprehensive Online Help system provides the information you need to learn and
use MapX Mobile more effectively. Essentially, it is an electronic version of the printed manual with
the addition of sample code written in Embedded Visual Basic and C++. Cut and paste these
samples into your own MapX Mobile applications to expedite your application’s development
process.
You can reach the information in several ways:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
25
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
•
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. From the Start Menu, choose ->
Programs -> MapInfo MapX Mobile -> MapX Mobile Online Help. Then, click index and go
to the Find Tab. Type the word you want to search for, and click Rebuild. A list of words to
help narrow your search. Click on a word, and a list of topics displays that contain the
selected word. Double-click on the topic you want or click Display to display the topic. You
my customize your search by clicking OPTIONS to make your find more specific.
•
Use the Index feature to find a topic quickly. Type the first few letters of the word you are
looking for. The topic that most closely matches what you typed is highlighted. Click the
index entry you wish to display.
•
See Also information: Click on the green underlined text in any Help window to bring up
information on related tasks or key words and phrases.
Online Help has been designed to display in part of your window so that you can view your maps,
Browser windows, and dialogs alongside the Help window. Of course, you can always change the
size of the Help window to work the way you are most comfortable. Choose Help > Always On Top
to keep the Help window on your screen so you can continue to work in MapX. Or use Alt–Tab to
toggle between the Help screen and the MapX Mobile desktop.
Tips on Using Online Help
Using Code Examples
You can easily copy code examples from the Help window. To copy text, highlight the text, and
press CTRL-C; to paste the text into your development environment, press CTRL-V. You can also
use Drag and Drop to drag highlighted text from Help into other applications.
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 Mobile applications. Minor
adjustment or “tweaking” may need to be made to the existing code in order for it to work
properly.
Download the Latest Help Files
MapInfo Corporation regularly updates the MapX Mobile Online Help. To download the latest
version of this Help file, visit the MapX web site at: http://extranet.mapinfo.com/products/
overview.cfm?productid=1661.
The MapX Mobile web site also provides sample applications, as well as a Discussion Area where
you can post questions and interact with other MapX Mobile users.
Note:
When using MapX Mobile with eMbedded Visual Basic, you will find properties/methods in
the MapX Mobile Library that do not have help topics associated with them. These
properties/methods are inherited from eMbedded Visual Basic. Consult your eMbedded
Visual Basic documentation for information regarding these properties.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
26
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 2: Getting Started with MapX Mobile
Where to Go Next
This chapter has provided a very quick overview of MapX Mobile. Other sections of this
documentation describe specific features of MapX Mobile in greater detail.
Before you read any further, take a moment to view the MapX Mobile Object Model Diagram. This
poster is included with MapX Mobile and is useful for giving you the “big picture”. Use it as a
reference as you learn about MapX Mobile.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
27
MapX_Mobile_DevGuide.pdf
3
MapX Basics
In the Getting Started chapter, we created a simple MapX map using
the MapInfo MapX Control, and in the previous chapter we introduced
you to some MapX mapping concepts. This chapter is an overview of
the major components behind MapX map creation and manipulation
within an application. Selected topics will be discussed in detail in
subsequent chapters.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Map Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Property Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
GeoSets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creatable Objects in MapX . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29
29
30
32
33
34
35
Developer Guide
Chapter 3: MapX Basics
Map Object
Looking at the MapX object hierarchy on the MapX Object Model (see the object model poster or
click the object model button on the online help window), you see that the map object itself is at the
top. Every MapX object, property, and method is derived from the Map object. Every property and
method shown underneath the map object will somehow contribute to building the overall Map
object. Primarily Datasets, Layers, and Annotations objects define each Map object.
The following table shows some of the Map object properties that are represented by numeric
values. These properties may be changed at design time, or at runtime using the following code
samples:
Property
Description
Code Sample
Zoom
Sets the number of miles (default unit of measure) displayed
in the map.
Map1.Zoom = 500
Rotation
Rotates the map a specified number of degrees.
Map1.Rotation = 179
CenterX
Sets the X coordinate of the center of the map. X coordinates are associated with Longitude or Easting, depending
on map projection.
Map1.CenterX = -79.4458
CenterY
Sets the Y coordinate of the center of the map. Y coordinates are associated with Latitude or Northing, depending
on map projection.
Map1.CenterY = 44.9932
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 Window and click on (Custom) from the Properties Window.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
29
MapX_Mobile_DevGuide.pdf
Developer Guide
2. Click the
Chapter 3: MapX Basics
button on the (Custom) row.
Additionally, the Property Page can be accessed during design time by right clicking on the Map
object within the form and selecting “Properties...”
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
30
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
The layers may be altered at design-time through the MapX Properties dialog box, or
programmatically during run-time. The Properties dialog box allows the designer to manipulate the
layers simply by changing the settings. In Chapter 5: Mapping in Layers, we will take a look at
the code that can be used to change the layers properties and methods at any time within the
program. Adding new layers, removing layers, and changing the visibility or style of a layer are
among some of the actions you can perform on a layer.
Layers Collection
The Layers collection is made up of (0 - n) Layer objects. The Layer object is made up of a
collection of features, with each feature having its own properties and styles. A collection of
features is made up of Feature objects, which correspond to a feature on the map such as a point,
line, or region. You can create stand-alone Feature objects, or you can obtain a collection of
Feature objects. Features will be discussed in Chapter 7: Features and Selections.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
31
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
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.
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 the data should be matched against the “USA” map layer.
You can specify programmatically 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
32
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
Modifying the GeoDictionary
Registering a MapInfo table in the GeoDictionary is necessary if you wish to take advantage of
automatching when doing data binding. The MapX GeoDictionary Program ships with MapX and
allows you to register a new MapInfo table into the GeoDictionary. Additionally, within the MapX
GeoSet Manager there are options under the Tools menu.
Within the MapX GeoDictionary, click on the Register button, and simply select the table you wish
to register, set the table properties and enter a description for the table. If you wish to automatically
load the table to a GeoSet, click 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.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
33
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
Once the data is bound to the map, you can view pertinent information geographically. The visual
representation of data enables the creation of a theme map. A theme is the color-coding of the
map to geographically represent trends in data.
Annotations
The Annotations collection is an easy way to get text and symbols onto a map. The annotations sit
“on top” of all other layers and are not linked to any data. If you are familiar with MapInfo software,
the annotations are similar in purpose to a map’s cosmetic layer.
Listed below are methods and properties for the Annotations collection object:
Annotations Collection Methods
Method
Description
Code Sample
AddSymbol
Adds a symbol to the Annotation collection. A default
style is used (as specified in Map.DefaultStyle).
Map1.Annotations.AddSymbol X, Y
AddText
Adds text to the Annotation collection. The fourth
parameter is the initial position of the text relative to the
coordinates given.
Map1.Annotations.AddText _
“Developer Services”, _
79.44, 46.8889, miPositionTL
Remove
Removes a specific Annotation from the collection.
Map1.Annotations.Remove 1
RemoveAll
Removes all Annotations from the collection.
Map1. Annotations.RemoveAll
Annotation Collection Properties
Property
Editable
Description
Code Sample
Specifies whether or not the annotation will
be editable.
Map1.Annotations.Editable = True
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
34
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
Property
Description
Code Sample
Type
Specifies the Annotation object type.
If Map1.Annotations(2).Type_
= miTextAnnotation Then _ Print “It is text”
Graphic
This contains a Graphic object, which has
properties for the Annotation.
See Graphic Object in Chapter 14 on
page 224.
Notice that there is no property for position, symbol style, or text in the annotation object. The
annotation’s graphic property contains a graphic object containing this information. To modify the
annotation, modify the annotation’s graphic object.
The following code adds a symbol to a specified location:
'Add a symbol at location
Map1.Annotations.AddSymbol X1, Y1
Creatable Objects in MapX
In the MapX object model, the following objects are creatable. In other words, you can create
stand-alone objects with these object classes.
AffineTransform
BindLayer
BitmapSymbols
CoordSys
Datum
Feature
Fields
LayerInfo
Map
ODBCQueryInfo
OCIQueryInfo
Parts
Point
Points
Rectangle
RowValue
RowValues
State
Style
Variables
NotesQueryInfo
NotesViewInfo
The following examples show how to create a stand-alone style object, display a style-selection
dialog box, and use the new style to set the override style of a layer.
When using programming languages like Visual Basic and Delphi and you are required to specify
the MapX version number after the object name (e.g., “MapX.Style.5”).
Note:
In Visual Basic, specifying the MapX version number is only required if you do not have
MapX Object embedded in your form.
C++ Example
CMapXStyle style;
style.CreateDispatch(style.GetClsid());
// can also use style.CreateDispatch("MapX.Style.5"),
// but above is more portable between versions of MapX
style.PickRegion();
m_ctrlMapX.GetLayers().Item(1).SetStyle(style);
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
35
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 3: MapX Basics
Delphi Example
Var
s : variant;
begin
s := CreateOleObject('MapX.Style.5');
s.PickRegion;
MapObject.Layers.Item(1).Style := s;
end
Visual Basic Example
If you have the MapX Object embedded in a Visual Basic form…
Dim s as new MapXLib.Style
s.PickRegion
Map1.Layers(1).OverrideStyle = True
set Map1.Layers(1).Style = s
If you do not have the Mapx Object embedded in a form…
Dim objStyle as new object
Set objStyle = CreateObject(“MapX.Style.5)
Map1.Layers(1).OverrideStyle = True
objStyle.PickRegion
set objMap.Layers(1).Style = objStyle
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
36
MapX_Mobile_DevGuide.pdf
4
Mapping Concepts
Now that you have installed MapX and been enticed by the wide
variety of features and functionality, you are probably anxious to get
mapping. However, first, take a few minutes to read this chapter,
especially if you are new to MapX. This chapter gives you a solid
understanding of the concepts for successful mapping with MapX.
In this chapter:
Š
Š
Š
Š
Š
Organizing Your Data and Maps: An Overview of Tables . . . . .
What Are GeoSets? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Map Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Putting Your Data on the Map . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Power of MapX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
38
39
39
40
Developer Guide
Chapter 4: Mapping Concepts
Organizing Your Data and Maps: An Overview of Tables
To use MapX, you need the files that contain your records and maps that come from MapInfo.
MapX organizes all its underlying information in the form of MapInfo tables; each table is a group
of MapInfo files that is used to build a layer in a map.
How Files Make Up a Table
All MapInfo tables will have the following files:
•
<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.
MapInfo Tables and MapX Layers
Each mappable MapInfo table can be displayed as a layer in a map. For example, you can display
a table of customers, a table of streets, and a table of county boundaries.
Think of these layers as transparencies where each layer contains a different part of the map. The
layers are stacked one on top of the other and allow you to see all aspects of the map at the same
time.
What Are GeoSets?
A geoset keeps a collection of map layers and their settings easily available to you. Geosets are
data sets made up of standard MapInfo format map files (.tab) of the same geographic region,
hence the name geoset. Geosets help you to avoid the time consuming task of opening and
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
38
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 4: Mapping Concepts
displaying layers individually each time you want to work with them as a sample map. The
extension for a geoset is .gst. A .gst is a text file that contains several metadata keys that tell MapX
what tables to display and how to display them.
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.
MapX will not open a MapInfo workspace (.wor file type).
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.
Putting Your Data on the Map
Datasets enable you to bind data your maps. For example, if you have a Microsoft Access
database of sales by county, you could bind that data and display it on a counties map in order to
spot trends in sales patterns by county that are not easily identified in the tabular data alone.
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. See Putting Your Data On The Map in Chapter 6 on page 59 for a list of data sources
you can bind.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
39
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 4: Mapping Concepts
Tools to Get the Job Done
Most mapping applications provide an assortment of toolbar buttons (tools) to aid with common
drawing tasks (such as drawing a line on the map) and navigation tasks (such as zooming in).
MapX provides several common mapping tools, plus you can also create your own custom tools.
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.
The Power of MapX
Now that you have an overview of tables, layers, geosets, map features, datasets and tools, you
are ready to bring the full capabilities of MapX into play. With MapX, you can search a layer in a
map and locate a specific feature within the layer. For instance, you could use it to find the closest
dealer to Lackawaxen, PA. Or, you can calculate distances between health care providers and
their patients, then get counts on how many patients live within a given radius of a particular
hospital. Or, you could shade boundaries (counties, towns, states, countries) according to the total
number of customers in each one or according to the number of customers who purchased within
the last year. MapX refers to this as thematic mapping.
As you become better acquainted with MapX, you will find that its applications are limited only by
your imagination.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
40
MapX_Mobile_DevGuide.pdf
5
Mapping in Layers
This chapter presents the relationship between tables and maps, and
shows how they are layered to create the level of detail you want.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Maps as Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Layers Collection: Building Blocks of Your Map . . . . . . . .
Some Properties of the Layers Collection . . . . . . . . . . . . . . . . .
Some Methods of the Layers Collection . . . . . . . . . . . . . . . . . .
Creating Layers with the LayerInfo Object . . . . . . . . . . . . . . . .
The Layer Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Layer Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Examining Layers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Checking the Feature Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Zoom Layering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generating Labels for a Layer . . . . . . . . . . . . . . . . . . . . . . . . . . .
Annotations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Raster Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Animation Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Drawing Layers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
42
42
44
45
46
49
50
50
51
52
53
55
56
57
58
Developer Guide
Chapter 5: Mapping in Layers
Maps as Layers
You have already been introduced to the concept of computer maps as a collection of layers in the
previous chapter. Each MapInfo table that contains graphic objects can be displayed as a layer in
a Map window. For example, you can display a table of customers, a table of streets, and a table
of county boundaries.
Think of these layers as transparencies where each layer contains a different part of the map. The
layers are stacked one on top of the other and allow you to see all aspects of the map at the same
time. For example, one layer may contain country boundaries, a second layer may have symbols
that represent capitals, and a third layer might consist of highways. Laying these transparencies
one on top of the other builds a complete map.
Now let’s get into the specifics of creating a map.
The Layers Collection: Building Blocks of Your Map
The Layers collection is a property of the Map control and contains Layer objects. These Layer
objects, which are built from MapInfo tables, make up your map. Each layer contains different map
features, such as regions, points, lines or text. The Layers collection has properties and methods
used to perform operations such as adding and removing Layer object(s) from the collection.
How to Get a Layers Collection
One way to get a Layers collection is to load a geoset at design-time. As we said in the previous
chapter, a geoset defines a collection of map layers and their settings.When you add a Map
control to a form, by default MapX loads the United States Geoset (US.GST). In other words, you
start with the Layers collection as defined in the United States Geoset.
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
42
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
1. Click Geoset from the Properties Window.
2. Click the drop-down arrow found on the Geoset row.
3. Select World Countries from the list of available Geosets.
The Layers collection as defined in the World Countries Geoset will be loaded when you run your
application. The World Countries map will appear in your Map control.
The Property Page
A quick way at design-time to see all the Layer objects that comprise a Layer collection is through
the Property Page. The Property Page is an extremely useful place to alter the properties of a map
while you are designing and testing an application. In this case, we will use it to see the Layers in
the World Countries collection.
1. Click Custom from the Properties Window.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
43
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
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.
Some Properties of the Layers Collection
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.
Note:
For a complete listing of Layers Collection methods and properties, see Layer Object
and Layers Collection in Chapter 14 on page 239.
Get the Number of Layers in a Collection
A very useful property of any collection is the Count property. This will tell you the number of items,
in this case the number of layers, in a collection. This is used if you want to cycle through each
item in the collection, for example, getting the names of each item:
Dim x as integer
For x = 1 to Map1.Layers.Count
Print Map1.Layers(x).Name
Next
Get a Layer from the Collection
The Item property gets a specific Layer object from the collection. The Item property returns one of
the layers as an object and is the default method for the Layers collection. You can reference
layers by index value, such as 1, 2, and so on, but you can also reference layers by their names,
such as Highways or Cities:
Dim lyr as Layer
Set lyr = Map1.Layers.Item(“Highways”)
-orDim lyr as Layer
Set lyr = Map1.Layers.Item(3)
In your application you will be frequently referencing objects, properties, and methods through the
Layers collection. You can use the fact that Item is the default method to abbreviate your code.
For example, each of these lines of code makes an identical assignment.
Map1.Layers.Item(3)Visible = False
Map1.Layers(3).Visible = False
Map1.Layers.Item(“Highways”).Visible = False
Map1.Layers(“Highways”).Visible = False
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
44
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Get the Geographic Extent of a Collection
The Bounds property returns a Rectangle object representing the geographic extents of all layers
in the collection (except the UserDraw layer). This property is useful if you want to zoom the map
out far enough to show all objects in all layers:
'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
Some Methods of the Layers Collection
The Layers Collection has several methods that control which layers are in the collection and how
they are displayed. There is also a method that will enable the user to call the Layer Control dialog
allowing users to manipulate the methods and features of a layer. The methods may also be set at
design-time using the Property Page, as discussed earlier in this chapter.
Note:
For a complete listing of Layers Collection methods and properties, see Layer Object
and Layers Collection in Chapter 14 on page 239.
Using the Layer Control Dialog
The LayersDlg method presents a dialog where the user can add layers, remove layers, change
layer ordering, and change layer properties.
If the user clicks OK, the changes made within the dialog will immediately be applied to the map.
Map1.Layers.LayersDlg
Display Options of the Layer Control Dialog
The Display Options dialog enables you to customize the display for each layer in a Map window.
In Layer Control, the user can select a layer and click on the Display button to bring up the Display
Properties dialog. There, the user can change the default styles for the layer and set the zoom at
which a layer displays For example:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
45
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Display Mode
When a user first opens a map, boundaries, lines, points, and text are all displayed using defaults
in the map’s Geoset file. The user can change how objects display by using the Display Mode
section of the Display Options dialog.
For example, the user wants to change the display of streets to a dashed red line. In Layer Control
the user would choose the street layer and click the Display button. This brings up the Display
Options dialog. The user would check the Style Override box to activate the Style Override button
(large gray button). MapX displays the override buttons that are appropriate for the type of objects
in the layer. For example, if the layer contains streets, a line style override button displays. Clicking
on it to will access the Line Style dialog where the user can change the width, style, and color of
the streets.
For boundary layers, the style override button brings up the Region Style dialog where the user
can change both the fill and borders of boundaries. The Symbol Style dialog displays when the
user wants to override the style for layers containing symbols or points. The Style Override is only
in effect during the current work session, as are the other display settings. To make them
permanent, you would have to modify the geoset.
Creating Layers with the LayerInfo Object
The LayerInfo object is used to add new or existing layers to your map. The object has two
properties and one method.The Type property is used to specify the type of layer you wish to add
to the map, its value is set to one of the LayerInfoTypeConstants. Depending on the LayerInfo
type, you must specify a certain set of parameters via the AddParameter method. For a complete
list of LayerInfo types and their required parameters see the LayerInfo Object in Chapter 14 on
page 271. Once set, properties can be viewed or changed via the Parameter property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
46
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Creating A Layer
You can create new MapInfo tables to add to your map. These tables can be permanent
(miLayerInfoTypeNewTable) which means the layer will be created on your hard drive and remain
after your application is done running, or temporary (miLayerInfoTypeTemp) which means the
layer will be created in memory and will not remain after your application is done running. The
examples below show the creation of new permanent and temporary layers.
'Create a new permanent layer that contains all features selected in the
'USA layer
Dim li as New MapXLib.LayerInfo
Dim ftrs as MapXLib.Features
Dim flds as MapXLib.Fields
Dim ds as MapXLib.Dataset
'the new table will have the same columnar structure as the USA layer
Set ds = Map1.Datasets.Add (miDatasetLayer, Map1.Layers("USA"))
Set flds = ds.Fields
'the new table will contain all features currently selected in the USA
'layer
Set ftrs = Map1.Layers.Item("USA").Selection.Clone
li.Type = miLayerInfoTypeNewTable
li.AddParameter "Name", "USA Selections"
li.AddParameter "FileSpec", App.Path & "\USA_Selections.tab"
li.AddParameter "Fields", flds
li.AddParameter "Features", ftrs
li.AddParameter "OverwriteFile", "1"
'The layer is created when added to the layers collection
Map1.Layers.Add li
'Create a new temporary layer that contains all features selected in the
'USA layer
Dim li as New MapXLib.LayerInfo
Dim ftrs as MapXLib.Features
Dim flds as MapXLib.Fields
Dim ds as MapXLib.Dataset
'the new table will have the same columnar structure as the USA layer
Set ds = Map1.Datasets.Add (miDatasetLayer, Map1.Layers("USA"))
Set flds = ds.Fields
'the new table will contain all features currently selected in the USA
layer
Set ftrs = Map1.Layers.Item("USA").Selection.Clone
li.Type = miLayerInfoTypeTemp
li.AddParameter "Name", "USA Selections"
li.AddParameter "Fields", flds
li.AddParameter "Features", ftrs
'The layer is created when added to the layers collection.
Map1.Layers.Add li
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
47
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Adding an Existing Layer
The LayerInfo object is also used to add existing layers to your map. When using
LayerInfoTypeTab the only parameter you need to specify is the FileSpec, the physical location of
the MapInfo table you wish to add to the map. There are several other optional parameters that
allow you to set the visibility of the layer (Visible parameter) or to create a dataset from the newly
added layer (AutoCreateDataset parameter and DatasetName parameter). Below is an example
that uses these optional parameters, it adds the USA layer to the map, makes the layer invisible
and creates a dataset from the layer.
Dim li as MapXLib.LayerInfo
Set li = CreateObject ("MapXMobile.LayerInfo.5")
li.Type = miLayerInfoTypeTab
li.AddParameter "FileSpec", "\My Documents\Maps\USA.tab"
li.AddParameter "Visible", False
li.AddParameter "AutoCreateDataset", True
li.AddParameter "DatasetName", "dsUSA"
Map1.Layers.Add li
Remove a Layer
The Remove method removes a specified layer from the map.
Map1.Layers.Remove 3
Remove All Layers
The RemoveAll method removes all layers from the map.
Private Sub btnLayersRemoveAll_Click()
Dim nLayers As Integer
nLayers = Map1.Layers.Count
' remove all of the layers
Map1.Layers.RemoveAll
nLayers = Map1.Layers.Count
Reposition a Layer
The Move method repositions a layer in the Layers collection. The first parameter is From position
(the top layer = 1) and the second parameter is the To position.
Map1.Layers.Move 1,2
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
48
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
The Layer Object
The Layer object represents vector mapping data in the form of a collection of map features having
a predominant feature type, such as regions, lines or symbols. Typically, a Layer object
corresponds to the geographic objects from one MapInfo table. Each of the Layer objects in a
Layer collection behaves independently of the others. Their styles may be changed, their zoom
layering altered, etc., on an individual basis, without affecting any of the other layers.
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
Chapter 7: Features and Selections.
Some Layer Properties
Note:
For a complete listing of the Layer object methods and properties, see Layer Object and
Layers Collection in Chapter 14 on page 239.
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
49
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
ZoomLayer
Sets zoom layering on or off.
Map1.Layers(“States”).ZoomLayer = True
ZoomMax
Sets the maximum zoom level at which a layer will be visible.
Map1.Layers(“States”).ZoomMin = 580
ZoomMin
Sets the minimum zoom level at which a layer will be visible.
Map1.Layers(“States”).ZoomMin = 45
Layer Order
Map layers in a Layers collection display in increasing index order (i.e., Layers(1) is the top layer,
Layers(2) is the layer underneath Layer(1), etc.), with the bottom layer drawn first and the top layer
drawn last. It is important to order your layers correctly.
For example, suppose that you have a layer of customer points and a layer of census tracts. If the
layers are incorrectly ordered in the Layers collection, MapX will draw the customer points first and
then display the census tract layer second. Your points would be obscured by the census tract
layer.
You can reorder how layers are displayed in a Map at design time. From the Layers tab of the
Property Page, select the layer(s) you want to reorder and choose either the Up or Down button to
move the layer(s) to a position above or below its current position.
To allow the user to reorder layers at runtime, use the LayersDlg method to present the Layer
Control dialog, as discussed elsewhere.
Layer order is also important when you use the Select tool. The Select tool selects objects from
the topmost Selectable layer. If you have several objects at the same location, it is difficult to select
the exact one you want. You can reorder your layers so that the layer you want to select from is
the new topmost layer.
Examining Layers
There are many instances where you might want to examine layers in a collection. Here’s a simple
code fragment to iterate through a Layers collection to determine what types of layers are present,
and to display a message in a dialog box indicating the layer type.
Dim lyr as Layer
For Each lyr in Map1.Layers
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
50
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Select Case lyr.Type
Case miLayerTypeNormal
MsgBox “Layer ” & lyr.Name
Case miLayerTypeRaster
MsgBox “Layer ” & lyr.Name
Case miLayerTypeSeamless
MsgBox “Layer ” & lyr.Name
Case miLayerTypeUnknown
MsgBox “Layer ” & lyr.Name
Case miLayerTypeUserDraw
MsgBox “Layer ” & lyr.Name
Case miLayerTypeDrilldown
MsgBox “Layer ” & lyr.Name
End Select
Next
& “ is a normal layer”
& “ is a raster layer”
& “ is a seamless layer”
& “ is an unknown layer”
& “ is a user draw layer”
& “ is a drilldown layer”
In the code fragment we are using MapX-defined constants for all the layer types. These constants
are collectively known as LayerTypeConstants.
Checking the Feature Type
This code fragment iterates through the Layers collection by index. It examines each Layer object
in the collection and determines the type of features present in the layer.
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 miFeatureTypeUnknown
MsgBox “Layer ” & lyr.Name & “ contains unknown _
features”
Case miFeatureTypeText
MsgBox “Layer ” & lyr.Name & “contains text features”
End Select
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
51
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
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 following 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.
Dim lyrStreets As Layer
`Creates the layer object
`Sets the Streets table as the layer object and orders the layer in `the map
as number 3.
Set lyrStreets = Map1.Layers.Add(“Streets.tab”, 3)
lyrStreets.ZoomLayer = True
`Sets zoom layering to true
lyrStreets.ZoomMin = 0
`Sets minimum zoom to 0 miles
lyrStreets.ZoomMax = 5
`Sets maximum zoom to 5 miles
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
52
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Once you set zoom layering for a layer, when you zoom within the minimum and maximum zoom
levels, the layer will display on the map. You can zoom in on your map with the zoom tools or the
ZoomTo method of the Map object. With the ZoomTo method you specify a zoom level and the x
and y coordinates to center the map.
Map1.ZoomTo 3, -70.26, 44.05
Since the zoom value of 3 miles is within the minimum and maximum zoom levels, the Streets
layer will center around the point -70.26, 44.05 and display 3 miles of the map across the width of
the map control.
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.
Generating Labels for a Layer
MapX provides many ways to label attributes of geographic objects in a map layer. Their drawn
location is based on the location of the geographic object’s centroid and additional information
such as anchor point and offset.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
53
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
In addition to label content, you control the position, display, and look of automatic labels by using
properties in the LabelProperties object. You can set conditions for displaying labels, in the style in
which will display, and in what position for all the objects in the layer.
You can also control the appearance of individual labels via the Labels Collection. There is a
Labels collection associated with each layer, and each item in the collection is a Layer Object. By
manipulating the properties of a Label Object you can control the display of a label independently
from the rest of the labels in that layer
Controlling Label Display
To automatically generate labels for a layer, set the layer's AutoLabel property to True.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
54
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
You can also set the appropriate style options. Make the style changes you want. When you return
to the map, the selected labels display with the style changes you specified.
There are also background options. Set the appropriate options to have no background, or halo to
create a halo effect around the text. This puts the text into relief from whatever it covers (e.g., part
of a region, or a street, etc.).
Interactive Labeling
Although you will probably do most of your labeling automatically, in some cases you may want to
create labels one at a time, using a Label tool. The Label tool is one of the standard tools built into
MapX. To activate the tool, set the Map.CurrentTool property to miLabelTool (1010); the user will
be able to label a map feature by clicking on the feature.
The easiest way to remove all labels in a layer is to use the Visibility setting. It will disable the
display of all the labels in that layer, both automatic and custom labels. To clear only the custom
labels (those labels placed using the Label tool), use the ClearCustomLabels method.
Labels can be moved interactively by selecting a label or labels with the select tool (miSelectTool
1007) then dragging the label(s) to a new location. A label that has been edited manually then
becomes an item in that layer's Labels Collection. It can then be edited programmatically by
setting properties of the Label Object.
Annotations
Although the labeling feature takes care of most of your text needs, you may still need to create
text objects to annotate your map. Unlike labels, text annotations are not connected to data— you
can place an annotation anywhere on the map, even if there are no features at that location.
To add text or symbol annotations to your map, use the methods and properties in the Annotations
collection and object or add text or symbols using the Symbol and Text tools (miSymbolTool 1005,
miTextTool 1006).
Each Map has a collection of Annotations (Map.Annotations property). Annotations are either
symbol or text objects, and are drawn on top of the map.
Annotations are typically used to add text messages to a map, or to put symbols on a map. These
annotations scale with the map as you zoom in and out. Annotations are not tied to a particular
map layer. Annotations are always on top.
Note that the Annotation object has no properties for setting the position, symbol style, or text. To
control these aspects of an annotation, you use the Annotation.Graphic property to obtain a
Graphic object, then modify the Graphic object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
55
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Raster Images
Raster images are a type of computerized picture consisting of row after row of tiny dots (pixels).
Raster images are sometimes known as bitmaps. Aerial photographs and satellite imagery are
common types of raster data found in GIS.
Below are the raster image formats supported in MapX:
•
TIFF (*.tif)
•
MrSID (*.sid)
•
ECW (*.ecw)
•
Spot (*.bil)
•
Jpeg (*.jpg)
•
PCX (*.pcx)
•
GIF (*.gif)
•
Windows Bitmap (*.bmp)
•
PNG (*.png)
•
Photoshop (*.psd)
•
Targa (*.tga)
•
Windows Metafile (*.wmf)
•
JPEG200 (*.jp2)
Displaying Raster Images as Map Layers
With MapX you can display raster images (bitmaps) as backdrops to the maps you create. You
then can overlay additional data, such as street maps and customer locations, on top of the image.
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.”
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
56
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
How to Display a Raster Image
Raster images can be self-registering (GeoTiff images), that is they contain geographic
information that tells MapX where to display them, or they can have an associated .TAB file that
tells MapX where to display the image. The .TAB file is created by using MapInfo Professional to
'register' the image. Self-registering rasters are added to the map using a LayerInfo object of type
miLayerInfoTypeRaster. Raster images with an associated tab file are added to the map using a
LayerInfo object of type miLayerInfoTypeTab.
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 realtime applications. For example, you can develop a fleet-management application that represents
each vehicle as a point object. You can receive current vehicle coordinates by using GPS (Global
Positioning Satellite) technology, and then update the point objects to show the current vehicle
locations on the map. In this type of application, where map objects are constantly changing, the
map redraws much more quickly if the objects being updated are stored in the animation layer
instead of a conventional layer.
Initially AnimationLayer is set to null. You can assign a Layer object to the property to make that
Layer the animation layer (it can be a regular layer or user draw layer). When a layer is assigned to
the AnimationLayer property, it is drawn on top of all layers, including the Annotations layer and
selections. The layer is still in the same position in the Layers collection. Floating objects like
legends are still displayed on top of the animation layer, although they don't have to be re-drawn
each time because they are clipped out. If a normal layer is used as the animation layer, selections
and labeling will still work.
Example
Set Map1.Layers.AnimationLayer = Map1.Layers(3)
The property can be used to identify what layer is currently the animation layer (if any):
for each lyr in Map1.Layers
if Map1.Layers.AnimationLayer = lyr then ...
end if
next
To turn off the animation layer, you assign null to it:
Set Map1.Layers.AnimationLayer = nothing
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
57
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 5: Mapping in Layers
Drawing Layers
Layers.Add with a LayerInfo object of type miLayerInfoTypeUserDraw gives developers the ability
to add UserDraw layers to a map. UserDraw Layers allow you to draw objects in a layer that are
independent of any map features. UserDrawLayers are used in conjunction with the
DrawUserLayer event, which is fired when the layer needs to get drawn. There can be any
number of user draw layers.
How It Works
First, you add a user draw layer to your layers collection:
' this sets the UserDraw Layer to “My Layer”
Dim li as MapXLib.LayerInfo
Dim lyr as MapXLib.Layer
Set li = CreateObject("MapXMobile.LayerInfo.5")
li.Type = miLayerInfoTypeUserDraw
li.AddParameter "Name", "UserDraw"
Set lyr = Map1.Layers.Add (li, 1)
Then you put the code to do the drawing on the layer in the DrawUser Layer event. When the
application creates a UserDraw layer using the Add method of the Layers collection, an event is
fired to the application when the window needs updating.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
58
MapX_Mobile_DevGuide.pdf
6
Putting Your Data On
The Map
Datasets enable you to bind user data to your maps. For example, if
you have a Microsoft access database of sales by county, you could
bind that data to a map and spot trends or notice correlations.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
What Is Data Binding? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Power of Adding Your Data to a Map . . . . . . . . . . . . . . . . .
How to Add Your Data to a Map . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Datasets Collection . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Datasets.Add Method . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Fields Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Fields.Add Method . . . . . . . . . . . . . . . . . . . . . . . . . . .
Displaying Your Data as a Layer of Points (BindLayer) . . . . . .
Making Your New Layer of Points a Permanent Layer . . . . . . .
How Data Binding Uses the GeoDictionary . . . . . . . . . . . . . . . .
The Different Types of Data Sources . . . . . . . . . . . . . . . . . . . . .
60
60
60
61
61
64
64
65
68
68
70
Developer Guide
Chapter 6: Putting Your Data On The Map
What Is Data Binding?
Data binding is the process of bringing data from a data source into MapX Mobile by associating
rows of data with geographic elements (streets, boundaries, etc.) on your map.
MapX Mobile lets you bind to several different types of DataSources. In MapX Mobile, 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
•
MapInfo Layer
•
SafeArray
•
Unbound
The Power of Adding Your Data to a Map
There are two major advantages to binding your own data to a map:
•
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 in
Chapter 9 on page 94.
•
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 Thematic Mapping and Analysis in Chapter 8 on
page 78.
How to Add Your Data to a Map
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
60
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On 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.
Using the 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.
Adding a Dataset Object or removing a Dataset object from a specified collection is accomplished
using the methods listed below:
Method
Description
Code Sample
Add
Creates a specified Dataset and adds it to
the collection.
Set ds = Map1.Datasets.Add_
(miDatasetADO, rs)
Remove
Removes a specified Dataset object from the
Datasets collection.
Map1.Datasets.Remove 2
Using the Datasets.Add Method
With the Datasets.Add method, you can bind data from a data source into MapX. This will tie data
from an external data source to a map. The Datasets.Add method allows you to designate a
specific Dataset and add it to a collection of Datasets. Let’s look at the syntax of the Datasets.Add
method.
Note:
Optional parameters are in [square brackets].
Datasets.Add Type, SourceData, [Name], [Geofield], [SecondaryGeofield], [BindLayer], [Fields],
[Dynamic]
Type Parameter
This parameter is the type of Dataset being added. This parameter takes a DatasetTypeConstants
value.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
61
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
DatasetType Constants
Type
Description
miDatasetLayer
This is a MapInfo table.
miDatasetADO
This is an ADO dataset type constant.
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:
Dataset Type
Valid Source Data
miDatasetLayer
This is a MapInfo Layer object.
miDatasetADO
ADOCE recordset.
miDatasetSafeArray
Safe Array
miDatasetUnbound
Nothing (instead, use the RequestData event to access data whose
format is known only to the programmer).
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
62
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
If a Fields collection is specified, the Geofield parameter refers to columns in the Fields collection
rather than in the source data.
Secondary Geofield Parameter
This parameter is only required when the layer that a Dataset is being bound to has a key column
that is not unique. For example, using the MapInfo table “United States Counties” to bind data
against requires a secondary geofield parameter because county names are not unique to one
state. Multiple states in the table have counties named “Warren” or “Washington”, among others.
Thus, more information is needed to resolve the potential ambiguity during the data binding
process. When do we want to bind our data to Warren, New York and when to Warren, New
Jersey? By specifying the “County” column as the Geofield and the “State” column as Secondary
Geofield, MapX can figure out which data gets bound to Warren, New York and which data gets
bound to Warren, New Jersey by refining the data binding process to counties within each state.
This concept is identical to the Refining Boundary when creating a Find object. For additional
information, see Chapter 9: Finding Features on a Map.
If a Fields collection is specified, the SecondaryGeofield parameter refers to columns in the Fields
collection rather than in the source data.
BindLayer Parameter
This parameter specifies the map layer to attach your data to if you are binding attribute data, or, a
BindLayer Object if incoming data is to be georeferenced to a point reference file (such as Zip
Codes) or contains Long/Lat values. This is an optional parameter, and if not specified, MapX
searches layers in the GeoDictionary to attach to.
If you know which map layer should be bound to, you should specify it for performance reasons.
When doing BindLayer matching, the Geofields must be unique. Only the first item of a non-unique
set of data will be matched. The rest are ignored. The BindLayer is discussed in more detail later
in this chapter.
Note:
When miBindLayerTypeXY is used within DataSets.Add a temporary table will be created
with one column named “GeoName”, in order for a fields collection to be recognized a new
Databind must be created on a permanent layer.
Fields Parameter
This parameter is a Fields object that is a collection of Field objects. The Field objects are used to
describe which fields from the data source to bring in, and which aggregation function to use if
more than one record for the data source matches a particular map feature. This will set up a
collection of fields (columns) you wish to bind to the map. This is an optional parameter, and if not
specified, all columns are brought in, and the data values are summed if more than one record is
encountered per feature. The Fields collection is discussed in more detail later in this chapter.
If a Fields collection is specified, the Geofield and SecondaryGeofield parameters refer to columns
in the Fields collection rather than in the source data.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
63
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
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.
Using the Fields Collection
A data source may have many columns of data. MapX has overhead for each column of data that
is bound, so you should only bind data that is needed in the map (such as data you want to
thematically map or label with). Use the fields parameter of Datasets.Add to set up a Fields
collection of the fields (columns) you want to bind to the map.
Note:
When declaring a fields variable, declare it as “MapXLib.Fields”. This is to prevent
conflicts with the ADOCE “Fields” object.
set flds = CreateObject("MapXMobile.Fields.5")
You can access a Dataset’s Fields collection through the Dataset.Fields property.
Method
Description
Code Sample
Add
Adds a field to a Fields collection.
flds.Add “Sales”, “Sum_of_Sales” _
, miAggregationSum
Remove
Removes a field from a Fields collection.
flds.Remove 3
RemoveAll
Removes all Field objects from the collection.
flds.RemoveAll
Using the Fields.Add Method
The Fields.Add method enables you to add a column of data from your data source as a field to
the Fields collection. The Fields collection is built to use with the Datasets.Add method (or with the
Themes.Add method; see Thematic Mapping and Analysis in Chapter 8 on page 78) 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 Fields.Add method on page 206.
Data Aggregation
The Aggregate Function parameter of the Fields.Add method determines how MapX computes the
Field value when multiple matches are found.
For example, if the data looked like the following:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
64
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
STATE
SALES
CA
120
NY
100
CA
50
CA
110
Here, there are three sales in California, and since only one data value will be attached to
California, we need to tell MapX to either sum the sales, average the sales, or count the sales.
The Aggregate Function parameter of the Fields.Add method defaults to miAggregationIndividual
for string columns, and miAggregationSum for numeric columns.
The following are the aggregates used to handle multiple matches:
Aggregation Function Constants
Here is a list and brief description of the Aggregation Function Constants.
Constant
Description
miAggregationAuto
Automates MapX’s selection of aggregation method based on the data in use.
miAggregationSum
Sums up the data.
miAggregationAverage
Takes an average of the data.
miAggregationIndividual
Pulls in each individual record.
miAggregationCount
Counts the records.
Displaying Your Data as a Layer of Points (BindLayer)
BindLayer data binding is a type of data binding where source data is used to create a new layer of
points at the locations specified by your data. This happens in two cases:
•
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 on page 67.
•
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 on page 67
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
65
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
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.
BindLayer Object Properties
Property
Description
Values
LayerType
Specifies the layer type that the data is being
bound to.
A BindLayerTypeConstant:
• MiBindLayerTypeNormal
• MiBindLayerTypeXY
• MiBindLayerTypePointRef
CoordSys
Specifies the coordinate system in which the
layer will be created.
A CoordSys Object
FileSpec
Allows you to specify the name and location of
a file, so that the Datasets.Add method can
create a permanent layer instead of a temporary layer.
A text string that identifies a file
path and file name.
KeyLength
A positive number, representing the desired
size of the character column in the resulting
layer.
A numeric value (1-254).
LayerName
Specifies the name of the layer which to bind
the data to if LayerType is miBindLayerTypeNormal. It is the name of the newly created
layer if LayerType is miBindLayerTypeXY or
miBindLayerTypePointRef.
A string value.
RefColumn1
The field containing the longitude when LayerType is miBindLayerTypeXY, or the field containing the reference value (such as ZIP
Code) if LayerType is miBindLayerTypePointRef.
A string or integer referencing a
column (one-based index).
RefColumn2
Specifies the field containing the latitude
when LayerType is miBindLayerTypeXY.
A string or integer referencing a
column (one-based index).
ReferenceLayer
Specifies the name of the reference file to use
if BindLayer.LayerType is miBindLayerTypePointRef.
A string.
The order of operations for using a BindLayer object is as follows:
1. Create a BindLayer object.
2. Use this object when adding the Dataset by passing it as the BindLayer parameter in the
Datasets.Add method.
How to create a BindLayer object and display your X / Y or point reference data are shown below.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
66
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
Displaying Your X / Y Data as a Layer of Points on a Map
If your data contains X / Y coordinates, you can create and display a layer of point features
through data binding. Use a BindLayer object, and set:
•
Its LayerType property to be miBindLayerTypeXY.
•
Its RefColumn1 property to be the name or index (one-based) of the column containing
the X coordinate values.
•
Its RefColumn2 property to be the name or index (one-based) of the column containing
the Y coordinate values.
Displaying Your ZIP Code Data as a Layer of Points on a Map
If you have a table of data that has no X / Y coordinates but it has point reference information such
as ZIP Codes, you can still display your data as points on a map. A process known as point
reference binding allows you to data bind against a separate reference layer containing X / Y
coordinates for your ZIP Code-based table of data. You do this by specifying the reference layer in
the BindLayer object when setting up the BindLayer object, as shown below.
MapX supplies a table called Us_zips.tab in the \MapInfo\MapX 5.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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
67
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
Making Your New Layer of Points a Permanent Layer
It’s easy to make your new layer of points, created with a BindLayer object, a permanent MapInfo
table. Use the BindLayer.Filespec property or specify the name and location of a file, so that the
Datasets.Add method can create a permanent layer instead of a temporary layer. If you do not
assign this property, the layer is temporary. This property applies to both X / Y data binding and
point reference (zip code) data binding.
This example creates a permanent table through data binding using X / Y coordinates.
Dim ds as MapXLib.Dataset
Dim BindLayerObject MapXLib.BindLayer
Set BindLayerObject = CreateObject("MapXMobile.BindLayer.5")
'Where to save the newly created permanent table
BindLayerObject.FileSpec = “\My Docuemtns\Maps\Dealers.TAB”
BindLayerObject.LayerType = miBindLayerTypeXY ‘Binding to Long/Lat
BindLayerObject.LayerName = "US Dealers" 'Layer Name to use
BindLayerObject.RefColumn1 = ("LONG") 'Name of Longitude column
BindLayerObject.RefColumn2 = ("LAT") 'Name of Latitude column
'Add the dataset and create the permanent layer
Set ds = Map1.Datasets.Add(miDataSetADO, rs, "My Dealers", "Dealer", ,
BindLayerObject)
How Data Binding Uses the GeoDictionary
MapX uses a GeoDictionary file (named GEODICT.DCT by default) to keeps track of information
related to data binding. MapX comes with a utility—GeoDictionaryManager50.EXE—which helps
you manage the GeoDictionary.
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:
•
Determines which column in the data source contains geographic information.
•
Determines which map layer to bind to.
Both of these behaviors are optional. There are parameters so that you can explicitly specify which
column in the data source contains the geographic information, as well as which map layer should
be bound to. If you know either of these values, you should specify them explicitly to improve
performance.
For MapX to be able to bind data to a map layer, the following things need to be true:
1. The map’s geographic key column needs to be indexed.
Most maps come with indexed key columns when they are installed, but it is up to the map
maker to decide which columns are key columns. For example, the United States table
could have at least 3 key columns: state name (“New York”), state abbreviation (“NY”),
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
68
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
and FIPS code (36). The United States map that MapInfo ships has the first two as key
columns, thus requiring data from the data source to also have either state name or
abbreviation.
2. The map and its key columns must be specified in the GeoDictionary.
Some key columns from the map layer might not contain unique values. An example of
this is United States county names: multiple states have counties named “Warren” or
“Washington”. Thus, when a row of data has the county name “Washington,” MapX needs
more information to resolve the ambiguity. For the United States Counties example, State
is used to resolve ambiguity. The parameter SecondaryGeoColumn is used to specify the
column in the data source that contains the information needed to resolve the ambiguity.
The GeoDictionary contains information about which maps have non-unique keys and
what their refining map is.
MapX Events Used by Data Binding
Once a column is defined as the geographic column from the data source, and a map layer to bind
to is determined, binding begins. Each row of the data source is ‘matched’ to a feature and the
data is brought in. If a row contains a geographic column that doesn’t match a feature (perhaps a
typo [“NA” instead of “MA”] or simply a data value that’s not on the map [“Puerto Rico”]), a
DataMismatch event is fired to notify the container. You can ignore the DataMismatch event, in
which case MapX simply ignores the row.
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
miBindLayerTypeXY. Create the new layer with only the X and Y columns by passing a
Fields object, with only those two columns specified, in the Datasets.Add method.
2. Bind the rest of the data to this newly created layer. Use Datasets.Add with normal
binding, using the X field for the Geofield parameter and the Y field as the
SecondaryGeofield parameter. This second Dataset can be refreshed.
Note:
This method will not add new features to the layer when new rows are added to the data
source.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
69
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 6: Putting Your Data On The Map
The Different Types of Data Sources
MapX lets you bind to several different types of DataSources. The first argument to the
Datasets.Add method lets you specify a DataSetTypeConstant value (see
DataSetTypeConstants in Appendix G on page 453), which dictates the type of data binding
you wish to perform.
miDatasetADO (ActiveX Data Objects)
The SourceData parameter to Datasets.Add must be a ADOCE Recordset object. An ADOCE
Recordset object is creatable and the Source property of the Recordset object may be set to a
simple text command (such as a directory name for a file system provider or an SQL statement for
a DBMS-type provider).
miDatasetLayer (MapInfo table)
This type of data binding lets you create a Dataset that uses fields from a MapInfo table.
miDatasetSafeArray (SafeArray)
This type of data binding lets you create a Dataset that uses fields from an array of data.
miDatasetUnbound (alternate method)
If you cannot support one of the other formats, MapX provides a an alternative approach to data
binding that allows you to set up an event loop whereby MapX asks the container for data values,
one cell at a time. MapX will send the RequestData event, with the row and column number of the
data value wanted. You can then use any method of getting the data and feeding it through this
event back to MapX.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
70
MapX_Mobile_DevGuide.pdf
7
Features and Selections
The methods of the Selections and Features objects allow you to
“mark” or choose features that meet certain criteria. A point on a map
representing New York City is an example of a Feature object. Say
you need to find all of the potential clients within 5 miles of Palo Alto,
California. Once you create this collection of data, you may cycle
through the collected data, print it out, take averages, count how
many met that criteria, save them to a file, or perform other tasks. In
this chapter we will take a detailed look at features and selections.
In this chapter:
Š
Š
Š
Š
Š
Š
What Is a Map Feature? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is a Features Collection? . . . . . . . . . . . . . . . . . . . . . . . . . .
What Is a Selection Collection? . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Features Collection . . . . . . . . . . . . . . . . . . . . . . . . . . .
Understanding the Selection Collection. . . . . . . . . . . . . . . . . . .
Feature Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
72
72
72
72
75
75
Developer Guide
Chapter 7: Features and Selections
What Is a Map Feature?
A map feature is a geographic object on a map such as a point, line or region. For example, a map
of the United States could contain regions as states, lines as highways, and points as cities. In
MapX, a map feature is represented as a Feature object. For example, New York state could be a
Feature object of type region, interstate 95 a Feature object of type line, and New York City a
Feature object of type point.
What Is a Features Collection?
In MapX, the different layers that make up your map usually have the same feature type within
each layer. For example, the “US States” layer has region features to represent each state, the
“US Highways” layer has line features to represent major U.S. highways, and the “US Capitols”
layer has point features to represent each state capitol city. In MapX, all the features in a map
layer or any subset of all the features in a map layer is represented as a Features collection. Many
Layer object methods return a Features collection from a layer. The features in a Features
collection are not highlighted on your map. For this, you use a Selection collection.
What Is a Selection Collection?
Like the Features collection, the Selection collection is also a collection of Feature objects.
However, the Selection collection represents the Feature objects that are currently selected (either
selected when the user clicks on the map with a selection tool, or selected by means of the various
Select methods listed below). Each Layer object has its own Selection collection (Layer.Selection).
MapX automatically highlights all the features in a Selection collection, considering them selected
features.
Using the Features Collection
The Features collection is similar to the Selection collection, in that both collections are collections
of Feature objects. However, the Features collection has a different set of methods and properties
than the Selection collection, and the two collection types behave differently. Selected features
are automatically highlighted and features in a Features collection are not.
Getting Features in a Layer
Before you can do anything to a Features collection, you must first create the collection. The Layer
object methods create a collection of Feature objects.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
72
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 7: Features and Selections
The Following methods of the Layers collection provide various ways to get a Features collection.
Method
Code Sample (Dim fs as Features ‘this
creates a collection of Features)
Description
AllFeatures
Returns a Features collection with all features from
the layer.
Set fs = Map1.Layers(2) .AllFeatures
NoFeatures
Returns an empty Features
collection for the layer.
Set fs = Map1.Layers(9).NoFeatures
SearchWithinDistance
Returns a Features collection made up of features
within a specified distance
of a point object.
Set fs = Map1.Layers(3). _
SearchWithinDistance (objPoint, _
36.5, miUnitMile, _
miSearchTypeCentroidWithin)
SearchWithinFeature
Returns features collection
made up of features within
another specified region
feature.
Set fs = Map1.Layers(3). _
SearchWithinFeature _
(ftr, miUnitMile, _
miSearchTypeCentroidWithin)
SearchWithinRectangle
Returns features collection
within bounds of specified
rectangle.
Set fs = Map1.Layers(3). _
SearchWithinRectangle(miRect, _
miUnitMile, _
miSearchTypePartiallyWithin)
SearchAtPoint
Returns features collection
made up of features at
specified point.
Set fs = Map1.Layers(3) _
.SearchAtPoint(objPoint)
SearchTypeConstants
Search Constant
Description
MiSearchTypeCentroidWithin
Include in search if the feature’s centroid is within the region.
MiSearchTypeEntirelyWithin
Include in search if the feature is contained by the region.
MiSearchTypePartiallyWithin
Include in search if any part of the feature is within the region.
Manipulating a Features Collection
The following methods allow you to manipulate the Features collection by adding, removing,
cloning, etc. a feature object to the collection:
Method
Description
Add
Add a Feature object or an entire Features collection into the collection.
Clone
Make a copy of the collection as another Features collection object.
Common
Combine this collection and another Features collection so that this collection contains only
features that are in both (INTERSECT set operation).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
73
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 7: Features and Selections
Method
Description
Remove
Remove a Feature object or all features from a Features collection from this collection (SUBTRACT set operation).
Replace
Replace the contents of the collection with a Feature object or all features from a Selection
collection object.
Feature Object
A Features collection is made up of a collection of Feature objects. A Feature object corresponds
to a feature on a map like a symbol, line, or region.
A Feature object corresponds to features (actual entities) in a layer, such as New York, Chicago,
Louisiana, Cortland County, or Highway I-10.
Stand-Alone Features
The Feature object methods allow you to create and manipulate stand-alone feature objects.
When you create a stand-alone feature object, you must attach that feature object to the map
before you reference any of its methods or properties. Attaching a feature to the map associates
the map's coordinate system with the feature.
Feature Object Properties
The following properties define a feature object:
Property
Description
Code Sample
CenterX
Contains the X centroid of the feature.
Print ftr.CenterX
CenterY
Contains the Y centroid of the feature.
MsgBox ftr.CenterY
FeatureID
Contains the ID of the feature. Each feature in
a layer contains a unique ID within the layer.
This is an Integer value.
IVar = ftr.FeatureID
Length
Contains the length of the feature.
Print ftr.Length
Perimeter
The length is the perimeter of the feature.
If ftr.Perimeter > 500 Then
Print “Too Long”
End If
Name
Contains the name of the feature.
MsgBox ftr.name
Type
Contains the type of the feature (point, line,
etc.).
ftr.Type = miFeatureTypeSymbol
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
74
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 7: Features and Selections
Understanding the Selection Collection
A fundamental function of MapX is selecting features on the map, so that you can perform
additional tasks on them. Users can click on the map to select one or more features (points, lines,
regions, etc.). MapX highlights all selected features.
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.
For a complete listing, see Selection Collection in Chapter 14 on page 340
SelectionTypeConstants
The following constants determine what to do with the results of your selection.
Selection Constant
Description
MiSelectionNew
Creates a new selection.
MiSelectionAppend
Adds to the current selection.
MiSelectionRemove
Removes from the current selection.
The following code creates a new selection at a specific point:
Private Sub Command1_Click()
Map1.Layers(5).Selection.SelectByPoint -98, 31.56, miSelectionNew
End Sub
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
75
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Chapter 7: Features and Selections
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
There are two ways to create new map features. You can create a feature by allocating a new
Feature object, or create features by performing operations (such as buffering) on existing
features by using the methods of the FeatureFactory property of the Map object. These types of
features are called stand-alone features. Stand-alone features have some restrictions: they can't
be added to any collections, and only the methods and properties that are used to define the
feature are allowed. For example, you cannot use the Area property on a stand-alone feature, and
a stand-alone feature has no value for the Feature.Layer property.
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.
Most of these methods return stand-alone feature objects. These feature objects are automatically
attached to the map (i.e., they already have an associated coordinate system). In other words, you
do not need to use the Attach method on the features returned by these methods.
To obtain a FeatureFactory object, reference the Map.FeatureFactory property.
The MapX Online Help provides extensive instructions on how to use the various FeatureFactory
methods.
How to Modify Existing Features
When you have a pointer to a Feature object, it represents a real feature in a layer; a feature that
comes from a layer is not a stand-alone feature, and all properties and methods work on it. Any
properties and methods you read reflect the value of the feature in the layer.
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.
To update a feature, do one of the following:
•
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
76
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 7: Features and Selections
How to Delete Existing Features
To delete a feature, use the Layer.DeleteFeature method. The feature and the row it represents
will be deleted from the MapInfo table immediately.
How to Obtain a Feature to Edit
You can allow the user to click on a feature to select it. Then, to access the selection, your
program can use the Layer's Selection collection. The Selection collection also provides various
methods, such as SelectByPoint, that allow you to add features to the collection.
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).
Examining the Parts of a Region or Line
A line feature or region feature in MapX is made up of many collections of Point objects. These
collections of Points collections are accessed through the Feature.Parts collection of the feature.
Setting Font Attributes
Properties of the Style Object let you control the appearance of features on the map. For
example, you can change a symbol's color by setting the Style.SymbolFontColor property.
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.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
77
MapX_Mobile_DevGuide.pdf
8
Thematic Mapping and
Analysis
Thematic mapping is a powerful way to analyze and visualize your
data. You give graphic form to your data so that you can see it on a
map. Patterns and trends that are almost impossible to detect in lists
of data reveal themselves clearly when you use thematic shading to
display data on a map.
With MapX, you can create applications with thematic maps using the
following thematic types: ranges of values, graduated symbols, dot
density, individual values, and bar and pie charts.
In this chapter:
Š
Š
Š
Š
Š
Š
What Is Thematic Mapping? . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Planning Your Thematic Map. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Types of Thematic Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Manipulating a Theme Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Customizing a Thematic Legend . . . . . . . . . . . . . . . . . . . . . . . .
Label Thematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
79
79
82
90
92
92
Developer Guide
Chapter 8: Thematic Mapping and Analysis
What Is Thematic Mapping?
Thematic mapping is the process of shading your map according to a particular theme. The theme
is usually some piece or pieces of your data, which is obtained from a dataset. Themes present
your data visually with shades of color, fill patterns, symbols, or bar and pie charts. You create
different thematic maps by assigning these colors, patterns, or symbols to map objects according
to specific values in your data. Bar and pie charts allow you to make data comparisons for each
record in your dataset.
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
ThemeProperties 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.
Planning Your Thematic Map
Before you create a thematic map, it is important know about the elements that make up a
thematic map and how they are put together. This section will discuss thematic variables, where
you can obtain your data, particularly using data from another table, and the arrangement and
display of thematic layers.
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.
Where to Obtain the Data
Before you begin your thematic map, you need to decide what information you want to display and
locate where that information resides. The data you use to create a theme comes from a Field
object or Field collection from your dataset. These field(s) are passed as the Fields parameter of
the Themes.Add method of the Themes collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
79
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Themes Collection
Each dataset has a collection of themes. A Themes collection creates, counts, adds, or removes a
Theme object from a collection of themes. For information on the methods of the Themes
collection, please refer to Theme Object and Themes Collection in Chapter 14 on page 374.
Creating a Theme
If you want to thematically shade a map using data from a dataset, you create a Theme object for
the dataset with the Themes.Add method. Once a dataset is added to your map, creating the
theme can be done with one line of code:
Map1.Datasets(1).Themes.Add miThemeRanges “TotPop”, _
“My Ranges Theme”
This creates a ranged theme for the first dataset in the Datasets collection using the field “TotPop”
.
For information on the Themes.Add method, please refer to Themes.Add method in Chapter 14
on page 378.
How MapX Selects a Default Theme
If the Type parameter of the Themes.Add method is not specified (or specified as miThemeAuto),
MapX will attempt to choose a good default theme based on the number of fields passed in as well
as what other theme types are already being displayed, as described below.
No. Fields
Layer Type
Algorithm
greater than 1
Points, Lines, Regions
Default theme type is pie charts. If a multi-variable theme
already exists, try to create a single-variable theme using the
first field in the collection of fields provided (see algorithms
below).
1
Points
If the bound field is aggregated by individual value, try to create an individual value theme. If a ranged or individual value
theme already exist, cannot create a default theme. If the
bound field is not aggregated by individual value, try to create
a graduated symbol theme. If an object thematic already
exists, try create a ranged theme. If a ranged or individual
value theme already exist, cannot create a default theme.
1
Lines
If the bound field is aggregated by individual value, try to create an individual value theme. If a ranged or individual value
theme already exist, cannot create a default theme. If the
bound field is not aggregated by individual value, try to create
a ranged theme. If a ranged or individual value theme already
exist, try to create a graduated symbol theme. If an object thematic already exists, cannot create a default theme.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
80
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
No. Fields
1
Note:
Layer Type
Regions
Algorithm
If the bound field is aggregated by individual value, try to create an individual value theme. If a ranged or individual value
theme already exist, cannot create a default theme. If the
bound field is not aggregated by individual value, try to create
a ranged theme. If a ranged or individual value theme already
exist, try to create a dot density theme. If a dot density theme
already exists, try to create a graduated symbol theme. If an
object thematic already exists, cannot create a default theme.
Pies, Bars, and Graduated Symbols are all object thematics.
Determination of a default theme type is layer specific. In other words, themes on Layer A are not
considered when attempting to determine a default theme type for a new theme on Layer B.
ThemeType Constants
These are the types of themes you can create are:
Type
Description
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
miLabelRangedTheme
Ranged Label Theme
miLabelIndividualValuesTheme
Individual Label Value 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
81
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Theme Object
The Theme object sets the properties of the theme within the Themes collection. Modifying the
Theme object methods and properties determines how a theme is viewed, the type of theme, etc.
For a complete listing of all Theme object properties, please refer to Theme Object and Themes
Collection in Chapter 14 on page 374.
Types of Thematic Mapping
Individual Values Maps
Individual Value maps show points, lines, or boundaries that are shaded by individual values
contained in a particular field of a dataset. You can use both numerical and nominal values in
individual values maps. MapX gives each unique value its own color or symbol. When an
individual values map uses symbol types, the symbols are taken from the default style of the map.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
82
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
If you are shading your points, lines, or boundaries using nominal data, you can shade only by
individual values. Nominal data is either non–numerical data (e.g., name, type of cuisine served,
or brand of autoMobile sold) or numeric data where the numbers represent non–numeric data.
Dates are considered numeric data and can be used in both ranged and individual values maps.
For example, you have the results from a consumer survey. One question on the survey reads
“What is your favorite Sunday afternoon activity?” The possible responses are:
1. Sleeping
2. Watching TV
3. Taking a drive
4. Reading
5. Playing or watching sports
6. Visiting museums or art galleries
7. Going to the movies
You want to shade each consumer point with the response for the favorite Sunday activity. The
SUNDAY field of your dataset contains the number that corresponds to the consumer’s favorite
activity. However, the numbers in this column do not represent quantitative values. Going to the
movies is not greater than playing or watching sports even though 7 > 5. When numbers are used
as names instead of values, you must shade your objects by individual values. The numbers are
only used to reference the pastimes so a color can be assigned to it.
An individual values thematic map's settings are exposed through the IndividualValueCategories
collection, which is a collection of IndividualValueCategory objects—one object for each unique
value in the theme. To obtain an IndividualValueCategories collection, reference the
ThemeProperties.IndividualValueCategories property.
Ranged Maps
When you create a ranged thematic map, MapX groups all dataset rows into ranges and assigns
each row’s object the color, symbol, or line for its corresponding range. For example, you have a
dataset of weather stations for your television viewing area, and you want to shade the locations
according to their reported snowfall amounts.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
83
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
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.
Types of Ranged Values
MapX can create ranges automatically using five distribution methods: Equal Count, Equal
Ranges, Natural Break, Standard Deviation, and Quantile. Ranges are set by the DistMeth
property of the ThemeProperties object. The DistMeth property can be set to any of the following
DistribMethodConstants.
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
84
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
John
5000
Andrea
7000
Penny
6000
Kyle
5500
Miguel
4500
Angela
7500
Linda
5000
Elroy
6000
Ben
100
Mark
7000
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:
John
100
Andrea
90
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).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
85
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Graduated Symbol Maps
Graduated symbol maps use symbols to represent different values. You can use graduated
symbols regardless of the type of data with which you are working. For instance, use graduated
symbols to show sales orders across states. With the graduated symbols theme, MapX varies the
size of each symbol according to the value in the sales order field.
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 Maps
Dot density maps use dots to represent the data value associated with a boundary or region. The
total number of dots in a region represents that region’s data value. If you have 10,000 senior
citizens in a county, and each dot represents 100 senior citizens, there would be 100 dots in the
county boundary.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
86
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Dot density is particularly useful for showing raw data where one dot represents a large number of
something: population, number of fast food restaurants, number of distributors who carry a brand
of soda, etc.
For example, if you have a table of population broken down into county boundaries, you could use
the dot density option to show the concentration of people in each county boundary. There are two
theme properties you control for dot density maps. You can specify the value of one dot. For
example, you have a table of population statistics, broken down by county. There are 20,000 high
school students in Rensselaer County, New York. If you shade Rensselaer County according to
the number of high school students using the dot density method, each dot could represent 200
students. In that case, there would be 100 dots in Rensselaer County.
When you increase the value each dot represents, you decrease the number of dots that display
on the map. You could modify your dot density map so that one dot represents 400 students. In
that case, there would only be 50 dots in Rensselaer County.
Map1.Datasets(1).Themes(“My DotDensity _
Theme”).ThemeProperties.ValuePerDot = 400
A second option is to change the size of the dots according to your needs. If you are working with
large populations, or large counts of something, make the dot size smaller so that the distribution
of dots is easier to see. Conversely, if your working with a small data set, making the dot size
larger might illustrate your analysis more clearly.
Map1.Datasets(1).Themes(“My DotDensity _
Theme”).ThemeProperties.DotSize = miDotSizeLarge
Note:
Distribution of dots is random within the region. For example, if you shade states
according to population, the dots for New York are spread throughout the state; they are
not concentrated in New York City, where the majority of the state’s population lives.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
87
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Bar Chart Maps
Unlike one variable thematic maps such as ranges of values or graduated symbols, a thematic bar
chart map allows you to examine more than one variable per row at a time. A bar chart is built for
every map object (feature) at the centroid of the object, enabling you to analyze the thematic
variables in a particular chart by comparing the height of the bars. You can also examine the same
variable across all the charts in your map.
For example, you have a table of U.S. state boundaries containing female and male population.
Using bar charts, you can create a thematic map that displays a two–bar chart for each state: one
bar representing female, and the other representing male population. You can compare the
population differences of each state, or you can examine several states and compare one state’s
population or population differences to another’s. For best results, use no more than four to six
bars per bar chart in your analysis.
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
88
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
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.
Pie Chart Maps
Thematic mapping using pie charts also enables you to examine more than one variable per row
at a time. Like comparing the height of the bars in bar charts, in pie charts you compare the
wedges in a single pie, or examine a particular pie wedge across all of the pies. Pie charts also
enable you to compare parts of a whole.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
89
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
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.
Bivariate Thematic Mapping
Bivariate thematic mapping uses point or line objects to represent two thematic variables. For
example, a star can represent one variable, such as the number of teenagers, while a blue fill for
the star represents their annual purchase amounts.
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.
Types of Maps and Variables
The only types of thematic maps suitable for bivariate mapping are ranged and individual values
maps. You can choose between two combinations for a bivariate map, depending on your data:
•
two ranged maps
•
one ranged map and one individual values map
If you have a non-numeric variable, one of your maps must be an individual values map. You
cannot create a bivariate map with two non-numeric 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:
•
color and symbol type
•
color and size
•
size and symbol type
Symbol type should only be used for nominal or non-numeric data, as there is no inherent
association between a symbol type and a quantity.
Manipulating a Theme Map
All of the theme’s properties can be adjusted at run-time. There are two ways to do this:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
90
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
•
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 are too powerful.
Perhaps you only want the user to change the color of the top range of a ranges theme or you
want to keep the colors, but not let the user choose the number of ranges. Using the ThemeDlg
method, the user can change any (and all) parts of the theme.
ThemeProperties Object
You also have the ability to change just the property of the theme by manipulating the
ThemeProperties object. This is easy to implement and gives you more control of what the user
can and cannot change. The ThemeProperties object is stored in the Themes collection. The
ThemeProperties object properties are used to define the thematic map’s appearance (colors,
symbols, etc).The ThemeProperties object actually contains the information about how the theme
should look. Some of the ThemeProperties object’s properties are represented by other objects.
For a complete listing of all ThemeProperties object properties, please refer to ThemeProperties
Object on page 381.
Several of the ThemeProperties properties are actually other objects. Those objects include the
RangeCategory object, IndividualValue object, MultiVar object and the Style object. Look at the
next table to see the properties of the RangeCategory object. The other theme-related objects
behave similarly.
Property
Description
Code Sample
Max
Sets the maximum value for a range
in a ranged theme.
Map1.Datasets(1).Themes(1).
Properties.RangeCategories(3).Max = 625
Min
Sets the minimum value for a range
in a ranged theme.
Map1.DataSets(1).Themes(1).
Properties.RangeCategories(3).Min = 595
NumItems
Shows the number of items in a
range.
Print Map1.DataSets(1).Themes(1).
Properties.RangeCategories(1).NumItems
Style
A style object representing the style
of that range.
Map1.Datasets(1).Themes.Item(1).Proper
ties.RangeCategories.Item(1).Style.Pic
kRegion
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
91
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
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.
Customizing a Thematic Legend
When you create a thematic map, MapX automatically creates a legend that explains what the
colors, symbols, or sizes represent.
Legend Object
Each theme has a Legend object (Theme.Legend). The Legend object contains properties to
control the display of the legend.
It is easily modified using the LegendDlg method from the Legend object. See the following
sample and the dialog that it will bring up.
Map1.Datasets(1).Themes(1).Legend.LegendDlg
Label Thematics
Label thematics allows one to add themes to a layer dataset which modifies the layer’s label
display characteristics. There are two types of label themes. They are:
•
Ranged Value
•
Individual Value
Individual Value Themes
For individual themes, you may modify the label style individually by using the Style property of
each individual value theme category. You can use the ApplyAttribute theme property to modify
either the label's foreground color or all its font properties. For example, to make the first individual
value's label capitalized and bold do the following:
Theme.ThemeProperties.IndividualValueCategories(1).Style.TextFont.Bold =
True
Theme.ThemeProperties.IndividualValueCategories(1).Style.TextFontAllCaps =
True
Theme.ThemeProperties.ApplyAttribute = miApplyAttributeAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
92
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 8: Thematic Mapping and Analysis
Ranged Themes
For ranged themes, you may modify the label style by using the Style property of each range
theme category (or bin.) You can use the ApplyAttribute theme property to modify the label's
foreground color, size or all its font properties. In addition, you can automatically spread the font
size or foreground color between all range categories by using the SpreadBy theme property.
When you apply all the attributes and perform a spread by (either color or size), all attributes
(except for the one being automatically spread) come from what is called the model style. In
MapX, the model style is the first range category style. For example, to automatically spread the
label font size and modify only the font size do the following:
Theme.ThemeProperties.ApplyAttribute = miApplyAttributeSize
Theme.ThemeProperties.SpreadBy = miSpreadBySize
To add a new label theme, you can use the Themes.Add method using either one of the following
theme ThemeTypeConstants:
•
miLabelRangedTheme
•
miLabelIndividualValueTheme.
See ThemeTypeConstants in Chapter G on page 461 for a complete listing of available theme
types. You may then use the Theme.ThemeProperties property to configure your themes.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
93
MapX_Mobile_DevGuide.pdf
Finding Features on a
Map
The Find method of the Layer object allows you to search a layer in a
map object and locate a specific feature within the layer.
In this chapter:
Š
Š
Using the Find Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Using the FindFeature Object . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
9
Developer Guide
Chapter 9: Finding Features on a Map
Using the Find Object
A Find Object allows you to locate features on a map. You may find a line, symbol or region
feature. The layer you are searching must have an indexed field in order to utilize the Find method
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 Find Object on
page 212.
Refining Boundary
A refining boundary in your Find.Search is used to distinguish between multiple 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”
Using the FindFeature Object
The Find.Search method returns the feature it finds in the form of a FindFeature object. A
FindFeature object stores the properties of the Feature object found as its own properties. In
addition, the FindFeature has a FindRC property which stores the result code of the Find
operation. The FindFeature object is a super class of the Feature with the addition of a closest
match string to be returned. The FindRC property is a numeric value that indicates why the feature
was or was not found.
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.
Digit Values
Meaning
**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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
95
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 9: Finding Features on a Map
Digit Values
Meaning
x2x ( + / - )
Address number was within min/max range.
x3x ( + / - )
Address number was not within min/max range.
x4x ( + / - )
Address number was not specified.
x5x ( - )
Streets do not intersect.
x6x ( - )
The row matched does not have a map object.
** Hundreds Place **
1xx ( + / - )
Name found in only one region other than specified region.
2xx ( - )
Name found in more than one region other than the specified region.
4xx ( - )
No region was specified, and multiple matches were found.
5xx ( + )
Name found more than once in the specified region.
Once the result code is determined, you can use the results for selected cases as shown in the
example below. The user input from a text box indicates a city and state to locate. The input is
brought into the Find.Search method. Once the city is located from the major or minor city table, an
annotation is added to the map and the map is re-centered at the location in which the feature was
found.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
96
MapX_Mobile_DevGuide.pdf
Using Drilldown Layers
In this chapter, you'll learn about a special type of map layer, known
as a Drilldown layer, that lets the user perform “drill-down” analysis
and exploration. If your map includes a Drilldown layer, your user can
point and click on part of the map to see more detail about that
region. Drilldown layers provide an intuitive, easy to use interface that
allows users to explore data by pointing and clicking.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Š
What Is a Drilldown Layer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Terms and Concepts You Should Know . . . . . . . . . . . . . . . . . . . 99
How to Develop a Drilldown Application . . . . . . . . . . . . . . . . . 100
Preparing a Drilldown Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Creating a Drilldown Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Resetting the Drilldown Layer . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Drilldown Layer Limitations and Requirements . . . . . . . . . . . 104
For More Information... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10
Developer Guide
Chapter 10: Using Drilldown Layers
What Is a Drilldown Layer?
A Drilldown layer is a map layer with special behavior built-in. Drilldown layers allow the user to
explore the map in a hierarchical manner, by pointing and clicking on the part of the map where
more detail is needed.
When a map first appears on the screen, the Drilldown layer looks like an ordinary map layer. For
example, this Drilldown layer shows sales territories.
If the user selects a Drilldown tool and clicks on a feature in the map, that feature is replaced by
numerous smaller regions. For example, if you click on a sales territory, the territory feature is
replaced by the state boundaries that make up the territory. Clicking is basically a way of
requesting, “Show me more detail about this part of the map.”
Depending on how the application and the Drilldown layer were set up, the user might be able to
drill down repeatedly. With each successive click, the map can display more detail about the area
where the user clicked. Clicking on a state boundary might reveal the county boundaries that make
up the state.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
98
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
To reduce the amount of detail displayed, the user can select a different tool (a “roll up” tool), and
click on the detailed area. The smaller, detailed regions are replaced with a larger region—
essentially, undoing the drill-down action.
A Drilldown layer is built from a set of tables. You need to provide one table for each “level” in the
drill-down hierarchy, plus one special table that defines how the various levels are related
hierarchically. However, the complexity of a Drilldown layer is hidden from the user. The Drilldown
layer appears in a MapX map as a single layer. If the user displays the Layer Control dialog box, a
Drilldown Layer appears as a single item in the list of layers.
Terms and Concepts You Should Know
To understand the rest of this chapter, you'll need to understand some of the terminology and
basic concepts of Drilldown mapping.
•
To support drill-down mapping, the map must include a Drilldown layer. This is a special
layer, composed of two or more separate tables. A Drilldown layer displays objects from
different tables as one layer in the map.
•
For a Drilldown layer to be useful, it must contain at least two levels, which form a
hierarchy. For example, suppose a Drilldown layer presents state boundaries, and the
user can click on a state to show all the county boundaries for that state. In the preceding
example, the state boundaries represent one level, and the county boundaries represent
another level. The levels form a hierarchy. Each state contains a number of counties. In
this example, we say that the state boundary is a parent feature, and each county
boundary is a child feature.
•
Typically, the user drills down on a part of the map by selecting a Drilldown tool, then
clicking on a part of the map where more detail is needed. To implement a drilldown tool,
use the CreateCustomTool method to create a custom tool.
•
Using the Drilldown tool triggers the ToolUsed event. Within this event, you handle the
user's drill-down action by expanding the feature that the user clicked on. Expanding a
feature is a two-step process: First, you obtain a list of child features that will replace the
feature the user clicked on, and add the child features to the layer (by calling the
Layer.DrilldownAddFeatures method). Then, you remove the original feature that the user
clicked on. In other words, a feature is replaced by its child features.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
99
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
•
Any Drilldown application requires a hierarchy manager, which is a software component
that understands the hierarchical relationship between the various levels in the Drilldown
layer. When the user clicks a feature to expand that feature, the hierarchy manager is the
part of the program that decides which child features need to be added.
•
The ToolUsed event procedure is a simple example of a hierarchy manager. When the
user uses your custom Drilldown tool to click on the map, the click event is handled by the
ToolUsed event procedure; the code executed within this procedure determines which
features are added to expand the map feature.
•
You can set up the Drilldown layer so that there are two or more alternate tables that can
be used at a given level in the hierarchy. For example, suppose that for each state
boundary, you have two alternate sets of child features: A state can be expanded to show
a set of county boundaries, or the state can be expanded to show a set of telephone
exchange numbers. Such a Drilldown layer would still be considered to have two levels—
one parent level, and one child level. However, at the child level, there is a choice
between two alternate sets of features (counties vs. telephone exchanges). With this
arrangement, your application must determine which child level to display, perhaps by
prompting the user.
How to Develop a Drilldown Application
Drill-down applications require a considerable amount of setup and preparation. The major steps
can be summarized as follows (with more detail on each step provided later in this chapter).
1. Obtain the various tables that you will use to build your multi-level Drilldown layer. Tables
can be created using MapInfo Professional, or purchased from MapInfo Corporation or
from third-party vendors.
2. Create a new, empty drilldown table (a .tab file) with special columns and special
metadata. The metadata assigns a level name to each component table, and also
identifies important columns in the component tables — the ID column and the caption
column.
3. Include your Drilldown table in your map (e.g., include the Drilldown table in the Geoset(s)
you are using, or add the Drilldown table to your map through a method such as
Layers.Add).
4. Add a user interface element (such as a toolbar button) to your application, so that the
user can select a Drilldown tool and click on the map to drill down.
5. Add code to your application that responds to the user's use of the drill-down tool (in other
words, write a hierarchy manager). This code needs to detect which feature the user
selected; determine which child features should replace the feature; and invoke various
methods (DrilldownRemoveFeatures, DrilldownAddFeatures) to expand or contract the
map features.
Preparing a Drilldown Layer
To build a Drilldown layer, you need to provide a set of two or more MapInfo tables. Specifically,
you need:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
100
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
•
One MapInfo table for each level of detail in your Drilldown layer. These are known as
component tables.
•
An additional, empty table which contains special metadata that describes the component
tables. This is known as the Drilldown table.
For example, suppose you want to display state boundaries, but allow the user to click a state to
display that state's county boundaries—a two-level Drilldown layer. You would need three tables:
A (component) table of state boundaries, a (component) table of county boundaries, and a
Drilldown table.
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
Each feature in a Drilldown layer must have an identifying key (possibly a string such as “New
York”). All keys within a single level must be unique; for example, a state boundaries level can only
contain one state known as “Washington”. However, a feature's identifying key does not need to
be unique across all other levels in the Drilldown layer. For example, if you Drilldown layer includes
state boundaries and county boundaries, you could have a “Washington” state and a “Washington”
county.
Requirements for the Drilldown Table
A typical MapInfo table consists of a set of files; for example, the World table consists of the files
World.tab, World.map, World.id, World.ind, and World.dat. The Drilldown table is different from
other tables, in that it consists of a single file: filename.tab.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
101
MapX_Mobile_DevGuide.pdf
Developer Guide
•
Chapter 10: Using Drilldown Layers
The Drilldown table includes a \DDMap\ComponentMaps\ key hierarchy. Within this
hierarchy, you specify four metadata keys for each component table:
Component Table Metadata Keys
Key
Description
File
A required key that identifies the path and filename of a component table.
LevelID
A required key that defines an identifier for this component table.
Example: You might use “States” as the key value if this table contains state boundaries. When calling a method such as DrilldownReset, pass “States” as the level
argument.
FeatureIDCol
Identifies the number of the column in the component table that contains unique
drill-down keys. Optional key; if omitted, column number 1 is used.
FeatureCaptionCol
Identifies the number of the column in the component table which should be used
for labeling. Optional key; if omitted, column number 1 is used.
For example, the “Sample Drilldown Table” includes key hierarchies such as
“\DDMap\ComponentMaps\One\LevelID” and “\DDMap\ComponentMaps\Twox\LevelID”. Note
that DDMap, ComponentMaps, and LevelID are standard, required portions of the key hierarchy,
while One and Twox are customizable. You can use any key names you like instead of One,
Twox, Twoxx, etc.; those key names serve no purpose other than to differentiate each component
table's set of keys.
Within the \DDMap\HierarchyManager\ key hierarchy, there are three additional keys:
Key
Description
IsDLL
Not used in version 4; reserved for future use. Boolean indicator; “TRUE” means that this Drilldown layer uses a DLL as the hierarchy manager.
ID
Not used in version 4; reserved for future use. The name of the DLL, or the GUID to CoCreate.
InitialLevel
The initial component table to display when first loading/displaying the Drilldown layer.
Optional key; it is acceptable to have an empty Drilldown layer.
Creating a Drilldown Tool
Your application's user interface should give the user a way to drill down on part of the map.
Typically, the user drills down by selecting a Drilldown tool (e.g., a toolbar button), then clicking on
the map.
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:
' Drilldown Expand Tool
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
102
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
Map1.CreateCustomTool 1, miToolTypePoint,
miDrilldownExpandCursor, miDrilldownContractCursor,
miDrilldownContractCursor
This example creates a single tool that can be used for both Drilldown and RollUp actions. By
default, the tool acts as a Drilldown tool, which displays an “expand” cursor (a cursor with a +
sign). If the user holds down the SHIFT or CTRL key while clicking, the cursor changes to a
“contract” cursor (a cursor with a - sign). This arrangement lets the user switch tools without having
to move the cursor all the way to the toolbar; the built-in ZoomIn and ZoomOut tools have the
same behavior.
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 that are currently visible.
Creating a RollUp Tool
Once you have implemented a Drilldown tool, you will probably want to give the user a Roll-up
tool—a tool that has the opposite effect of the Drilldown tool.
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.
Resetting the Drilldown Layer
You can "reset" a Drilldown layer by calling the DrilldownReset method. Resetting the Drilldown
layer clears the entire layer, then re-initializes the layer using features from one of the component
tables.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
103
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
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.
Drilldown Layer Limitations and Requirements
Some restrictions apply to Drilldown layers, as summarized in the following list.
•
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.
For More Information...
For more information about Drilldown layers, see the following.
Related Methods and Properties
The Layer.DrilldownAddFeatures method adds features to a Drilldown layer.
The Layer.DrilldownRemoveFeatures method removes features from a Drilldown layer.
The Layer.DrilldownReset method clears an entire Drilldown layer, then shows only one level of
detail from the layer.
The Layer.GetDrilldownFeaturesByID method retrieves Features given their IDs.
To determine whether a layer is a Drilldown layer, test whether the Layer.Type property returns the
value miLayerTypeDrilldown (value: 7).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
104
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 10: Using Drilldown Layers
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
105
MapX_Mobile_DevGuide.pdf
11
Using Coordinate
Systems
In this chapter, you'll learn how to use Coordinate Systems
(sometimes called “map projections”) to change the appearance of a
map, or to change the units in which map coordinates are processed
by MapX.
In this chapter:
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Š
Basic Concepts of Coordinate Systems. . . . . . . . . . . . . . . . . .
Obtaining a Coordinate System Object . . . . . . . . . . . . . . . . . .
Querying the Properties of a CoordSys Object . . . . . . . . . . . .
Displaying a Map in a Different CoordSys . . . . . . . . . . . . . . . .
Specifying X-Y Coordinates in a Different CoordSys . . . . . . .
Displaying the Choose Projection Dialog . . . . . . . . . . . . . . . .
Summary of Parameters Used by Coordinate Systems . . . . .
Using Settings from MAPINFOW.PRJ. . . . . . . . . . . . . . . . . . . .
Applying an Affine Transformation. . . . . . . . . . . . . . . . . . . . . .
Defining Custom Datums. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Datum Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
For More Information... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
107
107
107
108
109
110
110
112
114
115
116
117
Developer Guide
Chapter 11: Using Coordinate Systems
Basic Concepts of Coordinate Systems
Every map has a coordinate system, which affects mapping software in various ways:
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.
Obtaining a Coordinate System Object
The MapX object model exposes coordinate system information through the CoordSys object.
This object's properties tell you everything you need to know about a coordinate system.
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 on page 108.
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 on page 109.
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.)
Querying the Properties of a CoordSys Object
For each type of coordinate system, only some of the properties are applicable. For example, if the
CoordSys.Type property is miRobinson (12), only the Datum, Units, and OriginLongitude
properties are applicable. The Robinson map projection simply does not use any of the other
properties.
To see whether a property is used by a particular projection, see Summary of Parameters Used
by Coordinate Systems on page 110.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
107
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
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.
Displaying a Map in a Different CoordSys
There are two ways an application can specify the coordinate system (or “projection”) in which a
map is displayed:
•
Use the Map.DisplayCoordSys.Set method to set a new display CoordSys.
-or-
•
Note:
Assign a new CoordSys object to the Map.DisplayCoordSys property.
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.
Displaying a Robinson Map
The following Visual Basic example changes the map's DisplayCoordSys so that the map is
displayed with the Robinson map projection, which looks like this:
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
108
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Specifying X-Y Coordinates in a Different CoordSys
The Map object has a NumericCoordSys property, which represents the coordinate system used
to process numeric coordinates. This property affects both the input and the output of X-Y
coordinates, as follows:
•
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:
•
Use the Map.NumericCoordSys.Set method to set a new numeric CoordSys.
-or-
•
Assign a new CoordSys object to the Map.NumericCoordSys property.
Retrieving Coordinates in a Different CoordSys
The following Visual Basic example changes the map's NumericCoordSys so that the coordinates
are returned in a different coordinate system.
Dim
Dim
Dim
Dim
iProjectionType As Integer
iDatumNumber As Integer
iUnits As Integer
dOriginLongitude As Double
' Display map's center X-Y in original coordsys
Debug.Print "Original Center: " & Map1.CenterX & ", " & _
Map1.CenterY
'
'
'
'
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
iDatumNumber = 62
iUnits = miUnitMeter
dOriginLongitude = 0
'(value: 12)
'North American 1927 (NAD 27)
'(value: 7)
Map1.NumericCoordSys.Set iProjectionType, iDatumNumber, _
iUnits, dOriginLongitude
' Display map's center X-Y in the new coordsys
Debug.Print "New Center: " & Map1.CenterX & ", " & Map1.CenterY
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
109
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Displaying the Choose Projection Dialog
To display a dialog that lets the user choose a coordinate system, use the
CoordSys.PickCoordSys method.
The dialog is automatically initialized, so that the highlighted description describes the CoordSys
object. If the user clicks OK in the dialog, the method returns True, and the CoordSys object is
updated to match the coordinate system chosen by the user.
To display the dialog box at design time:
1.
Right-click the Map control.
2.
Choose Properties from the shortcut menu.
3.
On the General tab, click the Projection button.
MapX displays the same Choose Projection dialog, which is invoked by the PickCoordSys method.
Example (PickCoordSys)
The following statement displays the Choose Projection dialog at run time, allowing the user to
change the coordinate system in which the map is displayed.
Map1.DisplayCoordSys.PickCoordSys
Summary of Parameters Used by Coordinate Systems
The CoordSys object supports several parameters (Datum, Units, Origin Longitude, etc.).
However, each projection uses only some of the parameters. The following table shows which
parameters apply to which projections.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
110
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Std. Par. 2
X
X
Azimuthal Equidistant
X
X
X
X*
Cylindrical Equal Area
X
X
X
Double Stereographic
X
X
X
Eckert IV
X
X
X
Eckert VI
X
X
X
Equidistant Conic
X
X
X
Gall
X
X
X
Hotine Oblique Mercator
X
X
X
X
Lambert Azimuthal Equal–Area
X
X
X
X*
Lambert Conformal Conic
X
X
X
X
Longitude–Latitude
X
Mercator
X
X
X
Miller
X
X
X
Mollweide
X
X
X
New Zealand Map Grid
X
X
X
Robinson
X
X
X
Sinusoidal
X
X
X
Stereographic
X
X
X
X
Swiss Oblique Mercator
X
X
X
X
Transverse Mercator
X
X
X
X
Regional Mercator
X
X
X
Polyconic
X
X
X
Cassini - Soldner
X
X
X
X
X
Range
Std. Par. 1
X
False Nor.
Origin Lat.
X
False East.
Origin Long.
X
Scale Fact.
Units
X
Azim.
Datum
Albers Equal-Area Conic
Projection
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
* MapX supports the Azimuthal Equidistant and Lambert Azimuth Equal-Area projections in the
polar aspect only. The Origin Latitude for these projections must be either 90 or -90.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
111
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Using Settings from MAPINFOW.PRJ
If you use MapInfo Professional, you will find a file called MAPINFOW.PRJ in the same directory
as the MapInfo executable. MAPINFOW.PRJ is a text file containing the parameters that define
MapInfo's coordinate systems. A copy of MAPINFOW.PRJ is included with MapX.
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
Description
A string that describes the coordinate system. This description appears in dialog boxes.
Type
A number that usually matches one of the CoordSysTypeConstants exactly.
Users may have customized this number in two ways: To specify an Affine
Transformation, the user adds 1000 to this number; to specify bounds, the user
adds 2000 to this number.
Datum
A number representing one of the Datums supported by MapX, or a special
number (999 or 9999) indicating a custom datum.
Units [Set of 4 Custom
Datum Arguments]
Optional; applies only if the Datum number is 999.
[Set of 9 Custom Datum
Arguments]
Optional; applies only if the Datum number is 9999.
Set of Projection
Parameters
From zero to 8 parameters, depending on which Type is specified. Refer to
Summary of Parameters Used by Coordinate Systems on page 110, to see
which parameters are used by this Type.
[Set of 7 Affine Transformation Parameters]
Optional; applies only if the Type number is exactly 1000 or 3000 greater than
a CoordSysTypeConstant.
[Set of 4 Bounds
Parameters]
Optional; applies only if the Type number is exactly 2000 or 3000 greater than
a CoordSysTypeConstant.
MAPINFO.PRJ Example
Open MAPINFOW.PRJ in a text editor, or in a word processing package.
Note:
MapX uses this file when interpreting and setting the map coordinate system. Make a
back up of this file prior to making any changes.
Within MAPINFOW.PRJ, search for the name of a MapInfo projection, such as “Robinson”. The
line that you find contains the definition for the Robinson projection:
"Robinson", 12, 62, 7, 0
This line tells us several things about the Robinson coordinate system:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
112
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
•
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 on page 110 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
How to Interpret Special Datum Numbers
MapInfo users can customize the MAPINFOW.PRJ file by creating custom datum definitions.
There are two types of custom datum definitions:
•
A full custom datum definition consists of datum number 9999, immediately followed by
nine other custom datum parameters, separated by commas.
•
A simplified custom datum definition consists of datum number 999, immediately followed
by four other custom datum parameters, separated by commas.
If a line in MAPINFOW.PRJ specifies datum number 999 or 9999, then the custom datum
parameters appear before the rest of the coordinate system parameters (units, origin longitude,
etc.). For more information on custom datum syntax, see the section Defining Custom Datums
later in this chapter.
How to Interpret Special CoordSys Type Numbers
The coordinate system type number that appears in MAPINFOW.PRJ (such as 12, in the example
above) might not match any of the MapX CoordSysType constant values. You may need to
subtract 1000, 2000, or 3000 from the number to obtain a number that represents a valid MapX
CoordSysType.
If a line from MAPINFOW.PRJ contains an affine transformation, then the coordinate system type
number will have 1000 added to it, and the seven affine transformation parameters will be added
to the end of the line.
If the line includes a bounds definition, then the projection type number will have 2000 added to it,
and the four bounds parameters will be added to the end of the line.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
113
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
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).
"DCS", 3008, 74, 7, -123, 0, 0.9996, 500000, 0, 3, 1.57, -0.21, _
84120.5, 0.19, 2.81, -20318.0, 70000, 0, 80000, 50000
Although the number 3008 is valid within MAPINFOW.PRJ, you must use the unaltered number, 8,
in MapX.
The “DCS” example above can be interpreted as follows:
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)
Applying an Affine Transformation
If you need to define rotated or skewed coordinate systems, you need to specify an affine
transformation. In MapX, you can define such a transformation by creating an AffineTransform
object, then passing the object to the CoordSys.Set method.
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:
A
Performs scaling or stretching along the X axis.
B
Performs rotation or skewing along the X axis.
C
Performs shifting along the X axis.
D
Performs rotation or skewing along the Y axis.
E
Performs scaling or stretching along the Y axis.
F
Performs shifting along the Y axis.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
114
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Defining Custom Datums
Most coordinate systems use one of the standard datums supported by MapX. If you need to use
a datum that is not in the list, and you know the datum’s mathematical parameters, then you can
define the coordinate system using a custom datum.
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.)
The Parameters that Define a Datum
MapX and MapInfo Professional use the following information to define a datum:
•
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
115
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Defining a Datum in MapInfo Professional
In MapInfo, you define a custom datum in a coordinate system by using datum number 9999
followed by the datum parameters, in this order:
9999, EllipsoidNumber, dX, dY, dZ, EX, EY, EZ, m, PrimeMeridian
Some datums specify only an ellipsoid and shift parameters (dX, dY, dZ), with no rotation
parameters, scale correction, or prime meridian. In those cases, you can use datum number 999
instead of 9999, to simplify the definition:
999, EllipsoidNumber, dX, dY, dZ
These sets of parameters are then copied into the file MAPINFOW.PRJ; see examples below.
Defining a Datum in MapX
In MapX, you define a custom datum by creating a Datum object, and using its Set method to set
the parameters. You then use this Datum object as one of the parameters to the CoorsSys.Set
method.
Common Mistakes, and How to Avoid Them
The shift and rotation parameters describe the ellipsoid’s orientation in space, as compared to the
WGS 84 datum. It’s important to make sure that these parameters have the correct signs (positive
or negative). Usually, a document describing a local datum will list the parameters required to
convert coordinates from the local datum to WGS 84. (This is the same as saying that the
parameters were derived by subtracting the local datum from WGS 84.) In that case, you can use
the parameters exactly as they appear in the document. However, if you have a document that
lists parameters for converting coordinates in the opposite direction — from WGS 84 to the local
datum — then you must reverse the signs of the shift, rotation, and scale correction parameters.
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 (3parameter) 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
116
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
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.
For More Information...
For more information about coordinate systems and map projections, review the following:
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
117
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 11: Using Coordinate Systems
Earth Science Information Center
U.S. Geological Survey
507 National Center
Reston, VA 20192
1.800.ASK.USGS -or- 1.703.648.6045
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
118
MapX_Mobile_DevGuide.pdf
12
MapX Tools
Most mapping applications provide an assortment of tools to aid with
common drawing tasks (such as drawing a line on the map) and
navigation tasks (such as zooming in). MapX provides several
common mapping tools, plus you can also create your own custom
tools.
In this chapter:
Š
Š
Š
Š
Š
Overview of Standard Tools . . . . . . . . . . . . . . . . . . . . . . . . . . .
Object Editing Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Node Selecting and Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Custom Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Polygon Drawing Tools (Polytools). . . . . . . . . . . . . .
120
121
121
125
127
Developer Guide
Chapter 12: MapX Tools
Overview of Standard Tools
Using Standard Tools
With MapX, you can easily incorporate common toolbar buttons into your application. 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/
or position 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.
•
Object Creation tools, which allow for the creation of new map features.
The selection tools provide built-in support for modifier keys (SHIFT key, CTRL key): Hold down the
SHIFT key while using a selection tool, and the tool de-selects features; hold down CTRL while using
a selection tool, and the tool adds features to the selection. MapX automatically displays a
different cursor whenever a modifier key is being pressed (a plus or minus sign appears next to the
cursor), so that the user will understand the effect of the key.
Controlling Which Tool Is the Current Tool
To set which tool is being used, set the Map.CurrentTool property.
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
Available Standard Tools
Different tools will enable the mouse to perform a variety of 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.
These are the standard tools available with MapX:
Tool
Constant
Description
Add Line
miAddLineTool
Adds a line feature to the insertion layer.
Add Point
miAddPointTool
Click to add a point feature to the insertion layer.
Add Polyline
miAddPolyLineTool
Adds a poly-line feature to the insertion layer.
Add Region
miAddRegionTool
Adds a region feature to the insertion layer.
Arrow
miArrowTool
Click on title or annotations. Also, moves or resizes selected
features in editable layers.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
120
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
Tool
Constant
Description
Center
miCenterTool
Click to re-center the map.
Label
miLabelTool
Click on a feature to label the feature.
Pan
miPanTool
Drag to re-center the map.
Polygon Select
miPolygonSelectTool
Click to draw a polygon; objects within the polygon are
selected.
Radius Select
miRadiusSelectTool
Drag to select features within radius.
Rect Select
miRectSelectTool
Drag to select features within rectangle.
Select Tool
miSelectTool
Click to select features.
Symbol
miSymbolTool
Place a symbol annotation.
Text
miTextTool
Place a text annotation.
Zoom In
miZoomInTool
Zoom In.
Zoom Out
miZoomOutTool
Zoom Out.
Object Editing Tools
Object editing tools allow the user to create and modify features in a Map layer. There are four
standard object creation tools: Add Point, Add Line, Add Polyline, and Add Region.
Note:
To set which tool is being used, set the Map.CurrentTool property.
The object editing tools add the new feature to whichever layer is specified in the
Layers.InsertionLayer property. There can only be one insertion layer, and the default is none.
Setting the current tool to an object creation tool when there is no insertion layer results in an error.
MapX also supports modification of existing map features. To edit features, the Layer.Editable
property must be set to true for any layers that you wish to change. Then, the built-in Arrow tool
can be used to move or resize features in the current selection. To move the selected feature(s),
simply click and drag in the selection. To resize the selected feature(s), click and drag in the edit
handles. To delete the selected feature(s), press the Delete key.
Node Selecting and Editing
Node selecting and editing is functionality added to the Select Tool. This allows a user to add,
change, or delete nodes in a “noded object”. That is, Node editing capabilities enable a user to
manipulate the shape of an object that has nodes.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
121
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
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”.
Note:
Currently, there is NO TRANSACTION SUPPORT in node editing. Be very careful not to
unintentionally hit the delete key while nodes are selected. At this time, there is no “Undo”.
The table below displays what objects work in Node Edit Mode:
Noded Objects
Can Select Node
Non-Noded objects
(will NOT work in
Node Edit Mode)
Can Add Node
• point
• point
• line
• arc
• line
• line
• polyline
• ellipse / circle
• polyline
• polyline
• polygon
• rectangle
• region
• region
• round rect
• text
Setting the Mode with the Map.FeatureEditMode property
A map object can be set to “Feature Edit Mode” or “Node Edit Mode” (it’s default is “Feature Edit
mode). In “Feature Edit Mode”, selected editable objects are drawn with resize handles (normally
the 4 corners of the MBR of an object are highlighted). In “Node Edit Mode”, the nodes of objects
selected for editing are drawn and only noded objects (points, lines, polylines, regions) will display
selectable nodes. Non-noded objects are simply highlighted.
Below are the Visual Basic commands for setting the Map.FeatureEditMode property.
Feature Edit Mode
Map1.FeatureEditMode = miEditModeFeature
Node Edit Mode
Map1.FeatureEditMode = miEditModeNode
Node Edit Mode with Move and Delete Duplicate Nodes
Map1.FeatureEditMode = miEditModeNode | miMoveDuplicateNodes |
miDeleteDuplicateNodes
Node Edit Mode and Add Node Mode
Map1.FeatureEditMode = miEditModeNode | miEditModeAddNode
Node Selecting and Editing Criteria
To select nodes, the map must be in “Node Edit Mode”, but not “Add Node Mode”. Below are the
“rules” for selecting nodes using the Select Tool:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
122
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
•
Click on an unselected node to select that node. This will clear any nodes currently
selected. Alternatively, if you click on a currently selected node, other selected nodes will
not change.
•
Ctrl-click to toggle between the states (selected and unselected) of the current node. This
will not affect any previously selected nodes. Use this to turn off individual nodes, or to
signal the start of a range of nodes (see “Selecting a Range of Nodes” below).
•
Shift-click specifies the end of a range of nodes. For a polygon, this would pick the
shortest range of nodes.
•
Ctrl-Shift-click selects the longest range of nodes in a polygon or a region.
Note:
•
This operation only applies to polygons of a region. It picks the range of nodes opposite of
Shift-click.
An “Anchor Node” is defined when a user clicks or ctrl-clicks a node. That is, when a range
of nodes is selected, the current state of each node in that range is determined by the
state of the anchor node (i.e., the first node in a “path” of nodes). If the anchor node is
selected, all nodes in the range will be selected.
Selecting a Range of Nodes
This is how to select multiple ranges of nodes:
1. Click (or Ctrl-click) on a node in an object. This is the “Anchor Node” (i.e., starting point) of
the range.
2. Shift-click on another node in the object. This defines the end of the first range.
3. Ctrl-click on a third node in the object. This defines the starting, anchor node for the
second range.
4. Shift-click on a fourth node in the object. This completes the second range.
5. Repeat steps 1 & 2 for each additional range you wish to select.
In order to define a range of nodes, the start and end points must be in the same polygon or
polyline object. For poly-polygons/poly-polylines, the range can only be in a single polygon/
polyline. Ranges can not span across objects or individual polylines/polygons within a poly-object.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
123
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
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.
Moving Duplicate Nodes
When moving nodes, one has the option of moving just the selected nodes, or the selected nodes
plus the duplicate nodes. (Duplicate nodes are nodes belonging to other objects in the same
layer.) When “Move Duplicate Nodes” is enabled, all nodes in the neighboring objects in the same
layer that exactly match the selected nodes will also be moved.
Deleting Duplicate Nodes
When deleting nodes, one has the option to delete just the selected nodes or the selected nodes
plus the duplicate nodes within the same layer. When “Delete Duplicate Nodes” is enabled, all
nodes in the neighboring objects in the same layer that exactly match the selected nodes will also
be deleted.
Adding Nodes
To add nodes, the map must be in “Node Edit Mode” and “Add Node Mode”. Nodes can only be
added to lines, polylines and polygons. If a node is added to a line, it is automatically promoted to
a polyline. A node can ONLY be added to a selected, editable object. The user must click on the
edge of a line, polyline or polygon object, between 2 nodes. The location of the mouse cursor
when the mouse button is clicked determines which two dashed lines the new node will be
inserted between. The mouse move will display two dashed lines representing the shape of the
new object. The location of the mouse cursor when the mouse button is released determines the
location of the new node. Pressing ESC during the dragging (before the mouse button is released)
will abort the operation and the node will not be added.
Snap To Node
To make node selection and editing easier you can enable MapX Snap To Node functionality. Two
properties of the Map object are used to enable and define this feature. Map.SnapToNodeSupport
is used to turn the feature on or off. Map.SnapTolerance is used to determine the distance in pixels
within which Snap To Node operates i.e., how close or far from a node the cursor must be before it
moves automatically to the closest node.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
124
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
Creating a Custom Tool
Custom Tools
If you need a type of tool button that MapX does not provide, you can simply create a custom tool
by using the Map.CreateCustomTool method.
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).
Create the Tool
To create a custom tool, call the CreateCustomTool method.
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.
Const RULERTOOLID = 500
‘This goes in the General declarations.
Private Sub Form_Load()
Map1.CreateCustomTool RULERTOOLID, miToolTypeLine, miSizeCursor
End Sub
In the above call of CreateCustomTool, we specified three required parameters: ToolNumber, Type,
and Cursor. The ToolNumber is the RULERTOOLID constant we created to represent the tool. The
Type is a ToolTypeConstants value which determines the behavior of the tool. In this case, it is
miToolTypeLine which enables the user to click and drag to draw a line using the tool. The Cursor
is miSizeCursor, which means that when the tool is selected it will appear as the size cursor.
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 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
125
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
Available Custom Tool Types
The ToolTypeConstants describe the tool types that you can use when creating a custom tool.
They describe the tool’s behavior (e.g., miToolTypeLine lets the user draw a line;
miToolTypeCircle lets the user draw a circle; etc.).
Constant
Behavior
miToolTypePoint
Indicates a specific point.
miToolTypeLine
Draws a line.
miToolTypeCircle
Draws a circle.
miToolTypeMarquee
Draws a marquee box which selects map objects within the box.
miToolTypePoly
Draws a polyline.
miToolTypePolygon
Draws a polygon.
Now that the Ruler custom tool is created, we have to write the code for what the tool actually
does.
Write the Tool Handler
There are two different times at which the tool’s code may be executed: during the tool’s use, or
after the tool is used. For our custom Ruler tool we want to execute code during the tool’s use
because that’s when the work needs to be done.
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:
Dim XDown As Double
Dim YDown As Double
Private Sub Map1_MouseDown(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Map1.CurrentTool = RULERTOOLID And Button = vbLeftButton 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
126
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
To capture the end point when the user moves the mouse across the map and stops at another
spot, we write code in the MouseMove event:
Private Sub Map1_MouseMove(Button As Integer, _
Shift As Integer, X As Single, Y As Single)
If Map1.CurrentTool = RULERTOOLID And Button = vbLeftButton Then
Dim MapCoordX As Double, MapCoordY As Double
Map1.MapUnit = miUnitMile
Map1.ConvertCoord X, Y, MapCoordX, MapCoordY, miScreenToMap
fMainForm.sbStatusBar.SimpleText = Map1.Distance(XDown, _
YDown, MapCoordX, MapCoordY) & " miles"
End If
End Sub
This code will continually execute until the user stops moving the mouse and releases the mouse
button. The last time this code executes is for the last point on the map before the mouse stops
moving, which is the end point of our distance measurement. We convert the point from screen to
map coordinates and then use the Distance method of the Map object to calculate the distance
between the two points. The result is displayed in the status bar of the form.
ToolUsed Event
There are many times when you may want to execute a tool’s code after the tool is used. An
example of this is to allow the user to draw a circle and when the mouse button is released,
compute the number of customers inside that radius. If this is the functionality the tool needs, use
the ToolUsed event of the Map object to place your code.
Put the Tool in the User’s Hand
To “put the tool in the user’s hand”, set the CurrentTool property of the Map object to the tool:
Map1.CurrentTool = miZoomInTool
-orMap1.CurrentTool = 99
Creating Polygon Drawing Tools (Polytools)
A polytool is a tool that lets the user click repeatedly—for example, to draw a polygon or polyline.
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).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
127
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 12: MapX Tools
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
128
MapX_Mobile_DevGuide.pdf
13
Distributing Your MapX
Mobile Application
The MapX Mobile product you have purchased from MapInfo is a
developer's kit. It contains MapX Mobile, sample programs, an on-line
help system, sample maps and geosets, and various utilities and
other support files. This chapter deals with distributing your MapX
Mobile application(s) to your customers. Please be reminded that you
must purchase a user license (i.e., seat) as evidenced by a MapInfo
license certificate for each user of each application that you distribute
with MapX Mobile functionality as described in the MapInfo Standard
License/Development Environments, which is included in your
product packaging.
In this chapter:
Š
Š
Š
Š
Š
Š
MapX Mobile Customer Installation . . . . . . . . . . . . . . . . . . . . .
Installing MapX Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Installing Raster Format Handlers . . . . . . . . . . . . . . . . . . . . . .
Installing Maps and Geosets . . . . . . . . . . . . . . . . . . . . . . . . . . .
Adding Keys to the Windows Registry. . . . . . . . . . . . . . . . . . .
Passing in the MapX License String . . . . . . . . . . . . . . . . . . . . .
130
132
134
135
136
136
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
MapX Mobile Customer Installation
Providing the MapX Mobile Control (i.e., the piece of MapX Mobile that needs to be distributed
within your applications in order for them to work properly) in your MapX Mobile applications can
be a difficult task for the inexperienced programmer due to the high number of dependent files and
their complex structure.Therefore, we have automated the distribution process for you. Basically,
there are two methods of distributing the MapX Mobile Control with your MapX Mobile
applications. They are:
•
Use the MapX Mobile Device Installer that is provided on the MapX Mobile CD. This is the
easiest method of distribution as it entails very little effort on the part of a MapX Mobile
developer because certain procedures and tasks are automated.
•
Integrate MapX Mobile control with 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.
Typically the steps outlined below would be added to your applications installer instead of using
the MapX Device Installer as is.
Files Installed Automatically with the Device Installer
These files are automatically installed when the Installer method of adding the Map Control is
used. The installer can be found in the \Program\Mobile folder on the MapX Mobile CD. To run the
installer you need all the contents of the \Program\Mobile folder. Then run the setup.exe in that
folder. This installs MapX Mobile to any of the MapX Mobile supported Pocket PC platforms.
These files are installed to \Program Files\MapInfo\MapX Mobile
•
MapX50.dll and its dependencies
•
Device utilities GeosetManager50.exe and GeoDictionaryManager50.exe and their
dependent dlls
•
Raster handlers *.rh* and all of their dependent dlls for all raster formats supported in
MapX Mobile
•
mapinfow.prj - a file that contains projection information for all projections supported in
MapX Mobile
•
mapx.abb - an abbreviations file used by the MapX Mobile Find.Search and
Find.SearchEx methods
•
mapx.pen - file that contains line style information
•
MapX Mobile fonts are installed to \windows\fonts
The device installer will also create a \Maps and \Data directory under the \My Documents folder
on your device. To conserve space no maps or data are actually installed to these directories.
Files NOT Installed Automatically with the Installer
•
Custom Symbols. The Device Installer does not install any Custom Symbols (bitmap
symbols), but does create a custsymb folder underneath the MapX Mobile folder. If your
application has layers that use custom symbols, you will need to put them into the
custymb folder on each device. Note that a full set of custom symbols is installed with the
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
130
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
Desktop installer of MapX Mobile in the custsymb folder typically c:\program
files\mapinfo\mapx mobile\custsymb.
•
Note:
NADCON Support Files. The Device Installer does not install the North American Datum
Conversion files. If your application uses layer or map projections Nad 27 and Nad 83 you
will want these files. Install them into the same folder as MapX50.dll on the device,
typically \program files\mapinfo\mapx mobile. Note that the NADCON files are installed
with the Desktop installer of MapX Mobile in the NADCON folder typically c:\program
files\mapinfo\mapx mobile\NADCON.
The reason the above files are not installed automatically is that they take up valuable
space on the device, and so only applications that actually need the files should install
them.
Integrating MapX Mobile into your Application Installer
When you deliver your application to customers, you will need to install:
•
The software you created
•
MapX Control (Either via the MapX Mobile Device Installer –OR– your own, customized
version)
•
Related support files
•
Maps and geosets that are used by your application
•
Any custom raster handlers specific to your files.
Ideally you will incorporate the installation of MapX Mobile into your installation procedure, so that
your end user won’t need to perform a separate installation to install MapX.
There are four main steps to installing and distributing MapX applications:
1. Install the necessary files onto your user's Pocket PC Device.
2. Run utilities (such as regsvrce.exe) to register specific files on the user's system.
3. Add specific keys to the Windows registry
4. Pass in the MapX license string at application runtime.
Note:
If you are creating the MapX control using the CMapX::Create() method in MapX.h from
Visual C++ you do need to take this extra step.
The files that are installed with MapX can be divided into the following categories:
Required files:
•
MapX Mobile and its dependent DLLs
•
Windows system files: including fonts, MFC, and OLE dlls
Optional files:
•
Dataset drivers (used for databinding)
•
Import/Export raster handlers
•
Maps and Geosets
•
Bitmap symbols
•
Nadcon support files
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
131
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
Installing MapX Mobile
MapX Mobile v5.0 should be installed into the Program Files\MapInfo\MapX Mobile folder,
whereas all of the files necessary for your application should go under a directory meaningful to
the end-user and your specific application.
Note:
MapX Mobile uses some files that are not located in the MapX Mobile program directory.
For example, MapX uses MFC and OLE dlls that reside in the Windows System directory.
Location of Device Files that Need to be Installed
The MapX Mobile desktop installer creates a directory where all of the files you need to install to a
Pocket PC device are located. The directory is typically C:\Program Files\MapInfo\MapX
Mobile\target\arm. Note that regsvrce.exe is also located in this folder.
Files
Where to Install Files
Other Special Requirements
MapX50.dll
\program files\mapinfo\mapx mobile
Register with regsvrce.exe
MasterRes.dll, mxintl50.dll
\program files\mapinfo\mapx mobile
Main Resource DLLs. Must be installed
before registering mapx50.dll
Midlg50.dll, midlin50.dll
\program files\mapinfo\mapx mobile
MapX Dialogs. If your app does not use
any mapx mobile dialogs, you do not
need these
Mirasteru.dll
\program files\mapinfo\mapx mobile
Raster Engine. Needed if your application needs to display raster layers. See
Installing Raster Format Handlers on
page 134, for raster handler information.
GeosetManager50.exe
GeosetManagerIntl50.exe
\program files\mapinfo\mapx mobile
Optional. Full GeosetManager that runs
on the device. If your end users do not
need to create/edit geosets, you can
leave it out. There is also a GeosetManager in the desktop install that runs
on the desktop computer.
GeoDictionaryManager50.exe,
GeoDictionaryManagerIntl50.exe
\program files\mapinfo\mapx mobile
Optional. Full GeosetDictonary Manager that runs on the device. Use to
register layers for DataBinding. If your
app does not use Automatic Databinding, you can leave it out. There is currently no other way to register tables
into the geodictionary on the device.
MapXADODS.dll
\program files\mapinfo\mapx mobile
MapX ADO Dataset Driver. Must be
registered. Only needed if your application adds MapX ADO datasets.
MSafeArrayDS.dll
\program files\mapinfo\mapx mobile
MapX SafeArray Dataset Driver. Must
be registered. Only needed if your
application adds MapX SafeArray
datasets.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
132
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
MapX Dependent Files
Files
Where to Install Files
MapX.abb
MapX.pen
mapinfow.fnt
mapinfow.prj
Other Special Requirements
\program files\mapinfo\mapx mobile
Required
MapX Font Files
Where to Install
Files
Files
MAPIS___.TTF
MAPSYM.TTF TTMIAR__.TTF
TTMICG__.TTF TTMIMI__.TTF
TTMIOG__.TTF TTMIOS__.TTF
TTMIRE__.TTF TTMITC__.TTF
TTMIWE__.TTF
\windows\fonts
Other Special Requirements
Only install fonts that are used by layers in your
application. These are the MapInfo symbol fonts.
After installing, the PocketPC needs to have a
Soft Reset (reboot) before it will recognize the
new fonts.
Nadcon Support Files
Files
Where to Install Files
Other Special Requirements
ALASKA.LAS
ALASKA.LOS
CONUS.LAS
CONUS.LOS
HAWAII.LAS
HAWAII.LOS
PRVI.LAS
PRVI.LOS
STGEORGE.LAS
STGEORGE.LOS
STLRNC.LAS
STLRNC.LOS
STPAUL.LAS
STPAUL.LOS
\program files\mapinfo\mapx mobile
Only required if using layers with the NAD 27
and NAD 83 coordinate systems.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
133
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
Bitmap Symbols
Files
Other Special
Requirements
Where to Install Files
TOWE1-32.BMP, POLI1-32.BMP, MBOX2-32.BMP,
GOLF1-32.BMP, TOWE2-32.BMP,RAIL1-32.BMP,
MOSQ1-32.BMP, HOSP1-32.BMP, IEL2-32.BMP,
RAIL2-32.BMP,ONEW1-32.BMP, HOUS1-32.BMP,
ADG1- 32.BMP, ONEW2-32.BMP, HOUS2- 32.BMP,
ADG2-32.BMP, HOUS3-32.BMP, ANK1-32.BMP,
ANK2-32.BMP, OOK1- 32.BMP, AMP1-32.BMP,
TRAF1-32.BMP, AR1-32.BMP, TRUC1-32.BMP,
RAIL3- 32.BMP, AUT1-32.BMP, TRUC2-32.BMP,
REST1-32.BMP, PENC1-32.BMP, HUR1- 32.BMP,
YIEL1-32.BMP, STAT1-32.BMP, PIN1-32.BMP,
HYDR1-32.BMP, AMBU1- 32.BMP,
STOP1-32.BMP,PIN2-32.BMP, INTE1-32.BMP,
COMP1-32.BMP, SYNA1- 32.BMP, PIN3-32.BMP,
LITE1-32.BMP, FARM1-32.BMP, TARG1-32.BMP,
PIN4- 32.BMP, LITE2-32.BMP, FAST1-32.BMP,
TAXI1-32.BMP, PIN5-32.BMP, MAIL1- 32.BMP,
FIRE1-32.BMP, TEMP1-32.BMP, PIN6-32.BMP,
MBOX1-32.BMP, GLOB1- 32.BMP
\program files\mapinfo\
mapx mobile\custsymb
Only install the bitmap
symbols used by layers in
your application
Registering Files and Installing Dataset Drivers
As mentioned in the preceding table, some files need to be ‘registered’. Most of the files that
need to be registered can be registered by running the utility regsvrce.exe:
•
regsvrce <filespec of mapx50.dll>
Installing Raster Format Handlers
MapX Mobile also allows the developer to incorporate raster images into their application. A MapX
application may open various raster image types. The appropriate drivers must be included when
distributing your application.
MapX Mobile can use one of many different libraries to load a raster image. When a raster image
is loaded by MapX, it will search the DLLs and automatically find the correct one for a given image.
The format handlers are 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.
Note:
All of these raster handlers should be installed in the same directory as MapX, which is
usually found in the MapX Mobile directory: \Program Files\MapInfo\MapX Mobile
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
134
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
Files
Where to Install Files
Other Special
Requirements
Halo.rhv, mihiffl.dll BMP-miffbmp.dll, GIFmiffgif.dll, JPG-miffjpeg.dll, PCX-miffpcx.dll, TARGA-mifftga.dll, TIF-mifftiff.dll
\program files\mapinfo\mapx mobile
Halo format handler.
TIFF.RHL
\program files\mapinfo\mapx mobile
TIFF format handler
SPOT.RHD
\program files\mapinfo\mapx mobile
SPOT format handler
ecw.RHl, NCScnet.dll, NCSEcw.dll
NCSUtil.dll
\program files\mapinfo\mapx mobile
ECW format handler
Installing Maps and Geosets
It is recommended that your maps be installed to \My documents\Maps if your users will need to
either browse for Map Layers or if they will need to use ActiveSync to update Map Layer files back
to the desktop. The file open dialog on the Pocket PC can only browse in the \My Documents
folder. The MapX Mobile device installer creates a \My Documents\Maps folder and puts an empty
geodictionary into it. If your application has layers that you do not want the end users to browse to,
you can consider putting them some where else besides the \My Documents folder.
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.
By registering a MapInfo table in the GeoDictionary, that table can be used for autobinding. To get
more information regarding autobinding, please consult Chapter 6: Putting Your Data On The
Map. GeoDictionaryManager50.exe adds appropriate entries into the Geodictionary (geodict.dct).
If the Geodictionary does not exist, GeoDictionaryManager50.exe creates one. This step must be
done after all of the Geosets and associated tables are installed on the device. If the table you are
registering is not in the same directory on the device as the Geodictionary file, the
GeodictionaryManager50.exe will ask you whether you wish to copy the maps to the
Geodictionary directory or add the path to the table to the list of search paths.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
135
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 13: Distributing Your MapX Mobile Application
Adding Keys to the Windows Registry
MapX Mobile also uses the following three registry keys (which your installer must create on the
end-user's system, if they do not exist already). The MapX Mobile installer creates these three
keys when you install MapX Mobile on your system. Therefore, if you want to see what these
registry keys should look like, view your system's registry using a utility such as the Registry
Editor.
Key
Description
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX Mobile\5.0\GeoDictionary
String - The GeoDictionary key has the file specification for the geodictionary file.
Example: \My Documents\Maps\GeoDict.DCT
Note: If you do not need to do autobinding you do
not have to have a geodictionary. Just set the
key to \My Documents\Maps\ include the
trailing slash.
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX Mobile\5.0\SearchPaths
String - The SearchPaths key has semicolon delimited file specifications of where map files and geosets
may exist; it defaults to an empty string ("") other than
in the directory specified in the GeoDictionary key.
Optional
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX Mobile\5.0\ProgramDir
String - Has the location of the folder where MapX
and support files are Located.
Example: \Program Files\MapInfo\MapX Mobile
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.
Passing in the MapX License String
In order to instantiate a runtime version of MapX on your user’s computer, the license string must
be passed in at the time of object creation during the executing of your application.
Note:
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().
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
136
MapX_Mobile_DevGuide.pdf
The MapX Object
Reference
This chapter is an alphabetically organized reference that describes
the objects, properties, and methods of MapInfo MapX.
14
Developer Guide
Chapter 14: The MapX Object Reference
Affine Transform Object
An AffineTransform object allows you to define rotated or skewed coordinate systems.
Object Properties
•
AffineTransform.A, B, C, D, E, F properties
Object Methods
•
AffineTransform.Set method
•
AffineTransform.Units method
Remarks
All properties are read-only. To modify the AffineTransform object, use the Set method.
To obtain an AffineTransform object, reference the CoordSys object's AffineTransform
property, or declare a new, stand-alone Affine Transform object.
See Also
For an introduction to affine transformations, see Using Coordinate Systems in Chapter 11 on
page 106.
AffineTransform.A, B, C, D, E, F properties
Purpose
These are read-only properties, representing the parameters of an affine transformation; return
double values.
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:
A
Performs scaling or stretching along X axis.
B
Performs rotation or skewing along X axis.
C
Performs shifting along X axis.
D
Performs rotation or skewing along Y axis.
E
Performs scaling or stretching along Y axis.
F
Performs shifting along Y axis.
These properties are all read-only; to set the properties, use the Set method.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
138
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
AffineTransform.Set method
Purpose
This method sets the properties of an affine transformation.
Syntax
OBJECT.Set UNITS [A, B, C, D, E, F]
Part
Description
OBJECT
An AffineTransform object.
UNITS
A MapUnitConstants value, such as miUnitMeter (7).
A
Double value; performs scaling or stretching along X axis.
B
Double value; performs rotation or skewing along X axis.
C
Double value; performs shifting along X axis.
D
Double value; performs scaling or stretching along Y axis.
E
Double value; performs rotation or skewing along Y axis.
F
Double value; performs shifting along Y axis.
Remarks
All arguments are required.
An affine transformation has the following form:
x' = Ax + By + C
y' = Dx + Ey + F
In these equations, the base coordinates (x,y) are transformed to produce the derived
coordinates (x', y').
AffineTransform.Units method
Purpose
This is a read-only property that specifies the map units used by an affine transformation. It returns
a short value matching one of the MapUnitConstants.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
139
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
AllFeaturesConstraint Object
This object allows the programmer to specify that all features in a remote map layer should be
stored in the cache. An AllFeaturesConstraint object is created by calling the
Layer.CreateAllFeaturesConstraint method. A layer can have more than one
AllFeaturesConstraint object associated with it. The Enable and Disable methods of the
AllFeaturesConstraint object can be used to add and remove this constraint after it is created. The
Enabled property can be used to determine the current state of the constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
•
AllFeaturesConstraint.Enabled property
Object Methods
•
AllFeaturesConstraint.Disable method
•
AllFeaturesConstraint.Enable method
See Also
LayerInfo Object on page 271
Layer.CreateAllFeaturesConstraint method on page 243
Layer.Refresh method on page 255
BoundsConstraint Object on page 153
FeaturesConstraint Object on page 187
AllFeaturesConstraint.Disable method
Purpose
Once an AllFeaturesConstraint object is created, this method, along with the Enable method, is
used to control whether the constraint defined by the object is used. When disabled the
AllFeaturesConstraint object is not used to determine which records are stored in the cache. When
enabled the AllFeaturesConstraint object is used to determine which records are stored in the
cache. Unlike the other constraint objects, when instantiated an AllFeaturesConstraint object is
disabled by default.
Syntax
OBJECT.Disable
OBJECT – An AllFeaturesConstraint object
See Also
AllFeaturesConstraint.Enabled property on page 141
AllFeaturesConstraint.Enable method on page 141
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
140
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
AllFeaturesConstraint.Enable method
Purpose
Once an AllFeaturesConstraint object is created, this method, along with the Disable method, is
used to control whether the constraint defined by the object is used. When disabled the
AllFeaturesConstraint object is not used to determine which records are stored in the cache. When
enabled the AllFeaturesConstraint object is used to determine which records are stored in the
Cache. When instantiated an AllFeaturesConstraint object is disabled by default, therefore, this
method must be used to initially use the constraint.
Syntax
OBJECT.Enable
OBJECT – An AllFeaturesConstraint object
See Also
AllFeaturesConstraint.Enabled property on page 141
AllFeaturesConstraint.Disable method on page 140
AllFeaturesConstraint.Enabled property
Purpose
This is a boolean, read-only property. When TRUE, the AllFeaturesConstraint object is being used
to determine what map features are stored in the cache. When FALSE the AllFeaturesConstraint
object is not being used.
See Also
AllFeaturesConstraint.Enable method on page 141
AllFeaturesConstraint.Disable method on page 140
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
141
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Annotation Object and Annotations Collection
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 on page 285
Graphic Object on page 224
Annotation.Graphic property
Purpose
This property contains a Graphic object, which contains the properties for the Annotation. See
Graphic object description.
See Also
Graphic Object on page 224
Annotation.Type property
Purpose
This property specifies the annotation type. This is an AnnotationTypeConstants on page 447
value, and can be either miSymbolAnnotation or miTextAnnotation. This is a read-only property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
142
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Annotations.ActiveAnnotation method
Purpose
This method returns the active (currently selected) annotation.
Syntax
OBJECT.ActiveAnnotation
Annotations.AddSymbol method
Purpose
This method adds a symbol to the Annotations collection. The default style is used (as specified in
Map.DefaultStyle).
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 on page 296
Graphic.X property on page 225
Graphic.Y property on page 225
Annotations.AddText method
Purpose
This method adds a text annotation to the Annotations collection. A default style is used (as
specified in Map.DefaultStyle).
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).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
143
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
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 on page 296
Graphic.Caption property on page 224
Graphic.Position property on page 224
Graphic.X property on page 225
Graphic.Y property on page 225
Annotations.Count property
Purpose
This property specifies the number of Annotation objects in the collection. This is an integer
value, and is read-only.
Annotations.Editable property
Purpose
This property controls whether the annotations are editable by the end user. An editable
annotation can be moved, resized and edited in place by the end user. This is a Boolean value,
and defaults to True.
Annotations.Item property
Purpose
This property gets an Annotation object from the collection. An index is used to specify which
Annotation to get. The index is an integer value from 1 to Annotations.Count. This is the default
property for the Annotations collection.
See Also
Annotations.Count property on page 144
Annotations.Remove method
Purpose
This method removes an Annotation object from the collection.
Note:
If you remove an item, the collection indexes are renumbered to fill in the hole left by the
item removed.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
144
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 on page 144
Annotations.RemoveAll method
Purpose
Removes all annotation objects from the collection.
Syntax
OBJECT.RemoveAll
Part
OBJECT
Description
Represents a place holder for an Annotation object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
145
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
BindLayer Object
The BindLayer object is used as a parameter to the Datasets.Add method. It is used to specify
information on how to perform the data binding. This is required when binding data that has X and
Y coordinates or data like ZIP codes, and you want points created at these locations in a new
layer.
Object Properties
•
BindLayer.CoordSys property
•
BindLayer.Filespec property
•
BindLayer.KeyLength property
•
BindLayer.LayerName property
•
BindLayer.LayerType property
•
BindLayer.OverwriteFile property
•
BindLayer.RefColumn1 property
•
BindLayer.RefColumn2 property
•
BindLayer.ReferenceLayer property
•
BindLayer.ReferenceLayerField property
See Also
Datasets.Add method on page 167
BindLayer.CoordSys property
Purpose
This property uses a CoordSys object that controls the coordinate system used when you create a
layer.
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 ycoordinates. 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.Filespec property
Purpose
This property allows you to specify the name and location of a file, so that the Datasets.Add
method can create a permanent layer instead of a temporary layer. It is a string property which
should be set to the file path of the layer to create.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
146
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
BindLayer.KeyLength property
Purpose
This is an integer property that specifies the length of the character column in the layer that is
produced by Datasets.Add.
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.
BindLayer.LayerName property
Purpose
This property specifies the name of the layer to bind data to if BindLayer.LayerType is
miBindLayerTypeNormal, or the name of the newly created layer if BindLayer.LayerType is
miBindLayerTypeXY or miBindLayerTypePointRef. This is a string value.
See Also
BindLayerTypeConstants in Appendix G on page 448
BindLayer.ReferenceLayer property on page 149
BindLayer.LayerType property on page 147
BindLayer.RefColumn1 property on page 149
BindLayer.RefColumn2 property on page 149
BindLayer.LayerType property
Purpose
This property specifies what layer type data is being bound to. Binding data refers to the process
of creating a Dataset, which is done using the Datasets.Add method. This property takes a
BindLayerTypeConstant value, as described below.
Discussion
If set to miBindLayerTypeNormal, that means you are binding (adding) data to a layer in the
GeoDictionary.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
147
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 on page 167
BindLayerTypeConstants on page 448
BindLayer.ReferenceLayer property on page 149
BindLayer.LayerType property on page 147
BindLayer.RefColumn1 property on page 149
BindLayer.RefColumn2 property on page 149
BindLayer.OverwriteFile property
Purpose
This property allows one to specify whether or not MapX overwrites the file specified by the
Bindlayer.Filespec property (if it already exists). This is a Boolean property which is false by
default.
Remarks
This property applies to the X/Y and point-ref data binding (i.e., the BindLayer.LayerType property
is miBindLayerTypeXY or miBindLayerTypePointRef).
This property is used in conjunction with the BindLayer.FileSpec property AND by the
Datasets.Add method to create a permanent layer, stored at the path specified. If this property is
set to false, but the file specified by the BindLayer.Filespec property DOES exist, exception #1230
is thrown.
See Also
BindLayer.LayerType property on page 147
BindLayer.Filespec property on page 146
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
148
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Datasets.Add method on page 167
BindLayer.RefColumn1 property
Purpose
This property specifies the field name or field number (starting at one) of either:
•
the field containing the X value (longitude) when BindLayer.LayerType is
miBindLayerTypeXY.
•
the field containing the reference value (such as ZIP Code) when BindLayer.LayerType is
miBindLayerTypePointRef.
See Also
BindLayerTypeConstants on page 448
BindLayer.RefColumn2 property
Purpose
This property specifies the field name or field number (starting at one) of the field containing the Y
value (latitude) when BindLayer.LayerType is miBindLayerTypeXY.
See Also
BindLayer.LayerType property on page 147
BindLayerTypeConstants on page 448
BindLayer.ReferenceLayer property
Purpose
This property specifies the name of the reference file to use if BindLayer.LayerType is
miBindLayerTypePointRef. A reference layer is used when doing reference binding. This specifies
the name of the reference file to use. A reference file contains the x and y coordinates for items
such as ZIP codes. MapX ships with the “US 5 Digit ZIP Code Centers” layer which may be used
for pointref binding at the ZIP Code level.
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 property on page 147
BindLayerTypeConstants on page 448
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
149
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
BindLayer.ReferenceLayerField property
Purpose
This specifies what field (by number, starting at 1) in the MapInfo table to bind to. If not specified,
MapX will sample the source data for the column and choose the column with the highest match
rate. If none match, then the first column is chosen. A field must be indexed before a bind using
the specified field.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
150
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
BitmapSymbol Object and BitmapSymbols Collection
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.
Remarks
The symbol bitmap sizes range from 1 - 48 points. If a BitmapSymbol is less than 1 point size then
the Size property is set to 1. If a BitmapSymbols size is greater than 48 points then the Size
property is set to 48.
Please be aware that 2, 16 and 256 bit color bitmaps ARE supported and 24 bit color is NOT.
Note:
BitmapSymbols.Item is the default property for the BitmapSymbols collection.
Object Properties
•
BitmapSymbol.Name property
Collection Properties
•
BitmapSymbols.Count property
•
BitmapSymbols.Item property
Collection Methods
•
BitmapSymbols.Refresh method
•
BitmapSymbols.Unload method
BitmapSymbol.Name property
Purpose
This is a read-only string representing the file name (e.g., “filename.bmp”) that identifies a bitmap
symbol.
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.
BitmapSymbols.Count property
Purpose
This read-only property returns the number of items in the collection (i.e., the number of bitmaps
available to be used as bitmap symbols).
Note:
Please be aware that 2, 16 and 256 bit color bitmaps ARE supported and 24 bit color is
NOT.
BitmapSymbols.Item property
Purpose
This read-only property returns a BitmapSymbol object from the collection—use a numeric index
only. This is the default property for the BitmapSymbols collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
151
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
[BitmapSymbol= ]OBJECT.Item (index)
Part
Description
OBJECT
Represents a BitmapSymbol object.
index
An integer indicating which BitmapSymbol object to return.
BitmapSymbols.Refresh method
Purpose
This updates the BitmapSymbols collection, if necessary, to guarantee that the collection is
current.
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 ()
BitmapSymbols.Unload method
Purpose
Unloads all previously loaded .bmp files, and frees any associated resources.
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 ()
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
152
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
BoundsConstraint Object
This object allows the programmer to specify which features is cached for a remote database layer
by specifying the bounds of a rectangle. Any features for which the MinimumBoundingRectangle
(MBR) of the feature intersects the MBR of the rectangle used to define this constraint will be
saved in the cache. A BoundsConstraint object is created by calling the
Layer.CreateBoundsConstraint method. A layer can have more than one BoundsConstraint object
associated with it. The Enable and Disable methods of the BoundsConstraint object can be used
to add and remove this constraint after it is created. The Enabled property can be used to
determine the current state of the constraint. The Bounds property can be used to set or check the
MBR that defines this constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
•
BoundsConstraint.Bounds property
•
BoundsConstraint.Enabled property
Object Methods
•
BoundsConstraint.Disable method
•
BoundsConstraint.Enable method
See Also
LayerInfo Object on page 271
Layer.CreateBoundsConstraint method on page 244
Rectangle Object on page 332
FeaturesConstraint Object on page 187
AllFeaturesConstraint Object on page 140
BoundsConstraint.Bounds property
Purpose
This is a read/write property that takes or returns a MapX Rectangle object. The Rectangle defines
the geographic extents of the BoundsConstraint object, which determines what features are stored
in the cache. Any features for which the MinimumBoundingRectangle (MBR) of the feature
intersects the MBR of the rectangle used to define this constraint will be saved in the cache. By
changing the Bounds property you are potentially changing which features are stored in the cache.
Syntax
[Rectangle= ] OBJECT.Bounds
[Rectangle=] – A returned MapX Rectangle object
OBJECT – A BoundsConstraint object
See Also
Rectangle Object on page 332
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
153
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
BoundsConstraint.Disable method
Purpose
Once a BoundsConstraint object is created, this method, along with the BoundsConstraint.Enable
method, is used to control whether the constraint defined by the object is used. When disabled the
BoundsConstraint object is not used to determine which records are stored in the cache. When
enabled the BoundsConstraint object is used to determine which records are stored in the cache.
When instantiated a BoundsConstraint object is enabled by default.
Syntax
OBJECT.Disable
OBJECT – A BoundsConstraint object
See Also
BoundsConstraint.Enabled property on page 154
BoundsConstraint.Enable method on page 154
BoundsConstraint.Disable method on page 154
BoundsConstraint.Enable method
Purpose
Once a BoundsConstraint object is created, this method, along with the Disable method, is used to
control whether the constraint defined by the object is used. When disabled the BoundsConstraint
object is not used to determine which records are stored in the cache. When enabled the
BoundsConstraint object is used to determine which records are stored in the Cache. When
instantiated a BoundsConstraint object is enabled by default, this method need only be used when
the BoundsConstraint has been disabled via the BoundsConstraint.Disable method.
Syntax
OBJECT.Enable
OBJECT – A BoundsConstraint object
See Also
BoundsConstraint Object on page 153
BoundsConstraint.Enabled property on page 154
BoundsConstraint.Disable method on page 154
BoundsConstraint.Enabled property
Purpose
This is a boolean, read only property. When TRUE, the BoundsConstraint object is being used to
determine what map features are stored in the cache. When FALSE the BoundsConstraint object
is not being used.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
154
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
BoundsConstraint.Enable method on page 154
BoundsConstraint.Disable method on page 154
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
155
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
CoordSys Object
A CoordSys object represents a coordinate system.
Object Properties
•
CoordSys.AffineTransform property
•
CoordSys.Azimuth property
•
CoordSys.Bounds property
•
CoordSys.Datum property
•
CoordSys.FalseEasting and CoordSys.FalseNorthing properties ()
•
CoordSys.OriginLatitude, OriginLongitude properties
•
CoordSys.Range property
•
CoordSys.ScaleFactor property
•
CoordSys.StandardParallelOne, StandardParallelTwo properties
•
CoordSys.Type property
•
CoordSys.Units property
Object Methods
•
CoordSys.Clone method
•
CoordSys.PickCoordSys method
•
CoordSys.Set method
Remarks
All properties are read-only. To modify a coordinate system, use the Set method or the
PickCoordSys method, or assign it to equal another CoordSys object.
To obtain a CoordSys object, reference the Map.DisplayCoordSys property,
Map.NumericCoordSys property, or Layer.CoordSys property.
See Also
Chapter 11: Using Coordinate Systems
Map.DisplayCoordSys property on page 296
Map.NumericCoordSys property on page 306
Layer.CoordSys property on page 245
CoordSys.AffineTransform property
Purpose
This is a read-only property that returns an AffineTransform object.
See Also
Affine Transform Object on page 138
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
156
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
CoordSys.Azimuth property
Purpose
This is a read-only property that returns a double value representing the coordinate system's
azimuth.
CoordSys.Bounds property
Purpose
This is a read-only property that returns a rectangle object representing the bounds of the
coordinate system.
CoordSys.Clone method
Purpose
Makes a copy of this coordinate system as a new CoordSys object.
Syntax
[CoordSys= ]OBJECT.Clone ()
CoordSys.Datum property
Purpose
This is a read-only property that returns a Datum object.
See Also
Datum Object on page 171
CoordSys.FalseEasting and CoordSys.FalseNorthing properties ()
Purpose
These are read-only properties that return double values, representing coordinate system's false
easting/false northing settings.
Remarks
The units are determined by the CoordSys.Unit property.
CoordSys.OriginLatitude, OriginLongitude properties
Purpose
This are read-only properties that return the coordinate system's origin latitude/origin longitude
settings, as double values.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
157
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
CoordSys.PickCoordSys method
Purpose
This displays a dialog box that allows the user to select a coordinate system.
Syntax
[Boolean=]OBJECT.PickCoordSys ([HelpFile], [ID])
Part
Description
OBJECT
A CoordSys object.
HelpFile
Variant: A string identifying the name and location of a Windows Help file. Optional; if omitted,
the dialog appears without Help button.
HelpID
Variant: An integer ID number that identifies which Help topic to display. Optional; the dialog
appears without a Help button.
Remarks
The dialog box is automatically initialized, so that the highlighted description matches the
CoordSys object.
If the user clicks OK on the dialog box, the method returns True, and the CoordSys object is
updated to match the coordinate system that the user chose. If the user clicks Cancel, the method
returns False, and the CoordSys object is left unchanged.
MapX initializes the list of available coordinate systems by reading the contents of the file
mapinfow.prj, which is located in the same directory as mapx50.dll.
CoordSys.Range property
Purpose
This is a read-only property that returns a double value, representing the coordinate system's
range (a number from 1 to 180, dictating how much of the earth will be visible).
CoordSys.ScaleFactor property
Purpose
This is a read-only property that returns a double value representing the coordinate system's scale
factor.
CoordSys.Set method
Purpose
This method sets the properties of a CoordSys object.
Syntax
OBJECT.Set (Type, [Datum], [Units], [OriginLongitude], [OriginLatitude],
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
158
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
[StandardParallelOne], [StandardParallelTwo], [Azimuth], [ScaleFactor],
[FalseEasting], [FalseNorthing], [Range], [Bounds], [AffineTransform] )
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
OriginLatitude
Double values, indicating the standard parallels (in degrees of the latitude).
StandardParallelOne
StandardParallelTwo
Double values, indicating the standard parallels (in degrees of latitude).
Azimuth
Double value, representing the azimuth, in degrees.
ScaleFactor
Double value, representing a scale factor.
FalseEasting
FalseNorthing
Double values, representing Falseeasting and FalseNorthing (in 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.
CoordSys.StandardParallelOne, StandardParallelTwo properties
Purpose
This is a read-only property that returns the coordinate system's standard parallel settings, as
double values in degrees of latitude.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
159
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
CoordSys.Type property
Purpose
This is a read-only property that returns a short value matching one of the
CoordSysTypeConstants.
CoordSys.Units property
Purpose
This is a read-only property that returns a short value matching one of the MapUnitConstants.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
160
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Dataset Object and Datasets Collection
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.
Data Binding
Data Binding is the process of bringing data from a data source into MapX. The data source might
be a Visual Basic data control, or an ODBC data source. In MapX, the data is represented as a
Dataset object.
Data binding can be done two ways. If you have Visual Basic for bound data controls, at design
time you can use the Dataset property of the Map object. Or, bind data programmatically by using
the Datasets.Add method. This method requires you to tell MapX which data source to use, some
information about it, and which map layer to bind it to.
The binding process results in the creation of a Dataset object. This Dataset, which is added to the
Datasets collection, contains computed values for features in the map layer that the data is bound
to. For example, if data is bound to US_States map, each state would have a new data value that
could then be used to control how the states are drawn. If the data source had multiple records for
a state, the values could be summed, averaged, or counted. The Dataset has a Value method you
can use to access the computed value for each row (or feature) of the map.
A DataSource (the second parameter for Datasets.Add) is actually an OLE interface. MapX uses
the interface to access the data directly from the data source. The data isn't actually passed to
Datasets.Add.
For an in depth information on datatypes supported by MapX, see Chapter 6: Putting Your Data
On The Map .
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
161
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Collection Properties
•
Datasets.BuildSourceRows property
•
Datasets.Count property
•
Datasets.Item property
Collection Methods
•
Datasets.Add method
•
Datasets.Contains method
•
Datasets.Remove method
•
Datasets.RemoveAll method
•
Datasets.Restore method
Dataset.AddField method
Purpose
This allows a field ('column') to be added to a Dataset that is an expression containing functions,
operators, and Datasets fields (from the current Dataset only). This will add a new field to the
Dataset's field collection for labelling, thematics, etc.
Syntax
OBJECT.AddField (Name, Expression)
Part
Description
OBJECT
Represents a Dataset object.
Name
The name of the new field.
Expression
The created expression.
Remarks
The new field will have a type that is either miTypeNumeric or miTypeString depending on the
return type of the expression. Though the aggregation type is set to miAggregationSum, the new
field will not hold the aggregated value of any field.
The new field will have an aggregation type of miAggregationSum for numeric fields and
miAggregationIndividual for string fields.
The field is added to the end of the fields collection for the Dataset and is temporary. That is, when
the application terminates, the field will disappear. Also, the added field is not updateable. If you
try to update the added field, an exception will NOT be thrown.
Exceptions are thrown for invalid expressions, an invalid name parameter, or a non-unique field
name.
See Also
Appendix A: MapX Field Naming Conventions
Appendix H: Creating Expressions
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
162
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Datasets.BuildSourceRows property
Purpose
Datasets created from a Datasets collection with this property set to TRUE, will support the
Dataset.SourceRows method. Those Datasets created from a Datasets collection with this
property set to FALSE will not, and calling Datasets.SourceRows on those Dataset objects will
result in an exception.
Remarks
A given Dataset either supports or does not support the Datasetset.SourceRows method
throughout its lifetime. Changing the property on the Datasets collection will not effect Dataset
object(s) previously created from that Datasets collection.
Dataset.Fields property
Purpose
Fields collection for the Dataset.
See Also
Field Object and Fields Collection on page 203
Dataset.GeoField property
Purpose
The column number of the geographic key column in the Fields collection. This is an Integer value
and a read-only property.
Dataset.Layer property
Purpose
The Layer object this Dataset is bound to.
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.
Dataset.Name property
Purpose
The name of a Dataset. This is a String value.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
163
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Dataset.Refresh method
Purpose
Forces a re-read of the data from the data source.
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 reaggregated 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
Dataset.RowValues property
Purpose
This property returns the RowValues object for a given row. It takes as a parameter either a row ID
number (type Long), a serialized key (type String) or the feature object from which to extract the
key (type Feature).
Syntax
[RowValues=]OBJECT.RowValues(Row)
Part
Description
OBJECT
Represents a Dataset object.
Row
Variant: Can be the FeatureID (integer), the FeatureKey (String), or a Feature object.
Dataset.RowCount property
Purpose
This returns the number of rows in a Dataset. This is an Integer value. This is a read-only property.
Remarks
Since data is bound to a layer, Dataset.RowCount actually returns the number of features in the
layer. Items in a Dataset can have NULL values if no data is bound to the feature.
Dataset.RowCount will return a value of zero when the dataset was created from a DBMS server.
See Also
Layer.AllFeatures method on page 242
Features.Count property on page 185
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
164
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Dataset.ReadOnly property
Purpose
This is a read-only property that indicates if the Dataset is updateable or not. Currently, only
miDatasetLayer Datasets are updateable. Datasets are updated using the Layers.UpdateFeature
or Feature.Update with a RowValues collection.
See Also
RowValue Object and RowValues Collection on page 336
Layer.UpdateFeature method on page 261
Feature.Update method on page 182
Datasets.Restore method
Purpose
This method can be used to restore a Dataset from a map that has been stored to a file using OLE
serialization. Since Datasets rely on external data, the contents of the Datasets are not serialized
to the file along with the rest of the map's information. Datasets.Restore can be used to restore a
Dataset (and its themes) by pointing an unserialized map back to the external data.
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 on page 167
Dataset.SecondaryGeoField property
Purpose
The column number of the secondary geographic key column in the Fields collection. The value
will be 0 if no SecondaryGeoField was specified when the data was added. This is an Integer
value and a read-only property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
165
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Dataset.SourceRows property
Purpose
The SourceRows collection of a Dataset contains the list of rows from the source data that were
matched to a specified row.
See Also
SourceRow Object and SourceRows Collection on page 347
Feature.KeyValue property on page 178
Dataset.Themes property
Purpose
Themes collection for the Dataset.
See Also
Theme Object and Themes Collection on page 374
Dataset.Type property
Purpose
This is a read-only property that returns the type of dataset. The value of this property will be one
of the DataSetTypeConstants values.
See Also
DataSetTypeConstants on page 453
Dataset.Value method
Purpose
This method retrieves values for a specified row and column in the Dataset. This is a default
property for the Dataset object.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
166
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Column
Description
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 Object and Features Collection on page 174
Feature.KeyValue property on page 178
'Feature.Name property on page 180
Datasets.Add method
Purpose
This method creates a specified Dataset and adds it to the collection.
Syntax
OBJECT.Add ( Type, SourceData, [Name], [Geofield], [SecondaryGeofield], [BindLayer], [Fields],
[Dynamic] )
Part
Description
OBJECT
This represents the Dataset object
Type
Type of Dataset being added takes a DataSetTypeConstants value.
SourceData
This is a reference to the data, and is different depending on the TYPE (i.e., IDAORecordset,
ODBCQueryInfo, Layer object, etc.).
Name
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
This the name or index of the column that contains the geographic information. This is an
optional parameter, and if not specified, MapX searches the fields to find one that matches
entries in the GeoDictionary. See also: Map.MatchNumericFields property on page 303.
SecondaryGeofield
Name or index of the column that contains the refining geographic information. This is an
optional parameter.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
167
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
BindLayer
Specifies the Map layer to attach this data to, or, a BindLayerObject 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.
Note: When miBindLayerTypeXY is used within DataSets.Add a temporary table will be
created with one column named “GeoName”, in order for a fields collection to be
recognized a new databind must be created on a permanent layer.
Fields
This is a Field object which is in a collection of Field objects. The field objects are used to
describe which fields from the data source to bring in, and which aggregation function to use
if more than one record for the data source matches a particular map feature. This is an
optional parameter, and if not specified, all columns are brought in, and the data values are
summed if more than one record is encountered per feature.
Dynamic
Variant: A Boolean value that controls whether the data binding is dynamic. Optional; if omitted, defaults to false, meaning that the binding is static (i.e., MapX will copy needed data
when the database is opened). If you specify True, MapX accesses data in a live manner,
only data needed (e.g., when labeling). If you specify True but the Dataset does not support
dynamic columns, an exception will be thrown.
Note:
If ambiguity exists (like multiple geosets), the user can specify an event handler to pick
one. If no event handler is specified, MapX will pick the first one.
Note:
Dataset type: miDatasetLayer—used to create a dataset that references fields from a
MapInfo table. The SourceData parameter is a Layer object.
Note:
When doing BindLayer matching, the geofields must be unique. Only the first item of a
non-unique set of data will be matched. The rest are ignored.
Remarks
If the automatic detection logic is being used, more than one match may be found. If you want to
handle this case, you can implement the ResolveDataBind event handler. Otherwise, MapX
picks the first match.
A SecondaryGeofield is required when the layer that a Dataset is being bound to has a key column
that is not unique by itself. The secondary geofield is then used to uniquely match an object (row)
in the layer.
When miBindLayerTypeXY is used within DataSets.Add a temporary table will be created with one
column named “GeoName”, in order for a fields collection to be recognized a new databind must
be created on a permanent layer.
The GeoField column must be unique if a new layer of points is to be created
(BindLayer.LayerType is miBindLayerTypeXY or miBindLayerTypePointRef). The GeoField
column will be used to name the features in the new point layer. Non-unique values will result in a
single point being added to the new point layer for the first occurrence of the duplicate key value,
and data values in the duplicate rows will be aggregated.
If a Fields collection is specified, the Geofield and SecondaryGeofield parameters refer to columns
in the Fields collection rather than in the source data.
If dynamic data binding is being used, the Field.AggregationFunction property is ignored for all
field, and all fields are aggregated individually. In the case of multiple matching records, the first
will be taken.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
168
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Field Object and Fields Collection on page 203
MapX Field Naming Conventions on page 398
Datasets.Contains method
Purpose
This property returns True if the dataset specified by the argument is present in the collection. The
argument can be either the Dataset name or a 1 based index number. This method is useful for
restoring datasets via the State object.
Syntax
OBJECT.Contains(Index)
Part
Description
OBJECT
This is a Datasets object.
Index
This is the Dataset name or 1 based index number.
See Also
State Object on page 349
Datasets.Count property
Purpose
The number of Dataset objects in the collection. This is a read-only property.
Datasets.Item property
Purpose
This property will retrieve a particular Dataset object from a collection. This is a Variant, and you
can specify the Dataset name or 1 based index number. This is the default property for the
Datasets collection.
Datasets.Remove method
Purpose
Removes a specified Dataset object from the Datasets 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)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
169
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
index
Description
Dataset name or 1 based index number.
Remarks
All themes based off this Dataset are removed as well.
Datasets.RemoveAll method
Purpose
Removes all Dataset objects from the collection.
Syntax
Datasets.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
170
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Datum Object
A Datum object represents the datum used by a CoordSys object. A datum is a singular
mathematical description of the earth's shape and orientation.
Object Properties
•
Datum.Eccentricity property
•
Datum.Ellipsoid property
•
Datum.Flattening property
•
Datum.PrimeMeridian property
•
Datum.RotateX, RotateY, RotateZ properties
•
Datum.ScaleAdjust property
•
Datum.SemiMajorAxis, SemiMinorAxis properties
•
Datum.ShiftX, ShiftY, ShiftZ properties
Object Methods
•
Datum.Set method
•
Datum.SetFromList method
Remarks
All properties are read-only. To modify a Datum object, use the Set method or the SetFromList
method.
To obtain a Datum object, reference a CoordSys object's Datum property.
Datum.Eccentricity property
Purpose
This is a read-only property that returns a double value representing the datum's eccentricity.
Remarks
In equations, eccentricity is usually represented by the letter “e”.
Datum.Ellipsoid property
Purpose
This is a read-only property that returns a short value that identifies the Datum's ellipsoid, such as
28 for “WGS 84."
Datum.Flattening property
Purpose
This is a read-only property that returns a double value representing the Datum's flattening.
Remarks
In equations, flattening is usually represented by the letter f.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
171
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Datum.PrimeMeridian property
Purpose
This is a read-only property that returns a double value representing the longitude of the datum's
prime meridian, in degrees east of Greenwich.
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.
Datum.RotateX, RotateY, RotateZ properties
Purpose
This is a read-only properties; return double values representing the angle, in arc-seconds, to
rotate the datum's ellipsoid around each of its axes.
Datum.ScaleAdjust property
Purpose
This is a read-only property that returns a double value representing the datum's scale correction
factor (the amount, in parts per million, to adjust the size of the ellipsoid).
Remarks
In equations, the scale adjustment is usually represented by the letter m.
Datum.SemiMajorAxis, SemiMinorAxis properties
Purpose
This is a read-only properties; return double values representing the datum's semi-major and
semi-minor axes. Length is in meters.
Remarks
In equations, semi-major axis is usually represented by the letter a, and semi-minor axis is usually
represented by the letter b.
Datum.Set method
Purpose
This method sets the properties that make up a Datum object.
Syntax
OBJECT.Set (Ellipsoid, ShiftX, ShiftY, ShiftZ, RotateX, RotateY, RotateZ, ScaleAdjust,
PrimeMeridian)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
172
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
OBJECT
A Datum object.
Ellipsoid
A short value; must be one of the supported ellipsoid numbers (such as 28
for the “WGS 84” ellipsoid).
ShifX, ShiftY, ShiftZ
Double values, representing the distance (in meters) to shift the ellipsoid
along each of its axes.
RotateX, RotateY, RotateZ
Double Values, representing the angle (in arc-seconds) to rotate the ellipsoid around each of its axes.
ScaleAdjust
Double value, representing a scale correction factor (the amount, in parts
per million, to adjust the size of the ellipsoid).
PrimeMeridian
Double value, representing the longitude of the prime meridian. Usually
zero; see the PrimeMeridian property.
Remarks
All arguments are required.
See Also
Datum.SetFromList method on page 173
Datum.SetFromList method
Purpose
This method sets all of the properties of a Datum object to match the values of one of the datums
in the list of datums.
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).
Datum.ShiftX, ShiftY, ShiftZ properties
Purpose
These read-only properties that return double values indicating the distance (in meters) to shift the
Datum's ellipsoid along each of its axes.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
173
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Feature Object and Features Collection
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.CenterXproperty, CenterY property
•
Feature.FeatureID property
•
Feature.FeatureKey property
•
Feature.HasMultipoint property
•
Feature.HasPolyline property
•
Feature.HasRegion property
•
Feature.KeyValue property
•
Feature.LabelPoint property
•
Feature.Layer property
•
Feature.Length property
•
Feature.Multipoint property
•
'Feature.Name property
•
Feature.Nodes property
•
Feature.Parts property
•
Feature.Perimeter property
•
Feature.Point property
•
Feature.Polyline property
•
Feature.Region property
•
Feature.Smooth property
•
Feature.Style property
•
Feature.Type property
Object Methods
•
Feature.Attach method
•
Feature.Clone method
•
Feature.Offset method
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
174
MapX_Mobile_DevGuide.pdf
Developer Guide
•
Chapter 14: The MapX Object Reference
Feature.Update method
Collection Properties
•
Features.Bounds property
•
Features.Count property
•
Features.Item property
Collection Methods
•
Features.Add method
•
Features.AddByID method
•
Features.Clone method
•
Features.Common method
•
Features.Remove method
•
Features.RemoveByID method
•
Features.Replace method
See Also
Selection Collection on page 340
Layer.Search method on page 255
Feature.Area property
Purpose
A read-only property that returns the area of a region feature; it is not valid for other types of
features.
Remarks
To control the units in which the area is returned, set the Map.AreaUnit property.
This is valid for the Region. The value is in area units. If you modify a feature in a layer, and you
have not yet performed an Update to save the changes, then this property returns a value based
on the “modified” version of the object (the object as it exists in memory).
See Also
Map.AreaUnit property on page 287
Feature.Attach method
Purpose
Attaches a stand-alone feature to the map so that the map's coordinate system applies to the
feature.
Syntax
OBJECT.Attach (Map)
Part
OBJECT
Description
A feature object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
175
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Map
Description
A map object.
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.
Feature.Clone method
Purpose
Make a copy of the feature as a new, stand-alone Feature object.
Syntax
[=Feature]Feature.Clone
Feature.Bounds property
Purpose
This returns a Rectangle object representing the geographic extents of the feature (its Minimum
Bounding Rectangle).
Remarks
In earlier versions of MapX, this property was called MBR.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes,
then this property returns a value based on the “modified” version of the object (the object as it
exists in memory).
See Also
Rectangle Object on page 332
Feature.Caption property
Purpose
A read-write string value, representing the text string that makes up a Text feature. Referencing
this property causes an exception if the feature is not a Text feature.
Syntax
[= string] OBJECT.Caption
Part
Description
OBJECT
A Feature object.
= string
A text string, up to 255 characters long.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
176
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Feature Object and Features Collection on page 174
Feature.CenterXproperty, CenterY property
Purpose
These are read-only double values that indicate the X and Y map coordinates of the feature's
centroid.
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.
Feature.FeatureID property
Purpose
This property returns the ID of the feature. Each feature in a layer contains a unique ID within the
layer. This is an Integer value and is read-only. This is the default property for the Feature object.
Note:
Although this property is still a functional part of MapX, it is recommended that you use the
Feature.FeatureKey property. The FeatureKey property is used to identify a unique
record in a table. In previous versions, the FeatureID property was used for this purpose,
but it did not work correctly for seamless and remote layers. The FeatureKey property
works for all layer types
See Also:
Feature.FeatureKey property on page 177
Feature.FeatureKey property
Purpose
This 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 FeatureKey property).
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 on page 346
Dataset.Value method on page 166
Dataset.SourceRows property on page 166
Layer.UpdateFeature method on page 261)
Layer.DeleteFeature method on page 246
Features.AddByID method on page 183
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
177
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Feature.FeatureKey property on page 177
Features.RemoveByID method on page 185
Selection.SelectByID method on page 343
Feature.HasMultipoint property
Purpose
This read-only property returns true if the Collection object has a Multipoint part or false if it does
not.
Syntax
[bool= ] OBJECT.HasMultipoint
Feature.HasPolyline property
Purpose
This read-only property returns true if the Collection object has Polyline part or false if it does not.
Syntax
[bool= ] OBJECT.HasPolyline
Feature.HasRegion property
Purpose
This read-only property returns true if the Collection object has Region part or false if it does not.
Syntax
[bool= ] OBJECT.HasRegion
Feature.KeyValue property
Purpose
This read/write string property is used to update or set a column (field) in the MapInfo table when
adding or updating a feature or layer.
Remarks
The field value that is set or retrieved is determined by the value of the KeyField property of the
Layer that the feature is from. Although the property is a string property, the string will be
converted to the proper type of the column when updating or inserting.
Only the most recent value of the KeyValue property is used when adding or updating a feature.
That is if you set the KeyValue, change the layer's keyfield property to a different field and then set
the keyvalue again, only the second value will be updated in the MapInfo table for that feature.
See Also
Layer.KeyField property on page 252
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
178
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer Object and Layers Collection on page 239
Feature.LabelPoint property
Purpose
This is a Point object which is the location in map coordinates of the centroid (label point) of a
feature.
See Also
Point Object and Points Collection on page 324
Feature.Layer property
Purpose
This is a read-only property that returns the Layer object the feature is from.
See Also
Layer Object and Layers Collection on page 239
Feature.Length property
Purpose
This is a read-only property that returns the sum of the lengths of the line segments that make up
a polyline. If the feature has several parts, the value returned is the sum of all the line segments in
all the parts.
Note:
The length calculation does not take into account the curvature of the Earth, so it will
generally be inaccurate for line segments spanning long distances. Length is determined
using a modified Cartesian calculation: longitude/latitude coordinates are converted to X,
Y coordinates in MapX's current map units, taking into account the number of miles per
degree of longitude at each line segment's centroid. The distance between the resulting
points is then calculated using the Pythagorean Theorem.
Remarks
To control the units in which the length is returned, set the Map.MapUnit property.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes,
then Feature.Length returns a value based on the “modified” version of the object (the object as it
exists in memory).
See Also
Feature.Perimeter property on page 181
Map.MapUnit property on page 302
Feature.Multipoint property
Purpose
This read/write property returns the Multipoint part of feature, that has a type of
miFeatureTypeCollection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
179
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
Reading from this property returns the multipoint part of a collection feature (if it exists). This
feature is returned as a stand-alone feature, if editing is done on this feature, in order to have edits
saved in a table, user need to update the parent feature.
Writing to this property makes a copy of a feature passed in and sets it into an existing collection
feature.
'Feature.Name
property
Purpose
This is a read-only property that returns the feature name. The feature name is value of the
LabelProperties.DataField field (which also appears as the feature's label).
See Also
LabelProperties.DataField property on page 234
Feature.Nodes property
Purpose
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.
Syntax
[SafeArray= ] OBJECT.Nodes ([CSys])
Part
Description
OBJECT
Represents a place holder for a Feature object.
CSys
A CoordSys object which defines the Coordinate System that the node data is returned in. The
default is Map.NumericCoordSys.
Feature.Offset method
Purpose
Moves the feature relative to its current position.
Syntax
OBJECT.Offset (deltaX, deltaY)
Part
Description
OBJECT
Represents a place holder for a Feature object.
deltaX
The map coordinates to move the point by.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
180
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
deltaY
Description
The map coordinates to move the point by.
Feature.Parts property
Purpose
A read-only property that returns a Parts object. Valid for Lines or Regions.
See Also
Parts Collection on page 322
Feature.Perimeter property
Purpose
A read-only property that returns the perimeter of a region feature; and is not valid for other types
of features.
Remarks
To control the units in which the perimeter is returned, set the Map.MapUnit property.
If you modify a feature in a layer, and you have not yet performed an Update to save the changes,
then this property returns a value based on the “modified” version of the object (the object as it
exists in memory).
See Also
Feature.Length property on page 179
Feature.Point property
Purpose
This read-only property returns a Point object. It is valid only for features of type point and text.
See Also
Point Object and Points Collection on page 324
Feature.Polyline property
Purpose
This read/write property returns the Polyline part of a feature, that has a type of
miFeatureTypeCollection.
Remarks
Reading from this property returns the Polyline part of a collection feature (if it exists) and is
returned as a stand-alone feature. If editing is done on this feature, in order to have edits saved in
a table, the user needs to update parent feature.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
181
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Writing to this property makes a copy of the feature passed in and sets it into existing collection
feature.
Feature.Region property
Purpose
This read/write property returns region part of feature, that has type miFeatureTypeCollection .
Remarks
Reading from this property returns the region part of a collection feature (if it exists) and is returned
as a stand-alone feature. If editing is done on this feature, in order to have edits saved in a table,
the user needs to update parent feature.
Writing to this property makes a copy of the feature passed in and sets it into existing collection
feature.
Feature.Smooth property
Purpose
The Feature.Smooth object enables you to smooth a polyline, making it into a continuous curve.
To smooth a polyline set the property to True.
Feature.Style property
Purpose
This read/write property returns the style of the feature.
Remarks
Style object default is '0' for each property of style object.
See Also
Style Object on page 356
Feature.Type property
Purpose
Contains the type of the feature. This is a FeatureTypeConstants value, and is read/write.
See Also
FeatureFactory.CreateText method on page 197
Feature.Update method
Purpose
This method updates the layer with changes made to the Feature object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
182
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.Update ( [UpdateFeature], [RowValues] )
Part
Description
OBJECT
Represents a place holder for a Feature object.
UpdateFeature
Boolean value that indicates whether or not to update the object column. Its default is
True.
RowValues
RowValues represents the new values of the attribute data, for one row of data. Each
value in the RowValues collection corresponds to one column of attribute data. This
parameter is ONLY applicable to a Dataset of type miDatasetLayer.
Note:
The object column stores the geographic data for the Feature object.
Remarks
If the RowValues collection points to fields added via the Dataset.AddField method, then these
fields will not be not updateable.
Features.Add method
Purpose
Add a Feature object or all features from a Features object into the collection (UNION set
operation).
Syntax
OBJECT.Add (Source)
Part
Description
OBJECT
Represents a place holder for a Features object.
Source
A Feature object or Features collection to add to the Features collection in OBJECT.
See Also
Feature Object and Features Collection on page 174
Features.AddByID method
Purpose
Add a Feature object with the specified FeatureKey to the Features collection.
Syntax
OBJECT.AddByID(FeatureKey)
Part
OBJECT
Description
Represents a place holder for a Features object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
183
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
FeatureKey
Note:
Description
FeatureKey of the feature to add to the Features collection.
Feature.FeatureKey is a replacement for Feature.FeatureID. FeatureID still works as it
did before, but it is recommended that you use the new FeatureKey property. 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.
See Also
Feature.KeyValue property on page 178
Feature.FeatureID property on page 177
Features.Bounds property
Purpose
This returns a Rectangle object representing the geographic extents of all objects in the collection
(i.e., the minimum bounding rectangle).
Syntax
OBJECT.Bounds
The OBJECT placeholder represents a Features collection.
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in the
collection.
Features.Clone method
Purpose
This method makes a copy of the collection as another Features object.
Syntax
OBJECT.Clone (source)
Part
Description
OBJECT
Represents a place holder for a Features collection.
source
This represents the set of features to be cloned with the collection, OBJECT.
Features.Common method
Purpose
Combine this collection and another Feature object so that this collection contains only features
that are in both. (INTERSECT set operation).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
184
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
Features.Count property
Purpose
Number of items in the collection.
Features.Item property
Purpose
Return a Feature object from collection - currently only numeric indexes are supported. This is a
default property for the Features collection.
Features.Remove method
Purpose
Remove a Feature object or all features from a Features object from this collection. (SUBTRACT
set operation).
Syntax
OBJECT.Remove (source)
Part
Description
OBJECT
Represents a place holder for a Features object.
source
This represents the set of features to be removed from the collection, OBJECT.
Features.RemoveByID method
Purpose
Remove a Feature object with the specified FeatureID from the Features collection.
Syntax
OBJECT.RemoveByID (*FeatureKey)
Part
OBJECT
Description
Represents a place holder for a Features object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
185
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
FeatureKey
Description
*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.
Features.Replace method
Purpose
This replaces the contents of the collection with a Feature object or all features from a Features
object.
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”.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
186
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeaturesConstraint Object
This object allows the programmer to specify which features will be cached for a remote database
layer by specifying a MapX Features collection. A FeaturesConstraint object is created by calling
the Layer.CreateFeaturesConstraint method. A layer can have more than one FeaturesConstraint
object associated with it. The Enable and Disable methods of the FeaturesConstraint object can
be used to add and remove this constraint after it is created. The Enabled property can be used to
determine the current state of the constraint. The Features property can be used to set or check
the Features collection that defines this constraint.
To force a refresh of the cache use the Layer.Refresh method.
Object Properties
•
FeaturesConstraint.Enabled property
•
FeaturesConstraint.Features property
Object Methods
•
FeaturesConstraint.Disable method
•
FeaturesConstraint.Enabled property
See Also
LayerInfo Object on page 271
Feature Object and Features Collection on page 174
Layer.CreateFeaturesConstraint method on page 244
AllFeaturesConstraint Object on page 140
BoundsConstraint Object on page 153
FeaturesConstraint.Disable method
Purpose
Once a FeaturesConstraint object is created, this method, along with the Enable method, is used
to control whether the constraint defined by the object that is used. If enabled, the
FeaturesConstraint object is used to determine which records are stored in the cache. When
instantiated, a FeaturesConstraint object is enabled by default.
Syntax
OBJECT.Disable
OBJECT – A FeaturesConstraint object
See Also
FeaturesConstraint.Enabled property on page 188
FeaturesConstraint.Enable method on page 188
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
187
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeaturesConstraint.Enabled property
Purpose
This is a boolean, read only property. When TRUE, the FeaturesConstraint object is being used to
determine what map features are stored in the cache. When FALSE the FeaturesConstraint object
is not being used.
See Also
FeaturesConstraint.Enable method on page 188
FeaturesConstraint.Disable method on page 187
FeaturesConstraint.Features property
Purpose
This is a read/write property that takes or returns a MapX Features object. The Features collection
determines which records from a remote layer will be stored in the cache.
Syntax
[Rectangle=] OBJECT.Bounds
Rectangle – A MapX Rectangle object
OBJECT – A FeaturesConstraint object
See Also
Feature Object and Features Collection on page 174
FeaturesConstraint.Enable method
Purpose
Once a FeaturesConstraint object is created, this method, along with the Disable method, is used
to control whether the constraint defined by the object is used. When disabled the
FeaturesConstraint object is not used to determine which records are stored in the cache. When
enabled the FeaturesConstraint object is used to determine which records are stored in the
Cache. When instantiated a FeaturesConstraint object is enabled by default, this method need
only be used when the FeaturesConstraint has been disabled via the FeaturesConstraint.Disable
method.
Syntax
OBJECT.Enable
OBJECT – A FeaturesConstraint object
See Also
FeaturesConstraint Object on page 187
FeaturesConstraint.Enabled property on page 188
FeaturesConstraint.Disable method on page 187
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
188
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeatureFactory Object
This object lets you create new map features, or create features by performing operations (such as
buffering) on existing features.
Object Methods
•
FeatureFactory.BufferFeatures method
•
FeatureFactory.CombineFeatures method
•
FeatureFactory.CreateArc method
•
FeatureFactory.CreateCircularRegion method
•
FeatureFactory.CreateCollectionFeature method
•
FeatureFactory.CreateEllipticalRegion method
•
FeatureFactory.CreateLine method
•
FeatureFactory.CreateMultipoint method
•
FeatureFactory.CreateRegion method
•
FeatureFactory.CreateSymbol method
•
FeatureFactory.CreateText method
•
FeatureFactory.EraseFeature method
•
FeatureFactory.IntersectFeatures method
•
FeatureFactory.IntersectionPoints method
•
FeatureFactory.IntersectionTest method
Remarks
Most of these methods return stand-alone feature objects. These feature objects are automatically
attached to the map (i.e., they already have an associated coordinate system). In other words, you
do not need to use the Attach method on the features returned by these methods.
To obtain a FeatureFactory object, reference the Map.FeatureFactory property.
FeatureFactory.BufferFeatures method
Purpose
This returns a stand-alone Feature object representing a buffer region.
Syntax
[Feature = ] OBJECT.BufferFeatures ( Source, Distance, [Units], [Resolution] )
Part
Description
OBJECT
A FeatureFactory object.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
189
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
Units
Variant: A MapUnitConstants value, such as miUnitMile (0), that identifies the unit of measure for the distance argument. If omitted, the MapUnit property is used as the default.
Resolution
Variant: A positive integer indicating the number of nodes used in creating a buffer. This is
the number of nodes per circle in a buffer operation, not the total number of nodes for the
entire region (see below). If omitted, the resolution is controlled by the DefaultConversionResolution property.
Remarks
This method returns a single buffer region, regardless of whether you base the buffer on one
Feature or a Features collection. If you want to create a separate buffer region for each feature in
the collection, you must loop through the collection and use the BufferFeatures method on one
feature at a time.
If you are creating a buffer for the sole purpose of performing a search within the buffer, you can
use the SearchWithinDistance method instead of the BufferFeatures method.
The resolution argument controls how many nodes are in
the buffer region. Resolution is specified in terms of the
number of nodes per circle; this is best illustrated by
example. This picture shows two features: A black, L–
shaped polyline, and a gray buffer region. The region
was produced by creating a buffer around the polyline. In
this illustration, a small square marks the location of each
node in the buffer region. This buffer was produced using
a resolution of 12 nodes per circle. Note that each end of
the polyline is capped with a semi–circle, and each semi–
circle consists of six segments. If a larger resolution had
been used, there would be more nodes in each semi–
circle.
The resolution does not necessarily represent the total
number of nodes in the feature. Resolution is specified in terms of nodes per circle, and a given
feature can contain many semi–circles. For example, the buffer region shown above has more
than 12 nodes, although the resolution specified 12 nodes per circle. Specifying a large resolution
produces a smoother looking region, but it takes longer to generate, and the resulting object
requires more storage space.
A zero width buffer is allowed on closed objects: Region, Rect, RoundRect, IsEllipse, and Text. An
“error creating buffer” exception will be thrown for other object types.
See Also
FeatureFactory.CreateCircularRegion method on page 193
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
190
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeatureFactory.CombineFeatures method
Purpose
This returns a stand-alone Feature object representing the combination (union) of multiple line
features or multiple region features.
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.
FeatureFactory.CreateArc method
Purpose
This creates a line feature shaped like an arc, and returns it as a stand-alone Feature object.
Syntax
[Feature = ] OBJECT.CreateArc( Point1, Point2, [Angle], [Distance], [Resolution], [Style] )
Part
Description
OBJECT
A FeatureFactory object.
Point1, Point2
Two Point objects, representing the starting and ending points of the arc.
Angle
Variant: An angle, in degrees. Optional; if omitted, the default angle is 90 degrees, producing a symmetric arc.
Distance
Variant: The length of an offset line expressed as a number of “arc units” (where one arc
unit is the distance between Point1 and Point2). The larger the value, the more bowed
the arc appears. Specifying zero would produce a flat arc. Optional; if omitted, defaults to
a value of 1.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
191
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
Resolution
Variant: A positive integer indicating the number of nodes to use in creating the ellipse;
maximum number is 32,763. Optional; if omitted, the defaultConversionResolution property controls the resolution.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if omitted,
no style is set.
Remarks
This method returns a line feature (a feature whose Type property is miFeatureTypeLine) that is
shaped like an arc. Note: If the current DisplayCoordSys does not match the current
NumericCoordSys, the arc may appear distorted.
To calculate the path of the arc, imagine a line that connects Point1 and Point2 (the horizontal line
in the diagram at the left).
Next, imagine a second line (the vertical line in the diagram) that begins at the center point of the
first line. The length of the second line is determined by the Offset argument, and its angle relative
to the first line is determined by the Angle argument. To make the second line perpendicular, as
shown in the diagram, specify 90 degrees or 270 degrees. A triangle is defined by Point1, Point2,
and the end point of the second line. This triangle acts as a “control polygon” in that it controls the
shape of the arc. The arc fits inside the triangle, and it is tangential to the sides of the triangle at
Point1 and Point2.
The arc falls on one side of the line between Point1 and Point2. To make the arc fall on the
opposite side of the line, use a different Angle argument (e.g., instead of 90 degrees, specify 270
degrees). Each combination of Angle and Offset values produces a unique, characteristic shape. If
you always use the same combination of Angle and Offset values, the arcs produced will always
have the same shape, regardless of the distance between Point1 and Point2. Some samples are
shown below:
Angle
30
Offset
Result
1
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
192
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Angle
Offset
30
0.5
90
1
90
0.5
90
0.25
165
1
165
0.5
270
0.5
Result
See Also
FeatureFactory.CreateEllipticalRegion method on page 195
FeatureFactory.CreateCircularRegion method
Purpose
This creates a region feature shaped like a circle, and returns it as a stand-alone Feature object.
The feature can be added to a layer, used in searches, etc.
Syntax
[Feature = ] OBJECT.CreateCircularRegion( Type, Point, Distance, [Units], [Resolution], [Style] )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
193
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
OBJECT
A FeatureFactory object.
Type
Short: A CircleTypeConstants value: Specify miCircleTypeScreen(value:0)or miCircleTypeMap (1). (See below)
Point
Point object: Represents the location to use as the center of the circle; specified in the current numeric coordinate system.
Distance
Double: The radius of the circle, in the units specified by the Units argument.
Units
Variant: A MapUnitConstants value, such as miUnitMile (0), that identifies the unit of measure for the Distance argument. Optional; if omitted, the MapUnit property controls the Units.
Resolution
Variant: A positive integer indicating the number of nodes to use in creating the circle; maximum number is 32,767, the minimum is 3. Optional; if omitted, the DefaultConversionResolution property controls resolution.
Specifying a large resolution produces a smoother looking region, but it takes longer to generate, and the resulting object requires more storage space.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if omitted, no
style is set.
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 on page 189
FeatureFactory.CreateEllipticalRegion method on page 195
FeatureFactory.CreateCollectionFeature method
Purpose
This creates a collection type feature, and returns it as a stand-alone Feature object. The feature
can be added to a layer, used in searches, etc.
Syntax
[Featurel= ] OBJECT.CreateCollectionFeature ([feature1], [feature2], [feature3])
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
194
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
This method creates a stand-alone Feature object. You can pass up to three features objects as
parameters to this method. At most, you can pass one region feature, one polyline feature and one
multipoint feature. If no parameters are passed then an empty feature of type
miFeatureTypeCollection is created. You can't pass feature of the same type to this method.
Part
Description
OBJECT
A FeatureFactory object
feature1
Variant: A feature object representing region, polyline or multipoint feature. This is an optional
argument
feature2
Variant: A feature object representing region, polyline or multipoint feature. This is an optional
argument
feature3
Variant: A feature object representing region, polyline or multipoint feature. This is an optional
argument
FeatureFactory.CreateEllipticalRegion method
Purpose
This creates a region feature shaped like an ellipse, and returns it as a stand-alone Feature object.
The feature can be added to a layer, used in searches, etc.
Syntax
[Feature = ] OBJECT.CreateEllipticalRegion( Rectangle, [Angle], [Resolution], [Style] )
Part
Description
OBJECT
Represents a FeatureFactory object.
Rectangle
A Rectangle object, representing the minimum bounding rectangle (MBR) of an ellipse in the
map's current numeric coordinate system.
Angle
Variant: An angle of rotation for the ellipse. The ellipse is rotated from its center point.
Resolution
Variant: A positive integer indicating the number of nodes to use in creating the ellipse; maximum number is 32,763. If omitted, the DefaultConversionResolution property controls the
resolution.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if omitted, no
style is set.
Remarks
If the current DisplayCoordSys does not match the current NumericCoordSys, the ellipse may
appear distorted.
See Also
FeatureFactory.CreateArc method on page 191
FeatureFactory.CreateCircularRegion method on page 193
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
195
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeatureFactory.CreateLine method
Purpose
This returns a stand-alone Feature object (a line feature), built from a collection of points.
Syntax
[Feature = ] OBJECT.CreateLine( [Points], [Style] )
Part
Description
OBJECT
A FeatureFactory object.
Points
Variant: A Points collection, representing the set of points to use to define the
line. Optional; if omitted, no points are added to the line feature.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if
omitted, no style is set.
FeatureFactory.CreateMultipoint method
Purpose
This returns a stand-alone Feature object (a multipoint feature), built from a collection of points.
Syntax
[Featurel= ] OBJECT.CreateMultipoint ([Points], [Style])
Part
Description
OBJECT
A FeatureFactory object
Points
Variant: A Points collection, representing the set of points to use to define a multipoint. Optional; if omitted, no points are added to the multipoint feature.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if
omitted, no style set.
FeatureFactory.CreateRegion method
Purpose
This returns a stand-alone Feature object (a region feature), built from a collection of points.
Syntax
[Feature = ] OBJECT.CreateRegion( [Points], [Style] )
Part
OBJECT
Description
A FeatureFactory object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
196
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
Points
Variant: A Points collection, representing the set of points that define the region
or a Rectangle object. Passing a Rectangle object creates a region using the four
corners of the rectangle. Optional; if omitted, no points are added to the feature.
Style
Variant: A Style object that defines the appearance of the feature. Optional; if
omitted, no style is set.
FeatureFactory.CreateSymbol method
Purpose
This returns a stand-alone Feature object (a point feature), built from a Point object.
Syntax
[Feature = ] OBJECT.CreateSymbol( [Point], [Style] )
Part
Description
OBJECT
A FeatureFactory object.
Point
Variant: A Point object, representing the x/y location where the symbol should be
placed. Optional; if omitted, the feature's location is not set.
Style
Variant: A Style object that defines the appearance of the feature. If omitted, no
style is set.
FeatureFactory.CreateText method
Purpose
This returns a stand-alone Feature object (a text feature).
Syntax
[Feature = ] OBJECT.CreateText( [Point], [Caption], [Position], [Style] )
Part
Description
OBJECT
A FeatureFactory object.
Point
Variant: A Point object, representing the location where the text should be
anchored. Optional; if omitted, the feature's location is not set.
Caption
Variant: A string that defines the text. Optional; if omitted, the feature's
caption is not set.
Position
A PositionConstants value; controls the initial position of the text, relative
to the anchor point. Optional; if omitted, defaults to miPositionTL (i.e., the
anchor point is at the top left corner of the text).
This argument only takes effect if the Point and Caption arguments are
both specified.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
197
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Style
Description
Variant: A Style object that defines the appearance of the feature. If omitted, no style is set.
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.
FeatureFactory.EraseFeature method
Purpose
This returns a stand-alone Feature object by “erasing” one feature's area from another feature.
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 feature returned by this method is
identical to the SourceFeature.
Example
This picture shows a circular region, created through the BufferFeatures method. In this example,
the circular region covers a coastal area; the gray area represents land, and the white area
represents water.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
198
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
To erase part of the circular region, use the EraseFeature method. If you make the circular region
your SourceFeature, and make the gray region your EraserFeature, you will erase the portion of
the circle that overlaps the gray region.
This picture shows what is left of the circular region after calling the EraseFeature method. The
EraseFeature method removes the portion of a feature that overlaps another feature. To perform
the opposite task (to remove the portion of a feature that does not overlap), use the
FeatureFactory.IntersectFeatures method.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
199
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also:
FeatureFactory.IntersectFeatures method on page 200
FeatureFactory.IntersectFeatures method
Purpose
This returns a stand-alone feature that represents the intersection of multiple features.
Syntax
[Feature=]OBJECT.IntersectFeatures( feature1 [feature2] )
Part
Description
OBJECT
A FeatureFactory object.
feature1
A Feature object or a Features collection object, representing region or line features.
feature2
Variant: A Feature object or a Features collection object representing region or line features. This argument is only required if the feature1 argument is a single Feature object.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
200
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 features 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.
FeatureFactory.IntersectionPoints method
Purpose
This returns a Points collection containing the points where two features intersect.
Syntax
[Points collection=]OBJECT.IntersectionPoints( feature1, feature2, [flag] )
Part
Description
object
A FeatureFactory object.
feature1
A Feature object.
feature2
A Feature object.
flag
Variant: An IntersectionPointConstants value; see below. Optional; if
omitted, the default is miIntersectAll.
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.
Setting
Value
Description
miIntersectCrossings
9
This returns the set of points where a line segment from one feature
crosses a line segment from the other feature, but the features do not
have nodes at the point of crossing.
miIntersectCommon
10
This returns the set of points where a line segment from one feature
intersects a line segment from the other feature, and both features have
a node at the point of intersection.
miIntersectAll
11
This returns all points where the features cross or intersect, regardless of
whether there are common nodes at the point of intersection. In other
words, retrieves all of the miIntersectCommon points and all miIntersectCrossings points.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
201
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FeatureFactory.IntersectionTest method
Purpose
This returns a Boolean value, indicating whether two features satisfy a test of intersection.
Syntax
[Boolean=]OBJECT.IntersectionTest( feature1, feature2, [flag] )
Part
Description
OBJECT
A FeatureFactory object.
feature1
A Feature object.
feature2
A Feature object.
flag
Variant: An IntersectionPointConstants value; see below. Optional; if omitted, the default is
miIntersectFeature.
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.
Setting
Value
Description
miIntersectCentroidWithinFeature
0
Test returns True if the centroid of feature1 falls within
feature2.
miIntersectFeature
1
Test returns True if the two features intersect at any point, or
if adjacent features share common nodes.
miIntersectEntirelyWithinFeature
2
Test returns True if feature1 is entirely inside of feature2.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
202
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Field Object and Fields Collection
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 miLayerInfoTypeNewTable. 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.Indexed property
•
Field.Name property
•
Field.Precision property
•
Field.Width property
•
Field.Type property
•
Field.TypeEx property
Note:
If the user tries to get a property that isn't available for that type Field object, MapX throws
ERR_PROPERTY_NOT_AVAILABLE (1295).
Collection Properties
•
Fields.Count property
•
Fields.Item property
Collection Methods
•
Fields.Add method
•
Fields.AddDateField method
•
Fields.AddFloatField method
•
Fields.AddIntegerField method
•
Fields.AddLogicalField method
•
Fields.AddNumericField method
•
Fields.AddSmallIntField method
•
Fields.AddStringField methodPurpose
•
Fields.Remove method
•
Fields.RemoveAll method
See Also
LayerInfo Object on page 271
Dataset Object and Datasets Collection on page 161
Datasets.Add method on page 167
Layers.Add method on page 263
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
203
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Themes.Add method on page 378
Field.AggregationFunction property
Purpose
This property dictates how MapX computes the Field value when multiple data are bound to the
same feature. This is a read-only property, and is set to one of the
AggregationFunctionConstants. It is initialized in the Fields.Add method.
See Also
Fields.Add method on page 206
Field.Decimals property
Purpose
This read-only property is used to specify a numeric value for the number of decimals in the field
object.
Field.Indexed property
Purpose
This read-only property returns true if a field in an underlying table is indexed.
Field.Name property
Purpose
This read-only property specifies a field name. It is a String value. This is the default property for
the Field object.
See Also
Appendix A: MapX Field Naming Conventions
Field.Precision property
Purpose
This read-only property specifies the total number of numeric place values in a given Field object.
Field.Width property
Purpose
This read-only property specifies a string length in a given Field object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
204
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Field.Type property
Purpose
This property returns a field type, but only for fields of type String, Date and Numeric types. This is
a read-only property.
Note:
The Field.TypeEx property has been added to MapX in order to return ALL of the
FieldTypeConstants.
Remarks
The table below describes what data types are returned when using Field.Type and Field.TypeEx.
Field Type
MapX returns Using
Field.TypeEx
MapX returns Using Field.Type
Integer
numeric
Integer
Character
Character
Character
Float
numeric
Float
Logical
numeric
Logical
Date
Date
Date
Small Int
numeric
Small Int
Decimal(4,2)
numeric
numeric
See Also
Field.TypeEx property on page 205
Field.TypeEx property
Purpose
This property returns a field type with a FieldTypeConstants value. This is a read-only property.
Note:
This property is new to MapX. It was implemented to correct a problem with the Field.Type
property. The Field.Type property could only return String, Date, and Numeric types. The
Field.TypeEx property can return ALL of the FieldTypeConstants.
Remarks
The table below describes what data types are returned when using Field.Type and Field.TypeEx.
Field Type
MapX returns Using
Field.TypeEx
MapX returns Using Field.Type
Integer
numeric
Integer
Character
Character
Character
Float
numeric
Float
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
205
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Field Type
MapX returns Using
Field.TypeEx
MapX returns Using Field.Type
Logical
numeric
Logical
Date
Date
Date
Small Int
numeric
Small Int
Decimal(4,2)
numeric
numeric
See Also
Field.Type property on page 205
Fields.Add method
Purpose
This method adds a field to a Fields collection.
Syntax
[Field=]OBJECT.Add (DataSourceCol, [Name], [AggregateFunction], [Type])
Part
Description
OBJECT
Represents a Fields object.
DataSourceCol
The column from the data source to use. Can be either the name or the index of the
column.
Name
Name of field to add. The default is the field name in the data source.
AggregateFunction
The aggregate function to use. Value: AggregationFunctionConstants
Type
The type of data in column. This takes a FieldTypeConstants value.
Remarks
A Fields collection is built to use with the Datasets.Add method. The Fields parameter takes a
Fields collection, and is built using this Add method.
The Type parameter is used only with Unbound Datasets. It is ignored for all other Dataset types.
The aggregate function defaults to miAggregationIndividual for string columns, and
miAggregationSum for numeric columns.
The Add method can not be used on a Dataset's fields collection once the Dataset has been
created.
All field names should be unique in a given fields collection.
See Also
Datasets.Add method on page 167
Dataset.Fields property on page 163
MapX Field Naming Conventions on page 398
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
206
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Fields.AddDateField method
Purpose
This method adds a date to the fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddDateField (Name, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the date field.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Appendix A: MapX Field Naming Conventions
Fields.AddFloatField method
Purpose
This method adds a float field to a fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddFloatField (Name, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the float filed.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Field Naming Conventions on page 398
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
207
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Fields.AddIntegerField method
Purpose
This method adds an integer field to a fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddIntegerField (Name, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the integer field.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Field Naming Conventions on page 398
Fields.AddLogicalField method
Purpose
This method adds a logical field to a fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddLogicalField (Name, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the logical field.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Field Naming Conventions on page 398
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
208
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Fields.AddNumericField method
Purpose
This method adds a numeric field to the field collection.
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.AddNumericField(Name, Precision, Decimals, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the numeric field.
Precision
This is the total number of numeric places.
Decimals
This is the total decimal places.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Field Naming Conventions on page 398
Fields.AddSmallIntField method
Purpose
This method adds a small integer to the fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddSmallInt(Name, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the small integer field.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
209
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
MapX Field Naming Conventions on page 398
Fields.AddStringField methodPurpose
This method adds a string field to the fields collection.
Note:
This method is specifically intended to be used when a Fields collection is being passed in
a LayerInfo object to Layers.Add.
Syntax
OBJECT.AddStringField(Name, Width, [Indexed])
Part
Description
OBJECT
This represents the Fields collection.
Name
This is the name of the string field.
Width
This is the specified length of the sting. Valid values are integers between 1 and 254.
Indexed
Boolean: this indicates if an index should be created on this field. The default value is false.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
MapX Field Naming Conventions on page 398
Fields.Count property
Purpose
The number of fields in a Fields collection. This is a read-only property.
Fields.Item property
Purpose
Retrieve a Fields object from the Fields collection. This takes a parameter to specify which field.
The parameter can specify the field name or index number (1 based index). This is a default
property for the Fields collection.
See Also
MapX Field Naming Conventions on page 398
Fields.Remove method
Purpose
Removes a specified Field object from the Fields collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
210
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Chapter 14: The MapX Object Reference
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 Fields object.
index
Field object name or 1 based index number.
Fields.RemoveAll method
Purpose
Removes all Field objects from the collection.
Syntax
OBJECT.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
211
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Find Object
Purpose
The Find object allows you to enter the name of a feature and MapX finds it. You may refine by
using a second polygon table, using street maps, and interpolate positions on the street and side
of the street using an algorithm.
Object Properties
•
Find.Abbreviations property
•
Find.CloseMatchMax property
•
Find.ClosestAddr property
•
Find.FindDataset property
•
Find.FindField property
•
Find.OtherBoundary property
•
Find.RefineDataset property
•
Find.RefineField property
•
Find.RefineLayer property
Object Methods
•
Find.Search method
•
Find.SearchEx method
Note:
The methods above do not work with remote database layers. Use the Layer.Search
method as an alternate means of locating a feature or features collection on a remote
database layer.
Find.Abbreviations property
Purpose
This is a read/write boolean property with a default value of FALSE. When FALSE, MapX does not
refer to the abbreviations file. If set to TRUE, MapX uses the abbreviations file (mapx.abb) when it
can not exactly match an address it is searching for with a record in the table.
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.
Find.CloseMatchMax property
Purpose
This property determines the maximum number of matches the FindResult object may contain.
That is, when you execute a find via the Find.SearchEx method, if an exact match(es) can not be
found, SearchEx returns as many close matches as it can find—up to the value specified by this
property. The default for this property is eight and takes an integer value which must be >= 0 or
MapX throws an error.
See Also
Find.SearchEx method on page 213
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
212
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Find.ClosestAddr property
Purpose
This Boolean property when set to TRUE will match to the closest house number if a specified
number is not found. For example, if the user asked for 120 ELM ST, but MapX only knows about
1-100 ELM ST, this would cause MapX to match to 100 ELM ST. The default is FALSE.
Find.FindDataset property
Purpose
Dataset of field to match against. If not specified, a layer's KeyField is used.
Find.FindField property
Purpose
Field from a dataset to match against. It is used in conjunction with FindDataset property.
See Also
Find.FindDataset property on page 213
Find.SearchEx method
Purpose
The SearchEx method extends the functionality of the search method. It enables the search
engine to look for the closest matches returned in a collection. A developer might present this to a
user in a list box. Initially a search will try to return an exact match with the parameters given to the
method. If an exact match is not found, then the MatchedFeature will contain nothing and the
FindMatches collection will contain all close FindMatch items found.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
213
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
FindResult Object on page 220
FindMatch Object and FindMatches Collection on page 218
Layer.Search method on page 255
Find.OtherBoundary property
Purpose
This Boolean property applies when a refining boundary is used and controls how MapX deals with
a lack of matches within the refine boundary.
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 on page 214
Find.Search method on page 215
Find.RefineDataset property
Purpose
When specifying a RefineLayer, you can use the geocolumn to match, or you can override by
specifying a Dataset and Field to use instead.
Find.RefineField property
Purpose
Used in conjunction with RefineDataset.
Find.RefineLayer property
Purpose
Layer to refine with. Refinement is useful when there may be multiple matches.
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 on page 214
Find.RefineDataset property on page 214
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
214
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Find.Search method
Purpose
Searches the layer for a street address or for the name of a feature on the map. It returns a
FindFeature object.
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 on page 212
FindFeature Object on page 216
Layer.Search method on page 255
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
215
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FindFeature Object
The FindFeature object is a super class of the Feature with the addition of a result code (FindRC).
FindFeature is returned by the search method of the Find object and contains all the properties of
a Feature object and the FindRC property.
Object Properties
•
FindFeature.FindRC property
See Also
Feature Object and Features Collection on page 174
Chapter 9: Finding Features on a Map
FindFeature.FindRC property
Purpose
FindRC is the result code of the find operation.
To obtain the X,Y and/or object ID use the properties, CenterX, CenterY, FeatureID. If an address
was found FeatureID will be 0.
Digit Values
Meaning
**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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
216
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Digit Values
Meaning
3xx ( + / – )
No refining region was specified, and one match was found
4xx( – )
No region was specified, and multiple matches were found
5xx ( + )
Name found more than once in the specified region
See Also
Feature Object and Features Collection on page 174
FindFeature Object on page 216
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
217
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FindMatch Object and FindMatches Collection
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 property
•
FindMatch.Score property Purpose
•
FindMatch.Name property
Collection Properties
•
FindMatches.Count property
•
FindMatches.Item property
See Also
FindResult Object on page 220
Find.SearchEx method on page 213
FindMatch.FeatureID property
Purpose
This property returns the ID of the feature if it exists. If the feature does not exist, a zero is
returned.
FindMatch.FeatureKey property
Purpose
This property returns the FeatureKey of the feature if it exists. If it does not exist, an empty string is
returned.
FindMatch.Name property
Purpose
This property returns the name of the object or street.
FindMatch.Score property Purpose
This property returns the matching score for close matches or zero for no match—100 (exact
match).
FindMatches.Count property
Purpose
This read-only property indicates the number of matches in the collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
218
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FindMatches.Item property
Purpose
This property returns an item in the FindMatches collection. The items are ordered by their score
in the FindMatches collection (the best score first).
Syntax
[FindMatch=]OBJECT.Item (index)
Part
Description
OBJECT
Represents a FindMatches collection
index
The integer index of the item returned.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
219
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FindResult Object
The FindResult object returns information about the FindRC in the form of properties that make it
easier to access the result of the find. FindResult contains a collection of features that contain
either the multiply matched features, or the closest matched features in priority order of how they
scored in the find. If an exact match is found, then the feature collection will only contain the
ExactMatch feature.
Object properties
•
FindResult.AddressOutOfRange property
•
FindResult.ExactMatch property
•
FindResult.FindRC property
•
FindResult.IntersectionNotFound property
•
FindResult.MatchedFeature property
•
FindResult.Matches property
•
FindResult.MultipleMatches property
•
FindResult.RefineRegion property
•
FindResult.Substitute property
See Also
Find.SearchEx method on page 213
FindResult.AddressOutOfRange property
Purpose
This property returns a Boolean value of TRUE if the address number is outside the range.
FindResult.ExactMatch property
Purpose
This property returns a Boolean value of TRUE if an exact match is found.
See Also
FindResult.MatchedFeature property on page 221
FindResult.Matches property on page 221
FindResult.MultipleMatches property on page 221
FindResult.FindRC property
Purpose
This property searches the layer for a street address or for the name of a feature on the map;
returns a FindFeature object. If a negative value is returned, then an exact match was not found.
See Also
FindFeature Object on page 216
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
220
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
FindResult.IntersectionNotFound property
Purpose
This read-only property returns a Boolean value of TRUE that indicates whether streets intersect.
FindResult.MatchedFeature property
Purpose
This property returns the resulting ExactMatch feature from a Find.SearchEx.
See Also
Find.SearchEx method on page 213
FindResult.Matches property
Purpose
This property returns the resulting Match collection from a Find.SearchEx.
See Also
Find.SearchEx method on page 213
FindResult.MultipleMatches property
Purpose
This property returns a Boolean value of TRUE if multiple matches are found after performing a
Find.SearchEx.
See Also
Find.SearchEx method on page 213
FindResult.RefineRegion property
Purpose
This property returns a Boolean value of TRUE if the refining region is specified.
FindResult.Substitute property
Purpose
This property returns a Boolean value of TRUE if the substitute was used from an abbreviation file.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
221
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Geoset Object and Geosets Collection
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 on page 285
Geoset.Centroid property
Purpose
This specifies the Point object defining the geographic center of the geoset.
See Also
Point Object and Points Collection on page 324
Geoset.PathName property
Purpose
This specifies the Path defining the physical location of the geoset.
Geoset.UserName property
Purpose
This specifies the Name defining the geoset.
Geosets.Count property
Purpose
This specifies the number of Geoset objects in the collection. This is a read-only property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
222
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Geosets.Item property
Purpose
This retrieves a particular Geoset object from a collection. This is a Variant, and you can specify
the Geoset's user name or a 1 based index number. This is a default property for the Geosets
collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
223
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 on page 224
•
Graphic.Position property on page 224
•
Graphic.Style property on page 224
•
Graphic.X property on page 225
•
Graphic.Y property on page 225
See Also
Annotation Object and Annotations Collection on page 142
Graphic.Caption property
Purpose
Contains the text string if the annotation is of type miTextAnnotation. This is a String value.
See Also
Annotation.Type property on page 142
AnnotationTypeConstants in Appendix G on page 447
Graphic.Position property
Purpose
This contains a value indicating how the text should be drawn with respect to the X,Y coordinates.
This is only used if annotation type is miTextAnnotation. This takes a PositionConstants value,
and defaults to miPositionTL.
See Also
Annotation.Type property on page 142
Graphic.Style property
Purpose
A Style object containing the style of the symbol or text. This is a read-write property.
See Also
Style Object on page 356
Annotation.Type property on page 142
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
224
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Graphic.X property
Purpose
Contains the X coordinate of the annotation. This is a double value, and represents the earth
coordinate (longitude). If the annotation type is miTextAnnotation, the position of the annotation is
controlled by the X,Y coordinates in conjunction with the Position property. If the annotation type is
miSymbolAnnotation, the X,Y coordinates refer to the center of the symbol.
See Also
Annotation.Type property on page 142
AnnotationTypeConstants in Appendix G on page 447
Graphic.Position property on page 224
Graphic.Y property
Purpose
Contains the Y coordinate of the annotation. This is a double value, and represents the earth
coordinate (latitude). If the annotation type is miTextAnnotation, the position of the annotation is
controlled by the X,Y coordinates in conjunction with the Position property. If the annotation type is
miSymbolAnnotation, the X,Y coordinates refer to the center of the symbol.
See Also
Annotation.Type property on page 142
AnnotationTypeConstants in Appendix G on page 447
Graphic.Position property on page 224
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
225
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
IndividualValueCategory Object and
IndividualValueCategories Collection
An individual-values thematic map's settings are exposed through the IndividualValueCategories
collection, which is a collection of IndividualValueCategory objects one object for each unique
value in the theme.
To obtain an IndividualValueCategories collection, reference the
ThemeProperties.IndividualValueCategories property.
Object Properties
•
IndividualValueCategory.NumItems property
•
IndividualValueCategory.Style property
•
IndividualValueCategory.Value property
Collection Properties
•
IndividualValueCategories.AllOthersCategory property
•
IndividualValueCategories.Count property
•
IndividualValueCategories.Item property
See Also
Legend Object on page 277
ThemeProperties.IndividualValueCategories property on page 384
IndividualValueCategories.AllOthersCategory property
This returns one IndividualValueCategory object from the collection; this object describes a
category for all value ranges not in the individual values theme. The IndividualValueCategory
object returned with the AllOthersCategory property has a Value property that is not defined and
its default value is an empty string (“”). However, you can set its Style property as shown in the
example below. The text that appears in the legend for the AllOthersCategory range category
object can be set with the LegendTexts.AllOthersText property.
See Also
LegendTexts.AllOthersText property on page 283
IndividualValueCategories.Count property
Purpose
This is a read-only integer value, indicating the number of unique individual values in the theme.
IndividualValueCategories.Item property
Purpose
This returns one IndividualValueCategory object from the collection; this object describes one of
the unique values in the individual values theme.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
226
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
IndividualValueCategory.NumItems property
Purpose
NumItems is the number of features that fall into this category. This is an Integer value and is a
read-only 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.
IndividualValueCategory.Style property
Purpose
This controls the style for the category. This is a Style object and may be set to an existing style
object or you may set the style properties individually. The defaults are designed to provide highly
contrasting styles.
See Also
Style Object on page 356
IndividualValueCategory.Value property
Purpose
This property gets or sets the value of an individual value category in an individual value theme.
The property can only be set when the Theme.ComputeTheme property is set to FALSE.
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 on page 227
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
227
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label Object and Labels Collection
There is a Labels collection for each layer in the Map. Each item in the collection is a Label object.
The Labels collection for a layer consists of all labels in that layer that are currently visible in the
map window or in the cache, as well as any labels from that layer that have been edited either
manually (selected or moved using the stock Select tool or added using the stock Label tool) or
programatically (using methods and properties of the Layer object and Layers Collection).
By editing the properties of a label object the user can change the position or style of a label
independently of other labels in that layer.
Label object properties
•
Label.AnchorX property
•
Label.AnchorY property
•
Label.Angle property
•
Label.Caption property
•
Label.Drawn property
•
Label.Edited property
•
Label.EditedAnchor property
•
Label.EditedAngle property
•
Label.EditedCaption property
•
Label.EditedLineStyle property
•
Label.EditedLineType property
•
Label.EditedMultiSegment property
•
Label.EditedOffset property
•
Label.EditedPosition property
•
Label.EditedTextStyle property
•
Label.EditedVisibile property
•
Label.FeatureKey
•
Label.Layer property
•
Label.LineType property
•
Label.MultiSegment property
•
Label.Offset property
•
Label.Position property
•
Label.Selected property
•
Label.Style property
•
Label.Visible property Purpose
See Also
Layer.Labels property on page 252
LabelProperties.LabelAlong property on page 235
LabelProperties.LabelPartialObjects property on page 235
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
228
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label.AnchorX property
Purpose
This read/write property is the X coordinate of the label's anchor location. This is a double value
representing the longitude in degrees (negative values for the Western hemisphere).
Label.AnchorY property
Purpose
This read/write property is the Y coordinate of the label's anchor location. This is a double value
representing the latitude in degrees.
Label.Angle property
Purpose
This read/write property is the label's counter-clockwise rotation angle in degrees. It is not
applicable if the label is multi-segmented.
Label.Caption property
Purpose
This read/write property gets the label's text.
Label.Drawn property
Purpose
This read-only property is set to true if the label is drawn in the current view.
Label.Edited property
Purpose
This read-only property is set to “True” if the label has been customized in some way
(programatically or with the SelectPoint tool). It is set to “False” if not.
Label.EditedAnchor property
Purpose
This read-only property is set to “True” if label's anchor has been customized in some way
(programatically or with the SelectPoint tool). It is set to “False” if not.
See Also
Label.AnchorX property on page 229
Label.AnchorY property on page 229
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
229
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label.EditedAngle property
Purpose
This read-only property is set to “True” if label's Angle has been customized programatically. It is
set to “False” if not
See Also
Label.Angle property on page 229
Label.EditedCaption property
Purpose
This read-only property is set to “True” if label's caption has been customized programatically. It is
set to “False” if not.
See Also
Label.Caption property on page 229
Label.EditedLineStyle property
Purpose
This read-only property is set to “True” if label's callout line style has been customized
programatically. It is set to “False” if not.
See Also
Label.Style property on page 233
Label.EditedLineType property
Purpose
This read-only property is set to “True” if label's callout line type has been customized
programatically. It is set to “False” if not.
See Also
Label.LineType property on page 232
Label.EditedMultiSegment property
Purpose
This read-only property is set to “True” if the label's multi-segment status has been changed
(programatically or with the SelectPoint tool). It is set to “False” if not.
See Also
Label.MultiSegment property on page 232
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
230
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label.EditedOffset property
Purpose
This read-only property is set to “True” if the label's offset has been customized in some way
(programatically or with the SelectPoint tool). It is set to “False” if not.
See Also
Label.Offset property on page 232
Label.EditedPosition property
Purpose
This read-only property is set to “True” if the label's position has been customized in some way
(programatically or with the SelectPoint tool). It is set to “False” if not.
See Also
Label.Position property on page 232
Label.EditedTextStyle property
Purpose
This read-only property is set to “True” if label's text style is customized programatically. It is set to
“False” if not.
Label.EditedVisibile property
Purpose
This read-only property is set to “True” if the label's visibility is customized in some way
(programatically or with the SelectPoint tool). It is set to “False” if not.
See Also
Label.Visible property Purpose on page 233
Label.FeatureKey
Purpose
This read-only property returns the key of the feature associated with the label. Use this key to
access the feature with Layer.GetFeatureByKey.
See Also
Layer.GetFeatureByKey method on page 251
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
231
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label.Layer property
Purpose
This read-only property sets the layer to which the label belongs.
See Also
Layer Object and Layers Collection on page 239
Label.LineType property
Purpose
This read/write property gets the label's callout line type (miLineTypeArrow, miLineTypeNone, or
miLineTypeSimple).
See Also
LineTypeConstants in Appendix G on page 457
Label.MultiSegment property
Purpose
This read/write property gets the label's multi-segment status. It is “True” if the label is a multisegment label, “False” otherwise.
Label.Offset property
Purpose
This read/write property gets the distance (in pixels) that the label is offset from its anchor location.
See Also
LabelProperties.Offset property on page 237
Label.Position property
Purpose
This read/write property gets the label's position relative to its anchor position. This takes a
PositionConstants value.
See Also
PositionConstants on page 459
Label.Selected property
Purpose
This read/write indicates whether the label is selected or not. (Read/Write property).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
232
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Label.Style property
Purpose
This read/write property gets a label's text style.
See Also
Style Object on page 356
Label.Visible property Purpose
This read/write property indicates whether the label has been hidden or not. A hidden label means
that when a label qualifies to be drawn automatically, if it is marked as hidden, it does not get
drawn.
Labels.Count property
Purpose
This read-only property counts the number of labels in the labels collection.
Labels.Item property
Purpose
This read/write property gets a specific label from the labels collection. It takes an integer index
value starting at 1. This is the default property for the Labels collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
233
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.LabelAlong property
•
LabelProperties.LabelMax property
•
LabelProperties.LabelPartialObjects 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 and Layers Collection on page 239
LabelProperties.DataField property
Purpose
This property sets the location (i.e., the DataField) used for labels. The field used for labeling is
specified by both this property as well as the Dataset property to indicate which Dataset to use.
This takes a Field object.
See Also
LabelProperties.Dataset property on page 234
Field Object and Fields Collection on page 203
LabelProperties.Dataset property
Purpose
This property sets the Dataset to use for labels. The field to use for labeling is specified by both
this property as well as the DataField property to indicate which field in the Dataset to use.
Specifying no Dataset causes the features to get labeled with the feature name. This is the default
behavior. This takes a Dataset object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
234
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
LabelProperties.DataField property on page 234
Dataset Object and Datasets Collection on page 161
LabelProperties.Duplicate property
Purpose
Controls whether features with the same name can have labels on the map simultaneously. This is
a Boolean value, and the default is False where the PredominantFeatureType is
miFeatureTypeLine and True for all others.
LabelProperties.LabelAlong property
Purpose
With the LabelAlong property, you may indicate that the label will follow the contour of what it is
labeling if the object being labeled is a polyline. It has three states, represented by the
LabelAlongConstants.
Remarks
The LabelAlong property replaces the old Parallel property, which we still support but have
deprecated to a hidden property. The parallel property dictated whether labels on lines and
polylines are not rotated or are drawn at the same angle as the line or polyline segment to which
they are anchored.
For objects other than polylines, if the property is set to miLabelAlongMultiSegment, the property
is ignored (i.e., for point and region objects). For line objects, if the property is set to
miLabelAlongMultiSegment, automatic labels are drawn as if the property is set to
miLabelAlongParallel.
See Also
LabelAlongConstants in Appendix G on page 456
LabelProperties.LabelMax property
Purpose
Controls the maximum number of labels that are automatically generated for a layer. This is an
Integer value, and the default is 100.
LabelProperties.LabelPartialObjects property
Purpose
Setting this value to true enables MapX to label map objects, even if only a small part of the map
object is currently visible. However, this property is not applicable to point objects. This is a
Boolean value, and the default is False.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
235
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
This property allows a label to be automatically displayed even if the centroid of the object is not in
the map view.
LabelProperties.LabelZoom property
Purpose
Controls whether labels are zoom layered. Zoom layering controls the range of zoom levels
(distance across map) the labels are displayed. If LabelZooming is on, then the values stored in
the LabelZoomMax and LabelZoomMin properties are used. This is a Boolean value, and the
default is False.
See Also
LabelProperties.LabelZoomMax property on page 236
LabelProperties.LabelZoomMin property on page 236
LabelProperties.LabelZoomMax property
Purpose
If label ZoomLayering is on (LabelProperties.LabelZoom property), then this specifies the
maximum zoom value for displaying the labels. This takes a double value specifying distance in
Map units (Map.MapUnit). The labels will appear if the zoom is >= to min and < max.
See Also
LabelProperties.LabelZoom property on page 236
Map.MapUnit property on page 302
LabelProperties.LabelZoomMin property
Purpose
If label ZoomLayering is on (LabelProperties.LabelZoom property), then this specifies the
minimum zoom value for displaying the labels. This takes a double value specifying distance in
Map units (Map.MapUnit). The labels will appear if the zoom is >= to min and < max.
See Also
LabelProperties.LabelZoom property on page 236
Map.MapUnit property on page 302
LabelProperties.LineType property
Purpose
Controls the type of line to be used to connect the label to the feature being labeled. This is used
when the Offset is large. This takes a LineTypeConstants value, and the default is
miLineTypeArrow, except for objects having a PredominantFeatureType of miFeatureTypeRegion.
These default to None.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
236
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
LabelProperties.Offset property on page 237
LabelProperties.Offset property
Purpose
This property specifies the distance between the label and the feature being labeled. This is useful
for symbol features, when you want the label a certain distance away from the symbol. This is an
Integer value, and specifies the distance in pixels. The default is 2.
Note:
If the LableProperties.Position property is set to miPositionCC (center-center), then the
LableProperties.Offset property will be ignored.
See Also
LabelProperties.Position property on page 237
LabelProperties.LineType property on page 236
LabelProperties.Overlap property
Purpose
This property allow labels to overlap with each other when they are drawn on a layer. This is a
Boolean value, and the default is False.
Remarks
The LabelProperties.Overlap is used only for auto labels. For manually labeled features, Overlap
is ignored.
LabelProperties.Parallel property
Note:
This is a 'deprecated' property that still works for backward compatibility. Please use the
LabelProperties.LabelAlong property instead.
LabelProperties.PartialSegments property
Note:
This is a 'deprecated' property that still works for backward compatibility. Please use the
LabelProperties.LabelPartialObjects property instead.
LabelProperties.Position property
Purpose
This property sets how the label should be positioned relative to the map feature. This takes a
PositionConstants value.
The default value depends on the PredominantFeatureType:
•
miFeatureTypeSymbol is miPositionCR
•
miFeatureTypeLine is miPositionTC
•
All others are miPositionCC
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
237
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
LabelProperties.Style property
Purpose
This property sets the style used to display the labels. The default is 10 point Helvetica.
LabelProperties.Visible property
Purpose
Controls whether labels are visible for the layer. Labels can be created using the Layer.Autolabel
property, or manually using the Layer.LabelAtPoint method or using the Label tool. This Visible
property controls whether all labels for the layer are visible. This takes a Boolean value, and the
default is True.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
238
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer Object and Layers Collection
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 are incorrectly
ordered in the map window, MapX might draw the customer points first and then display the
census tract layer second. Your points would be obscured beneath the census tract layer.
Zoom Layering
Sometimes you want a map layer to display only at certain zoom levels. Zoom Layering controls
the display of a map layer only when the map's zoom level falls within a preset distance.
For example, you have a layer of streets and a layer of ZIP Code boundaries. When you zoom out
past 10 or so miles, the streets look like a black smudge in the window. This is because the zoom
(window width) is too wide to show detailed street maps. Use Zoom Layering to prompt MapX to
display the street layer only when the zoom is set to distance that allows you to see the street
detail properly, for instance, less than 5 miles.
The first map doesn't have zoom layering set for its street layer. At a zoom of 15 miles across,
notice how difficult it is to see any detail. The second map has zoom layering set to display the
streets when the zoom is less than five miles. Therefore, the streets layer does not display when
the window is set at 15 miles.
You can set a different zoom layering level for each layer.
Object Properties
•
Layer.AutoLabel property
•
Layer.Bounds property
•
Layer.ClippedBounds property
•
Layer.CoordSys property
•
Layer.Datasets property Purpose
•
Layer.DrawLabelsAfter property
•
Layer.Editable property
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
239
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
•
Layer.FileSpec property
•
Layer.KeyField property
•
Layer.Labels 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.CreateAllFeaturesConstraint method
•
Layer.CreateBoundsConstraint method
•
Layer.CreateFeaturesConstraint 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.Pack method
•
Layer.Refresh method
•
Layer.Search method
•
Layer.SearchAtPoint method
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
240
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
•
Layer.SearchWithinDistance method
•
Layer.SearchWithinFeature method
•
Layer.SearchWithinRectangle method
•
Layer.SupportsPack method
•
Layer.UpdateFeature method
Collection Properties
•
Layers.AnimationLayer property
•
Layers.Bounds property
•
Layers.ClippedBounds 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 on page 285
Layer.AddFeature method
Purpose
This method creates and returns a new feature in the layer with the properties of the Source object
feature. This method is useful for Object Editing.
Syntax
[feature=]OBJECT.AddFeature (Source, [RowValues])
Part
Description
OBJECT
Represents a Layer object.
Source
Source is a Feature object.
RowValues
RowValues represents the new values of the attribute data, for one row of data. Each
value in the RowValues collection corresponds to one column of attribute data. This
parameter is ONLY applicable to a Dataset of type miDatasetLayer.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
241
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Layer.AllFeatures method on page 242
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Feature.FeatureKey property on page 177
RowValue Object and RowValues Collection on page 336
Layer.AllFeatures method
Purpose
This returns a features object with all features from the layer.
Syntax
[Features= ]OBJECT.AllFeatures
See Also
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.AutoLabel property
Purpose
This property controls whether a layer is automatically labeled. In order for a label to be displayed
automatically, its centroid must be within the viewable map area. This is a Boolean value, and its
default is False.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
242
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.BeginAccess method
Purpose
This method will open and lock the table for read/write access. This improves the performance for
repeated layer and Dataset operations. You must call Layer.EndAccess once for each call to
Layer.BeginAccess.
Syntax
OBJECT.BeginAccess (BeginAccessType)
Part
Description
OBJECT
Represents a Layer object.
BeginAccessType
One of the LayerBeginAccessConstants, specifying the type of access
(e.g., read-only or read/write).
Remarks
MapX programs written without using BeginAccess and EndAccess will work as before, but
without the performance enhancement for multiple operations.
You may nest calls to BeginAccess, however, only the first one has any effect.
See Also
Layer.EndAccess method on page 249
Layer.Bounds property
Purpose
This returns a Rectangle object representing the geographic extents (i.e., the minimum bounding
rectangle) of all objects in the layer; does not apply to user draw layers.
Remarks
This property is useful if you want to zoom the map out far enough to show all objects in one layer.
See Also
Layers.Bounds property on page 267
Layer.CreateAllFeaturesConstraint method
Purpose
This method creates a new AllFeaturesConstraint object for use in controlling the data in the
cache.
Syntax
[objAllFeaturesConstraint = ]OBJECT.CreateAllFeaturesConstraint
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
243
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
The data that is held in the cache by this object is only held as long as the constraint (or some
other constraint) exists. Thus, specifying code such as:
lyr.CreateAllFeaturesObject.Enable = True
This code will creates constraint and that ensures that all records are cached as it is above).
However, the newly created constraint object is then destroyed releasing the records from the
cache. To be effective, the constraint object must be stored in a variable by the client and released
(or set to Nothing or Enabled = False) when the records are no longer needed.
Unlike the BoundsConstraint and FeaturesConstraint, the AllFeatures constraint is initially
disabled and will not ensure that all records are cached until the constraint is enabled.
See Also
AllFeaturesConstraint Object on page 140
Feature Object and Features Collection on page 174
Layer.CreateBoundsConstraint method
Purpose
This method is used to create a new BoundsConstraint object for use in controlling the cached
data in the layer.
Syntax
[objBoundsConstraint = ]OBJECT.CreateBoundsConstraint
Remarks
The data that is held in cache by this object is only held as long as the constraint (or some other
constraint) exists. Thus, specifying code such as:
Set lyr.CreateBoundsObject.Bounds = rect
This code creates a constraint and sets the constraint's bounds. This will ensure records are
cached. However, the newly created BoundsConstraint object is then destroyed releasing the
records from the cache. To be effective, the BoundsConstraint object must be stored in a variable
by the client and released (or set to Nothing) when the records are no longer needed.
See Also
BoundsConstraint Object on page 153
Rectangle Object on page 332
Layer.CreateFeaturesConstraint method
Purpose
This method creates a new FeaturesConstraint object for use in controlling the data in the cache.
Syntax
[objFeaturesConstraint = ]OBJECT.CreateFeaturesConstraint
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
244
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
The data that is held in the cache by this object is only held as long as the constraint (or some
other constraint) exists. Thus, specifying code such as:
Set lyr.CreateFeaturesObject.Features = ftrs
This code creates a constraint and set the constraint's features collection which ensures these
records are cached. However, the newly created FeaturesConstraint object is destroyed, releasing
the records from the cache. To be effective, the FeaturesConstraint object must be stored in a
variable by the client and released (or set to Nothing) when the records are no longer needed.
See Also
FeaturesConstraint Object on page 187
Feature Object and Features Collection on page 174
Layer.ClippedBounds property
Purpose
This read-only property returns the union of all layer clipped boundaries within a Rectangle object.
Use this property to set the Map.Bounds property when the map projection has infinite poles, such
as a Mercator projection, and the layer projection does not. Otherwise, the latitude would need to
be adjusted manually so that near-infinite numbers are not produced (which would cause the map
to appear as a thin vertical line).
Remarks
Since this is a read-only property, you may NOT set it to another rectangle object.
Example
Set Map.Bounds = Map.Layer.ClippedBounds
See Also
Map.Bounds property on page 288
Layer.Bounds property on page 243
Layers.ClippedBounds property on page 267
Layer.CoordSys property
Purpose
This property returns a read-only CoordSys object, indicating the coordinate system in which the
layer was saved.
See Also
CoordSys Object on page 156
Map.DisplayCoordSys property on page 296
Map.NumericCoordSys property on page 306
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
245
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.ClearCustomLabels method
Purpose
Removes any labels placed on the current layer.
Syntax
OBJECT.ClearCustomLabels
Layer.Datasets property Purpose
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.
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 on page 167
Map.Datasets property on page 294
Layer.DeleteFeature method
Purpose
Deletes the feature and its database row from the layer.
Syntax
OBJECT.DeleteFeature (FeatureKey)
Part
Description
OBJECT
Represents a Layer object.
FeatureKey
The Feature object to delete. 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 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
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
246
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.DrawLabelsAfter property
Purpose
Boolean. When set to True, the labels for all layers from the bottom layer (or the last layer with this
property set) up to and including the layer itself are drawn after the layer is drawn. This allows for
better control over where labels are in the drawing order.
By default, layers have this property set to False, and the labels are drawn after the topmost layer,
but before any animation layer.
Layer.DrilldownAddFeatures method
Purpose
Adds features to a Drilldown 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.
FeatureKeys
Variant: A string or an array of strings, identifying the Drilldown IDs of the features that
should be added. Note that these are Drilldown IDs (i.e., values from a column in the
Drilldown component table), not the MapX Feature's internal FeatureID values.
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.
Layer.DrilldownRemoveFeatures method
Purpose
Removes features from a Drilldown layer.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
247
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.DrilldownRemoveFeatures (Level, FeatureKeys)
Part
Description
OBJECT
A Layer object that corresponds to a Drilldown layer.
Level
String, indicating which level contains the features to remove.
FeatureKeys
Variant: A string or an array of strings, identifying the Drilldown IDs of the features that should be removed. Note that these are the IDs specified in the Drilldown table's first column, not the MapX Feature's internal FeatureID values.
Remarks
Method does not actually alter the contents of any tables. The features that you are removing are
not deleted from the table; by “removing” them, you simply make them disappear.
Layer.DrilldownReset method
Purpose
Clears all features from the Drilldown layer, and reinitializes the layer using features from a single
level.
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.
Layer.Editable property
This property allows a selection in the layer to be edited (moved, resized, or deleted). The
ArrowTool can be used to move or resize selected objects. The delete key deletes selected
objects.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
248
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.EndAccess method
Purpose
The EndAccess method unlocks map tables. You must call Layer.EndAccess once for each call to
Layer.BeginAccess.
Syntax
OBJECT.EndAccess (endAccessType)
Part
Description
OBJECT
Represents a Layer object.
endAccessType
One of the LayerEndAccessConstants, specifying the end access type.
Remarks
If Layer.BeginAccess was called with a beginAccessType of miAccessRead or
miAccessReadWrite, the EndAccessType parameter must be miAccessEnd.
MapX programs written without using BeginAccess and EndAccess will work as before, but
without the performance enhancement for multiple operations.
See Also
Layer.BeginAccess method on page 243
Layer.FeatureIDFromFeatureName method
Given a name, this method returns the ID of the feature with that name (returns the ID of the first
feature with the specified name if the name is not unique within the layer). The name is currently
defined to be the value in the first column of the MapInfo table. It throws an exception if there is no
feature with the name specified.
Syntax
[int=]OBJECT.FeatureIDFromFeatureName (Name)
Part
Description
OBJECT
Represents a Layer object.
Name
A string which is the name of the feature whose ID you want to get.
Layer.FeatureKeyFromFeatureName method
Purpose
This method returns a FeatureKey from the FeatureName in a Layer object. MapX searches to
Layer.KeyField for the first row containing the name in the KeyValue parameter. If the KeyValue is
NOT found, MapX throws error #1205. Otherwise, it returns the FeatureKey of the new row it
found.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
249
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
[BSTR=]OBJECT.FeatureKeyFromFeatureName (KeyValue)
Part
Description
OBJECT
Represents a Layer object.
KeyValue
The name of the feature and the value to search for.
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 on page 252
Layer.Search method on page 255
Layer.FileSpec property
Purpose
This property contains the full file specification of where the layer is physically stored. This is a
String value, and is read-only.
Layer.Find property
Purpose
This property defines the Find object for the layer.
Layer.GetDrilldownFeaturesByID method
Purpose
This method returns a Feature object, given the feature's ID.
Syntax
[Feature=]OBJECT.GetDrilldownFeaturesByID( strLevel, FeatureID)
Part
Description
OBJECT
Represents a Layer object.
strLevel
The name of a level in the Drilldown layer.
FeatureID
A string or an array of strings, identifying which feature(s) to query.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
250
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.GetFeatureByID method
Purpose
This method returns a Feature object, given the feature's ID.
Syntax
[Feature=]OBJECT.GetFeatureByID( FeatureKey )
Part
Description
OBJECT
A Layer object.
FeatureKey
A string that identifies the feature. This is the value returned by Feature.FeatureKey
property. This is a replacement for Feature.FeatureID, which still works as it did before,
but it is recommended that you use the new FeatureKey property.
The FeatureKey property is used to identify a unique record in a table. In previous versions, the FeatureID property was used for this purpose, but it did not work correctly for
seamless and remote layers. The FeatureKey property works for all layer types.
See Also
Feature.FeatureKey property on page 177
Feature.FeatureID property on page 177
Layer.GetFeatureByKey method
Purpose
This method returns a feature object with a given key in a Layer object.
Syntax
[Feature=]OBJECT.GetFeatureByKey (FeatureKey)
Part
Description
OBJECT
This represents a Layer object.
FeatureKey
A string that identifies the feature. This is the value returned by Feature.FeatureKey property. 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.
See Also
Feature.FeatureKey property on page 177
Layer.Invalidate method
Purpose
This method causes the rectangle (in container screen coords) to be redrawn.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
251
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.Invalidate ([InvalidRect])
Parts
Description
OBJECT
This represents a Layers object.
InvalidRect
This represents the rectangle.
See Also
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.KeyField property
Purpose
This string property identifies the column (field) name in the layer's MapInfo table that will be set or
retrieved by the KeyValue property of a feature object. It currently defaults to the first column in the
layer's table. This property does not apply to raster or userdraw layers. An error is raised if you try
to set the KeyField to an invalid field name.
Layer.Labels property
Purpose
This read-only property returns the Labels collection for a layer in the map. The Labels collection
for a layer consists of all labels in that layer that are currently visible in the map window or in the
cache, as well as any labels from that layer that have been edited either manually (using the stock
Select tool) or programatically (using methods and properties of the Layer object and Layers
Collection).
Syntax
[Labels= ]OBJECT.Labels
See Also
Label Object and Labels Collection on page 228
Map.EditableLabels property on page 297
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
252
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.LabelAtPoint method
Purpose
Labels a particular object at a point.
Syntax
OBJECT.LabelAtPoint (x, y)
Part
Description
OBJECT
Represents a Layer object.
x
X map coordinate of point (double value).
y
Y map coordinate of point (double value).
Layer.LabelProperties property
Purpose
This read-only property returns the layer's LabelProperties object. The LabelProperties object is
used to control the appearance of labels for the layer.
See Also
LabelProperties Object on page 234
Layer.AutoLabel property on page 242
Layer.Name property
Purpose
This property contains the name of the layer. A name is given to the layer when added.
Layer.NoFeatures method
Purpose
This returns an empty features object for the layer.
Syntax
OBJECT.NoFeatures()
See Also
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
253
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.OverrideStyle property
Purpose
Controls whether the style for the map features should be overridden using the Style property. This
is a Boolean value, and the default is False.
See Also
Layer.Style property on page 260
Layer.Pack method
Purpose
This method enables you to compress tables (so that they use less disk space) and eliminate
records that have been marked as deleted. Packing the data will rebuild the index and graphics
files.
Note:
Performing a Pack Table operation can corrupt your customized labels in MapInfo
Professional Workspaces. For additional information, please refer to the MapInfo
Professional Online Help System or Users Guide.
Syntax
OBJECT.Pack (PackType)
Part
Description
OBJECT
Represents a layer object
PackType
One or more of the LayerPackConstants, specifying the type of packing to perform.
• Remove Deleted Records
• Rebuild Graphics
• Pack Graphics
• Rebuild Index
• Pack Index
• Compact the Database (only valid for Access Tables)
Remarks
Although packing a file's graphic information saves disk space, it may make graphic update
operations a little slower in that file; you are sacrificing processing speed for disk space.
Alternatively, if you have just created a TAB file by performing an import operation, you may want
to pack the graphic data.
Before you pack a table, make sure there is enough disk space to store a copy of the database as
a scratch file. You cannot pack a read-only file. Packing will also not be allowed on a table if the
table’s files can not be locked for write access. You cannot Pack a table for which you have called
Layer.BeginAccess method without calling a corresponding Layer.EndAccess method.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
254
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
To rebuild the index and/or graphics files without removing the deleted records, specify the rebuild
options separately (e.g., Rebuild Graphics and/or Rebuild Index). For tighter packing of the index
and/or graphics files, specify the Pack option for the Index and/or Graphics. If the table is an
Access (DAO) table, you may also specify Compact in addition to the other options or by itself.
Call Layer.SupportsPack method before calling Pack to see if the Layer’s table supports the
desired pack operation.
See Also
LayerPackConstants in Appendix G on page 456
Layer.SupportsPack method on page 260
Layer.PredominantFeatureType property
Purpose
A read-only property that returns an integer representing one of the FeatureTypeConstants. It is
used to determine which type of feature is most prevalent in a layer.
Remarks
If the layer has an equal number of features of more than one type (e.g., two symbols and two
regions) then PredominantFeatureType will return miFeatureTypeMixed unless one of the types is
Region in which case PredominantFeatureType returns miFeatureTypeRegion.
Layer.Refresh method
Purpose
This method flushes the cache from the layer. This is useful for server layers that have caching
turned on.
Syntax
OBJECT.Refresh
See Also
LayerInfo Object on page 271
Layer.Search method
Purpose
The Layer.Search method exposes the power of SQL queries. The expression (the “where-clause”
portion of the statement) is evaluated for each row in the Layers table, and a Features collection
is returned, made up of every feature for which the expression is true.
Syntax
[Features collection= ]OBJECT.Search (strWhere, [Variables])
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
255
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
OBJECT
Represents a Layer object.
strWhere
String: An expression to evaluate for each feature.
Variables
Variant: This is an optional parameter. If specified, it must be a Variables object. When an
expression interacts with an unresolved identifier it will try to resolve it in the Variables collection.
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' expression, the string is
considered “True” if it has at least one character in it, and “False” if it is of zero length.
In expressions, MapX will perform a type conversion from boolean to string for function
parameters that expect a string argument.
When specifying dates as string constants, the following applies:
•
Dates consist of a month, a day, and an optional year.
•
The year must be specified by four digits.
•
The entire date string should be enclosed in double quotes.
•
The components of a date can be separated by hyphens or slashes.
See Also
Feature Object and Features Collection on page 174
Appendix H: Creating Expressions
Appendix J: IDispatch Table
Geographic operators in Appendix H on page 465
Variable Object and Variables Collection on page 394
Appendix A: MapX Field Naming Conventions
Layer.SearchAtPoint method
Purpose
This returns Features collection object.
•
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.
•
Combination - By combining (using OR operator) one or more of the
SearchResultTypeConstants, you can define whether you want all the features, the
topmost feature, all the regions, all the points, the topmost point, etc. The default is to
return all the features.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
256
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
[Features collection=]OBJECT.SearchAtPoint (Point, [SearchResultFlag])
Part
Description
OBJECT
This represents a Layer object.
Point
X and Y map coordinates of a given point location.
SearchResultFlag
This optional parameter controls what to return. It takes one or a combination of
SearchResultTypeConstants values.
See Also
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.NoFeatures method on page 253
Layer.Invalidate method on page 251
Layer.SearchWithinDistance method on page 257
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.SearchWithinDistance method
Purpose
Searches for map features within a specified distance, and returns search results as a Features
collection.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
257
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.SearchWithinFeature method
Purpose
This method returns the Features collection of the feature it is searching within.
Syntax
OBJECT.SearchWithinFeature (Feature, SearchType)
Part
Description
OBJECT
Represents a Layer object.
Feature
Feature object to use as basis of search.
SearchType
SearchType is miSearchTypeCentroidWithin, miSearchTypePartiallyWithin, or
miSearchTypeEntirelyWithin.
See Also
Selection.SelectByRegion method on page 346
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinDistance method on page 257
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
258
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layer.SearchWithinRectangle method on page 259
Layer.UpdateFeature method on page 261
Layer.SearchWithinRectangle method
Purpose
This method returns a Features collection within the bounds of a specified Rectangle.
Syntax
[features collection=]OBJECT.SearchWithinRectangle (Rectangle, SearchType)
Part
Description
OBJECT
Represents a Layer object.
Rectangle
Rectangle object to use as basis of search.
SearchType
SearchType is miSearchTypeCentroidWithin, miSearchTypePartiallyWithin, miSearchTypeEntirelyWithin.
See Also
Layer.AddFeature method on page 241
Layer.DeleteFeature method on page 246
Layer.Invalidate method on page 251
Layer.NoFeatures method on page 253
Layer.SearchAtPoint method on page 256
Layer.SearchWithinFeature method on page 258
Layer.SearchWithinDistance method on page 257
Layer.UpdateFeature method on page 261
Layer.Selectable property
Purpose
Controls whether layer is selectable using the selection tools. This property does not affect the
selection process using the automation methods in the Selection collection. This is a Boolean
value, and the default is On/True.
See Also
Selection Collection on page 340
Layer.Selection property
Purpose
A collection of selected features for the layer.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
259
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Selection Collection on page 340
Layer.ShowNodes property
Purpose
This read/write property displays all nodes for all features in a layer when true. Its default is false.
Layer.ShowCentroids property
Purpose
This read/write property draws object centroids (regions only) when set to true. Its default is false.
Layer.ShowLineDirection property
Purpose
This read/write property draws an arrow indicating line direction (lines and poly lines only) when
set true. Its default is false.
Layer.Style property
Purpose
The style object used to override the appearance of all features in the layer on the map. The Style
object is retrieved and filled with the new requested override values. This style is used if the
Override property is set to True.
See Also
Layer.OverrideStyle property on page 254
Layer.SupportsPack method
Purpose
This method is used to determine if a layer can be packed or not.
Syntax
[bool=]OBJECT.SupportsPack (PackType)
Part
Description
OBJECT
Represents a layer object
PackType
One or more of the LayerPackConstants, specifying the type of packing to perform.
bool=
Boolean value that indicates if a layer can be packed.
See Also
Layer.Pack method on page 254
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
260
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
LayerPackConstants in Appendix G on page 456
Layer.Type property
Purpose
This ia a read only property that returns an integer corresponding to one of the
LayerPackConstants:
•
miLayerTypeNormal = 0
•
miLayerTypeRaster = 2
•
miLayerTypeSeamless = 4
•
miLayerTypeUnknown = 5
•
miLayerTypeUserDraw = 6
Layer.UpdateFeature method
Purpose
This updates the target feature in the layer to have the properties of the Source feature. This
method is useful for object editing.
Syntax
OBJECT.UpdateFeature (Target, [Source], [RowValues])
Part
Description
OBJECT
Represents a Layer object.
Target
The Feature object to update that could be a FeatureKey, FeatureID, or Feature Object.
However, it is recommended that you use the FeatureKey as it is a replacement for FeatureID parameter. (NOTE: FeatureID still works as it did before.) 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.
Source
This optional parameter is the Feature object to take the properties from. The default is Target.
RowValues
This optional parameter is the RowValues represents the new values of the attribute data,
for one row of data. Each value in the RowValues collection corresponds to one column of
attribute data. This parameter is ONLY applicable to a Dataset of type miDatasetLayer.
Remarks
This method should not be used to update a computed column, but will not throw an exception if
you are trying to do so. The reason for this for this is that the RowValues collection may contain
both computed columns and non-computed columns.
When the ComputeTheme property is set to false that the legend.showemptyranges property must
be set to true in order for the theme's legend text(s) to be visible. This is because MapX does not
calculate theme category counts when ComputeTheme is set to false.
Columns named or aliased with name of MI_PRINX or PRINX are not updateable.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
261
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Chapter 14: The MapX Object Reference
Layer.UpdateFeature will not throw exceptions when one attempts to update nonupdateable columns. Oracle layer columns of the following datatypes are not updateable
and will not invoke exceptions if you try to update them:
•
•
•
Long
Raw
LOB,BFILE
See Also
Feature Object and Features Collection on page 174
RowValue Object and RowValues Collection on page 336
Layer.Visible property
Purpose
This controls whether the layer is visible or not. This is a Boolean value, and the default is True.
Layer.ZoomLayer property
Purpose
This controls whether the layer is zoom layered. Zoom layering controls the range of zoom levels
(distance across map) for which the layer is displayed. If Zoom Layering is on, then the values
stored in the ZoomMax and ZoomMin properties are used. This is a Boolean value, and the default
is False.
See Also
Layer.ZoomMax property on page 262
Layer.ZoomMin property on page 262
Layer.ZoomMax property
Purpose
If ZoomLayering is on (Layer.ZoomLayer property), then this specifies the maximum zoom value
for which a layer will be drawn on the map. This takes a double value specifying distance in Map
units (Map.MapUnit).
See Also
Layer.ZoomMax property on page 262
Layer.ZoomMin property on page 262
Layer.ZoomMin property
Purpose
If ZoomLayering is on (Layer.ZoomLayer property), then this specifies the minimum zoom value
for which a layer will be drawn on the map. This takes a double value specifying distance in Map
units (Map.MapUnit).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
262
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Layer.ZoomLayer property on page 262
Map.MapUnit property on page 302
Layers.Add method
Purpose
This method creates a layer object for a specified file, adds it to the collection, and displays it on
the map.
Syntax
[Layer=]OBJECT.Add (LayerInfo, [Position])
Part
Description
OBJECT
Represents a Layers object.
LayerInfo
Variant: This can be either a LayerInfo object or a Pathname of the MapInfo table
(.TAB) file to be added as a layer.
Position
Variant: Its initial position in the layer list. If omitted or 0, the auto layer positioning
algorithm is used.
Remarks
The layer is positioned automatically with respect to other layers in the map. For example, the
layer with points is placed above a layer with regions.
If a string is passed for the LayerInfo parameter, it is treated as a file specification with the
following interpretation:
•
.tab extension is treated as a .tab file.
•
Any other extension is treated as a self-registering raster file.
•
No extension is treated as a geodictionary user name.
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a
layer name (as in the "name" parameter of the LayerInfo object, Layers.AddUserDrawLayer,
and Layers.AddServerLayer), an exception will be thrown if the name is not unique.
When the type property of LayerInfo is 'NewTab' and the 'Fields' parameter has a 'string' field of
length 255 or greater, an exception will be thrown. The field length is based upon the 254 length
limit of MapInfo Professional.
See Also
LayerInfo Object on page 271
Layers.AddServerLayer method on page 264
Layers.AddUserDrawLayer method on page 265
Appendix A: MapX Field Naming Conventions
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
263
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layers.AddGeosetLayers method
Purpose
This method adds the specified GeoSet to the current map and creates Layer objects for each
layer specified in the GeoSet that is not already in the Layers collection.
Syntax
OBJECT.AddGeosetLayers (GeosetName)
Part
Description
OBJECT
Represents a Layers object.
GeosetName
Geoset 'friendly' name or full file specification.
See Also
Map.GeoSet property on page 300
Layers.AddServerLayer method
Purpose
This method is included for backwards compatibility. It is highly recommended that you do NOT
use this method. The preferred method for performing the same function is simply the Layers.Add
method with the LayerInfo object passed as an argument. This allows you to specify that the layer
is a server layer and to control the cache and MBR search and adds remote spatial data to the
map (i.e., a layer of features retrieved from a remote database, such as Oracle or Informix).
Note:
This method is NOT available in MapX Mobile.
Syntax
[Layer=]OBJECT.AddServerLayer (Name, ConnectString, Query, [Position ],
[ServerLayerOptions])
Part
Description
OBJECT
A Layers collection object.
Name
A string indicating the name of the layer to create (e.g., “Highways”).
ConnectString
An ODBC connection string, which specifies connection information such as host
name, password, etc. If the string does not provide all necessary information, the
ODBC data source displays a connection dialog. You can re-use connections, thus
avoiding redundant connection dialogs. If you pass a complete connection string
that matches an existing string in the current connection pool, that connection will
be shared by the two tables. The password does not need to be in the connection
string for the two strings to match.
Query
A string that specifies a GISSQL/Server-specific SQL query.
Position
Optional: The position in the list of layers. To make this layer the top layer in the
map, specify 1 (one).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
264
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
ServerLayerOptions
Optional: Accepts a bitwise OR of the LayerSrvLayerOptions values, which control
the behavior of the server layer. The default value is (miLayerCacheOn OR miMBRSearchOn). The reason for this distinction is that while in VB, the OR operator is
used for both logical and bitwise OR, C++ has different operators for each. Someone embedding MapX in a C++ application should know the correct OR to use.This
allows control of certain behavior of a server layer (presently the cache and the
MBRsearch options). It does not take a Boolean. It takes a set of flags (bitmask) as
described below. Use the enumerated values provided and simply OR them
together to define the SrvLayerOptions value before calling AddServerLayer
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.
miLayerMBRSearchOff
Turns off the MBRSearch predicate that is appended to the query when the
Map is drawn. This is useful for queries which already contain a spatial predicate and where an additional spatial predicate should be avoided.
Remarks
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a
layer name (as in the “name” parameter of the LayerInfo object, Layers.AddUserDrawLayer,
and Layers.Add), an exception will be thrown if the name is not unique.
This adds ODBC layers ONLY. Oracle Spatial layers must be added via Layers.Add with the
LayerInfo object.
See Also
Layers.Add method on page 263
Layers.AddUserDrawLayer method on page 265
LayerInfo Object on page 271
Layers.AddUserDrawLayer method
Purpose
This method is included for backwards compatibility. It is highly recommended that you do NOT
use this method. The preferred method for performing the same function is simply the Layers.Add
method with the LayerInfo object passed as an argument. However, this method adds a layer that
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
265
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
the container application is responsible for drawing to. It is used in conjunction with the
DrawUserLayer event, which is fired when the layer needs to get drawn. This returns newly
created Layer 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.AddServerLayer, and
Layers.Add), an exception will be thrown if the name is not unique.
See Also
Layers.Add method on page 263
Layers.AddUserDrawLayer method on page 265
LayerInfo Object on page 271
Layers.AnimationLayer property
The animation layer is useful where map features need to be updated frequently, such as in realtime 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.
To turn off the animation layer, you assign null to it:
Set Map.Layers.AnimationLayer = nothing
This turns the layer back into a normal layer, which is still positioned in the same place in the layer
list.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
266
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layers.Bounds property
Purpose
This returns a Rectangle object representing the geographic extents (i.e., the minimum bounding
rectangle) of all layers in the collection (except the UserDraw layer).
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 on page 243
Layers.ClippedBounds property
Purpose
This read-only property returns the union of all layer clipped boundaries within a Rectangle object.
Use this property to set the Map.Bounds property when the map projection has infinite poles, such
as a Mercator projection, and the layer projection does not. Otherwise, the latitude would need to
be adjusted manually so that near-infinite numbers are not produced (which would cause the map
to appear as a thin vertical line).
Remarks
Since this is a read-only property, you may NOT set it to another rectangle object.
Example
Set Map.Bounds = Map.Layers.ClippedBounds
See Also
Map.Bounds property on page 288
Layer.Bounds property on page 243
Layer.ClippedBounds property on page 245
Layers.ClearSelection method
Purpose
Deselects features in all layers of the Layers collection.
See Also
Selection.ClearSelection method on page 341
Layers.Count property
Purpose
Contains the number of Layer objects in the collection. This is an Integer value and is read-only.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
267
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Layers.CreateLayer method
Purpose
The CreateLayer method allows you to create a new temporary or permanent MapInfo table layer.
The created table has a column for the feature name, which is used by labeling and data binding.
When you add or update a feature, the Name property is put into the feature name column.
Note:
This is a 'deprecated' method that still works for backward compatibility. 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
OBJECT
A Layers collection object.
Name
A name to refer to the layer by (the username of the layer).
FileSpec
Variant: The pathname of where to create the layer. The filename should include the .tab
extension. The other files that make up a MapInfo table (.map, .dat, etc.) are created in the
same directory as the .tab file. If no filename is given, then a temporary layer is created,
which will be deleted when then map is destructed.
Position
Variant: Its initial position in the layer list. If omitted, the auto layer positioning algorithm
assigns a layer order based on the type of layer.
KeyLength
Variant: The length of the column added to the table to hold the feature names. If omitted,
the default is 32.
CoordSys
Variant: A CoordSys object that specifies the coordinate system in which the new layer is
stored. Optional; if omitted, the Map.NumericCoordSys property is used.
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”.
See Also
Layers.Add method on page 263
LayerInfo Object on page 271
Layers.InsertionLayer property
Purpose
This property specifies what new layer objects will be inserted into by the built-in object editing
tools. Initially InsertionLayer is set to null. You can assign a Layer object to the property to make
that Layer the InsertionLayer.
Remarks
You cannot make a drill-down, raster, seamless or user-draw layer the insertion layer.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
268
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
Layers.Item property
Purpose
Gets a specific Layer object from the collection. Item takes either an index (Integer value starting
at 1), or a layer name, to specify which Layer object to get.
Layers.LayersDlg method
Purpose
Presents a dialog where the user can add layers, remove layers, change layer ordering, and
change layer properties. If the user clicks OK, the changes made within the dialog will immediately
be applied to the map.
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
Layers.Move method
Purpose
Moves a layer in the Layer collection to change the order in which layers are drawn.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
269
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.Move (From, To)
Part
Description
OBJECT
Represents a Layer object.
From
Index number of the layer to move. The topmost layer is 1.
To
New location for the layer. For example, if you want it to be the second layer, use 2.
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.
Layers. Remove method
Purpose
This method removes a Layer object from the collection. This has the effect of removing the layer
from the map.
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.
If you remove an item, the collection indexes are renumbered to fill in the hole left by the item
removed.
Layers.RemoveAll method
Purpose
Removes all Layer objects from the collection.
Syntax
OBJECT.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
270
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
LayerInfoType
miLayerInfoTypeTab
Parameter
Required
Type
FileSpec
Yes
String: File specification of the .tab file to
open
Name
No
String: Name of the added layer
miLayerInfoTypeUserDraw
Name
Yes
String: Name of the added layer
miLayerInfoTypeRaster
FileSpec
Yes
String: File specification of the self-registering raster file to open
Name
No
String: Name of the added layer
FileSpec
Yes
String: File specification of the .shp file
(shapefile).
Name
No
String: Name of the added layer
CoordSys
Yes
CoordSys Object: Coordinate System
in which object data is stored in the .shp
file.
Style
No
Style Object: Style to use in rendering
the objects.
Name
Yes
String: Name of the added layer
ConnectString
Yes
String: ODBC connection string (see
AddServerLayer)
Query
Yes
String: SQL Query (see AddServerLayer)
ToolKit
Yes
String: ToolKit option, either ODBC or
ORAINET
miLayerInfoTypeShape
*Shapes supported by MapX are:
• Null
• Point
• PolyLine
• Polygon
miLayerInfoTypeServer
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
271
MapX_Mobile_DevGuide.pdf
Developer Guide
LayerInfoType
miLayerInfoTypeServer (continued)
Chapter 14: The MapX Object Reference
Parameter
Required
Type
Cache
No
String - Possible values are:
• OFF - The cache is not used for this
layer.
• ON (default) - Cache is enabled and
automatically performs caching
based on the map view (center/
zoom). User may additionally control
the cache through the cache constraint objects.
• USER - Cache is enabled for this
layer without the automatic caching
performed internally in MapX. Only
the data requested by the user (via
the cache constraint objects) will be
cached.
• ALL - The entire layer is cached during the entire existence of the layer.
Default is ON.
Note: Specifying Cache=ON or USER
with MBRSearch set to OFF is
treated internally the same as
Cache=ALL and all records will
be cached.
MBRSearch
No
String: Either ON or OFF.
Default is ON.
CacheStorageType
No
String: Either MemTable or Native.
Default is MemTable.
CacheMaxDisk
No
Numeric: Indicates the maximum
amount of disk storage (in KB) to use by
the cache. A value of -1 signifies unlimited which is the default. Note that even
a CacheStorageType of Memtable uses
some disk space to store the geographic
objects. This option only applies when
the cache parameter is set to “ON”.
CacheMaxMemory
No
Numeric: Indicates the maximum
amount of memory storage (in KB) to
use by the cache. A value of -1 signifies
unlimited which is the default. This
option is only applicable when the
CacheStorageType parameter is
Memtable. This option only applies when
the cache parameter is set to “ON”.
CacheMaxAge
No
Numeric: Indicates the maximum
amount of time (in seconds) that a
unused constraint will remain in the
cache's history. A value of -1 signifies
unlimited which is the default. This
option only applies when the cache
parameter is set to “ON”.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
272
MapX_Mobile_DevGuide.pdf
Developer Guide
LayerInfoType
miLayerInfoTypeServer
(continued)
Chapter 14: The MapX Object Reference
Parameter
Required
Type
CacheMaxRecords
No
Numeric: Indicates the maximum number of records to retain in the cache. A
value of -1 signifies unlimited which is
the default. This option only applies
when the cache parameter is set to
“ON”.
CacheMaxViews
No
Numeric: Indicates the maximum number of views to retain in the cache's history. A value of -1 signifies unlimited.
The default is 0. This option only applies
when the cache parameter is set to
“ON”.
miLayerInfoTypeGeodictUserName
Name
Yes
String: Name of the layer to add (as
stored in the Geodictionary).
miLayerInfoTypeTemp
Name
No
String: Name of the added layer.
Default: “LayerX”
Fields
No
Fields collection: Specifies the column(s) the table will have.
Features
Yes, if no
fields
Features collection: Specifies the rows
to fill the table with
Default: none
TableStorageType
No
String: Default: Native.
Valid options: Native, MemTable
FileSpec
Yes
String: Name of .tab file for new table
Name
No
String: Name of the added layer
Default (if not specified): LayerX where X
= the number of layers currently in the
map + 1
Fields
No
Fields collection: Specifies the column
the table will have
Features
Yes, if no
Fields
Features collection: Specifies the rows
to fill the table with
Default: none
OverwriteFile
No
String: If 1, then the file specified by the
FileSpec parameter will be overwritten if
it currently exists.
If 0, the file will not be overwritten.
Note: all non-zero values will force
the file to be overwritten.
TableStorageType
No
String: Default: Native. Valid options:
Native, Access
Note: For a table storage type of
Access, fields of type DECIMAL
will be changed to FLOAT.
miLayerInfoTypeNewTable
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
273
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
LayerInfoType
miLayerInfoTypeNewTable
(continued)
Parameter
Required
AccessVersion
No
Type
String: Default: V2000. Valid options:
V9597, V2000.
Note: This parameter only applies if
the table storage type is
Access.
For any LayerInfoType other than miLayerInfoTypeUserDraw or miLayerInfoTypeRaster, the
following options are also supported:
LayerInfoType
Parameter
Required
Type
Any other than miLayerInfoTypeUserDraw or miLayerInfoTypeRaster
AutoCreateDataset
No
Numeric: if 1, then a Dataset of type
miDatasetLayer is added after the layer
is added. If 0 (the default), no Dataset is
added.
Any other than miLayerInfoTypeUserDraw or miLayerInfoTypeRaster
DatasetName
No
String: If the AutoCreateDataset parameter is 1, then this will be the name of the
new Dataset. If not specified, a default
name is used.
The following parameter can be used with any type of LayerInfoType:
LayerInfoType
Any
Parameter
Required
Visible
No
Type
Bool: Specifies if layer should be visible
when added.
Default: true
Remarks
To improve performance, you can specify the TableStorageType as “memtable”.
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a
layer name (as in the “name” parameter of the Layers.AddServerLayers,
Layers.AddUserDrawLayer, and Layers.Add), an exception will be thrown if the name is not
unique.
miLayerInfoTypeTemp is a temporary layer that lasts until the MapX control is closed, then the
layer is discarded. It is never saved to disk. One may specify a layer name, but not a filespec.
miLayerInfoTypeNewTable is a layer that can be generated from external data (i.e., query results).
For miLayerInfoTypeTemp and miLayerInfoTypeNewTable:
•
Either a Fields collection or a Features collection is required; both can be used.
•
If only a Features collection is passed, MapX will try to get the column information from the
table the Features came from.
•
If a Features collection and a Fields collection are passed, MapX will try to match the field
names passed in with the columns found in the table the Features came from.
•
If only a Fields collection is passed, check the layer for a Dataset of type miDatasetLayer.
If found, check the passed-in Fields against the columns in the miDatasetLayer. If the
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
274
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
miDatasetLayer Dataset isn't present, create the table solely on the Fields information
passed in.
•
The Fields default should be columns found in the Features collection's source table.
When using the LayerInfo object to add a .tab that references a raster, remote table, etc, use
LayerInfo type miLayerInfoTypeTab. LayerInfo type LayerInfoTypeRaster is used specifically for
adding self-registering raster files that do not have an associated .tab file. LayerInfo type
LayerInfoTypeServerLayer is used specifically for adding remote tables that do not have an
associated .tab file.
Object Properties
•
LayerInfo.Type property on page 275
•
LayerInfo.Parameter property on page 276
Object Methods
•
LayerInfo.AddParameter method on page 275
See Also
Layers.AddServerLayer method on page 264
Layers.AddUserDrawLayer method on page 265
Layers.Add method on page 263
Appendix A: MapX Field Naming Conventions
LayerInfo.Type property
Purpose
This is a read/write property whose value is one of the LayerTypeConstants
See Also
LayerInfo.AddParameter method on page 275
Layers.Add method on page 263
LayerInfo.AddParameter method
Purpose
The Addparameter method adds to the set of parameters required for a given call to the
Layers.Add method. The necessary parameters are determined by the type property of the
LayerInfo object.
Syntax
OBJECT.AddParameter (name, value)
Part
Description
OBJECT
This represents a LayerInfo object.
name
The name of the parameter.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
275
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
value
Description
The value of the parameter.
Remarks
Duplicate layer names are no longer allowed in MapX. When a developer explicitly specifies a
layer name (in a layerinfo “name” parameter, addserverlayer, or adduserdrawlayer), an exception
will be thrown if the name is not unique.
See Also
Layers.Add method on page 263
LayerInfo.Parameter property
Purpose
This read/write property takes an argument, which is a string representing the parameter’s name.
When retrieved, the Parameter property returns a variant whose type is whatever the type was
when the parameter was inserted. You can also set, add, insert, or modify parameters with this
property.
Example
To get the value of an existing parameter (e.g., CoordSys) do the following:
Set oCoordSys = oLayerInfo.Parameter("CoordSys")
To modify an existing or add a new parameter (e.g., Style), use method AddParameter or use the
Parameter property as follows:
Set oLayerInfo.Parameter("Style") = Map1.Layers("MyLayer").Style
Note:
Set is only used when setting objects. Other properties such as strings or numbers do not
require the Set statement.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
276
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Legend Object
Purpose
Each Theme object has a Legend object (Theme.Legend). The Legend object contains properties
to control the display of a theme's legend. Each ThemeCategory object (RangeCategory,
IndividualValueCategory, or MultiVarCategory) has an entry in the legend contained in a
LegendText object.
Object Properties
•
Legend.BodyTextStyle property
•
Legend.Compact property
•
Legend.CompactTitle property
•
Legend.CompactTitleStyle property
•
Legend.CurrencyFormat property
•
Legend.Height property
•
Legend.Left property
•
Legend.LegendTexts property
•
Legend.PaperHeight property
•
Legend.PaperWidth property
•
Legend.ShowCount property
•
Legend.ShowEmptyRanges property
•
Legend.SubTitle property
•
Legend.SubTitleStyle property
•
Legend.Title property
•
Legend.TitleStyle property
•
Legend.Top property
•
Legend.Visible property
•
Legend.Width property
Object Methods
•
Legend.ExportLegend method
•
Legend.LegendDlg method
•
Legend.PrintLegend method
Legend.BodyTextStyle property
Purpose
This is a Style object which controls the text style for the legend body and may be set to an
existing Style object or you may set the style properties individually.
See Also
Style Object on page 356
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
277
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Legend.Compact property
Purpose
Controls whether the legend is compact (1 line) or full sized. This is a Boolean value, and defaults
to the setting of Map.PreferCompactLegends.
See Also
Map.PreferCompactLegends property on page 307
Legend.CompactTitle property
Purpose
Contains the compact legend title text string. This is displayed when the legend is compact sized.
This is a String value, and a default title is created when the thematic map is created.
Legend.CompactTitleStyle property
Purpose
This is a Style object which controls the text style for the compact title. This is a Style object and
may be set to an existing style object or you may set the style properties individually.
See Also
Style Object on page 356
Legend.CurrencyFormat property
Purpose
Controls whether numbers are displayed using a currency format or a standard number format.
This is a Boolean value, and defaults to False.
Legend.ExportLegend method
Purpose
Exports an image of the Legend to a file or to the clipboard.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
278
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Format
Description
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 method on page 298
Legend.Height property
Purpose
Contains the height of the legend in screen units. This is a Single value, and is a read-only
property.
Legend.Left property
Purpose
Contains the position of the left edge of the legend in screen units, relative to the upper left corner
of the map control. This is a Single value.
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.
Legend.LegendDlg method
Purpose
Presents a dialog where the user can adjust legend settings (altering the property values of the
legend object through a user interface). If the user clicks 'OK', the changes made within the dialog
will immediately be applied to the map.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
279
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
The return value of LegendDlg is True if the user clicked OK and False if the user clicked Cancel.
Legend.LegendTexts property
Purpose
A collection of Legendtext objects for the legend. Ranged, Individual Value, Pie, Bar and Dot
Density themes have one LegendText item per category. Graduated Symbol has three.
See Also
LegendText Object and LegendTexts Collection on page 283
Legend.PaperHeight property
Purpose
Contains the paper height of the legend in Map.PaperUnit units. This is a Single value, and is a
read-only property.
See Also
Map.PaperUnit property on page 307
Legend.PaperWidth property
Purpose
Contains the paper width of the legend in Map.PaperUnit units. This is a Single value, and is a
read-only property.
See Also
Map.PaperUnit property on page 307
Legend.PrintLegend method
Purpose
Prints the legend in the specified rectangle to the specified device context.
Syntax
OBJECT.PrintLegend (hDC, x, y, w, h)
Part
Description
OBJECT
Represents a Legend 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
280
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
h
Description
Height in HIMETRIC units.
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.
Legend.ShowCount property
Purpose
Controls whether or not to show on the legend the count portion of the ranges. This takes a
Boolean value, and the default is True.
Legend.ShowEmptyRanges property
Purpose
This is a read/write Boolean property that determines whether empty ranges (ranges that do not
contain any features) are displayed in the legend. The default is False.
Legend.SubTitle property
Purpose
This is a read/write string value that contains the legend subtitle text string. This is displayed when
the legend in normal sized. A default subtitle is created when the thematic map is created.
Legend.SubTitleStyle property
Purpose
This returns a read/write style object which controls the text style for the legend subtitle. This is a
Style object and may be set to an existing style object or you may set the style properties
individually.
See Also
Style Object on page 356
Legend.Title property
Purpose
Contains the legend title text string. This is displayed when the legend is of normal size. This is a
String value. A default title is created when the thematic map is created.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
281
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Legend.TitleStyle property
Purpose
This is a Style object which controls the text style for the title. This is a Style object and may be set
to an existing style object or you may set the style properties individually.
See Also
Style Object on page 356
Legend.Top property
Purpose
This property contains the position of the top edge of the legend in screen units, relative to the
upper left corner of the map control. This is a Single value.
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.
Legend.Visible property
Purpose
Controls whether the legend is visible or not. This is a Boolean value, and the default is True.
Legend.Width property
Purpose
Contains the width of the legend in screen units. This is a Single value, and is a read-only
property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
282
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
LegendText Object and LegendTexts Collection
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.
•
miThemeRanged has one LegendText per range (per RangeCategory).
•
miThemeIndividualValue, miThemePieChart, and miThemeBarChart have
oneLegendText per category (per IndividualValueCategory or per MultiVarCategory).
•
miGradSymbol has three LegendTexts—one for each sample size.
•
miDotDensity has one LegendText.
Object Properties
•
LegendText.Text property
•
LegendText.Visible property
Collection Properties
•
LegendTexts.AllOthersText property
•
LegendTexts.AutoGenerate property
•
LegendTexts.Count property
•
LegendTexts.Item property
See Also
Theme Object and Themes Collection on page 374
LegendTexts.AllOthersText property
Purpose
This returns a LegendText object from a collection. This LegendText object is associated with the
AllOthersCategory property of either the RangeCategories collection or IndividualValueCategories
collection. You can set the properties of the AllOthersText property like any other LegendText
object.
LegendText.Text property
Purpose
Contains the text for a range or category in a legend. This is a String value, and a default is set
when the thematic map is created. The legend text is automatically recomputed whenever the
Theme object is recomputed (for example, number of ranges changed to 6), unless the
LegendTexts.AutoGenerate property is set to False.
See Also
Theme Object and Themes Collection on page 374
Theme.AutoRecompute property on page 374
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
283
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
LegendText.Visible property
Purpose
Controls whether ranges are visible for the legend. This takes a Boolean value, and the default is
True.
LegendTexts.AutoGenerate property
Purpose
Controls whether the LegendText values should be re-computed by MapX when the Theme object
is recomputed. This is a Boolean value, and the default is True. If you are going to modify the
LegendText values, you should set this to False, so MapX doesn't override your changes.
See Also
Theme.AutoRecompute property on page 374
LegendTexts.Count property
Purpose
The number of LegendText objects in the collection. This is a read-only property.
LegendTexts.Item property
Purpose
Retrieve a particular LegendTexts object from a collection. You must specify the text string.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
284
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.DynamicSelectionSupport property
•
Map.EditableLabels 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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
285
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
•
Map.MouseWheelSupport property
•
Map.NumericCoordSys property
•
Map.PanAnimationLayer property
•
Map.PaperUnit property
•
Map.PreferCompactLegends property
•
Map.RedrawInterval property
•
Map.ReuseEquivalentOnRestore property
•
Map.Rotation property
•
Map.SearchPath property
•
Map.SelectionStyle property
•
Map.SnapTolerance property
•
Map.SnapToNodeSupport property
•
Map.Title property
•
Map.TitleText property
•
Map.Version property
•
Map.WaitCursorEnabled property
•
Map.Zoom property
Object Methods
•
Map.AboutBox method
•
Map.ClipLine method
•
Map.CliplineV method
•
Map.ConvertCoord method
•
Map.ConvertCoordP method
•
Map.ConvertCoordV method
•
Map.CreateCustomTool method
•
Map.Distance method
•
Map.ExportMap method
•
Map.IsPointVisible method
•
Map.MilitraryGridReferenceFromPoint method
•
Map.MilitaryGridReferenceToPointV method
•
Map.MilitaryGridReferenceToPoint method
•
Map.Pan method
•
Map.PrintMap method
•
Map.PropertyPage method
•
Map.Refresh method
•
Map.SetSize method
•
Map.ZoomTo method
See Also
Dataset Object and Datasets Collection on page 161
Layer Object and Layers Collection on page 239
Annotation Object and Annotations Collection on page 142
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
286
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.AboutBox method
Purpose
This displays the About Box, which contains information such as the version of MapX and proper
credits.
Syntax
OBJECT.AboutBox
Map.Annotations property
Purpose
A collection of annotations for the map.
See Also
Annotation Object and Annotations Collection on page 142
Map.AreaUnit property
Purpose
This is the units used in Area methods/properties. It takes an AreaUnitConstants value. Default is
miUnitSquareMile.
Map.AutoRedraw property
Purpose
This temporarily turns off screen updating. It takes a Boolean value and is a read/write property.
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.
Map.BackColor property
Purpose
This property controls what color the background of the map is 'erased' with before drawing the
map. You must 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.)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
287
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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
Appendix L: OLE_COLOR Values
Map.Bounds property
Purpose
The Map.Bounds property (which was called Map.MBR in earlier versions) enables you to set the
bounds of the map window in map coordinates. It takes a Rectangle object.
See Also
Rectangle Object on page 332
Map.CenterX property
Purpose
This property sets the current X coordinate for the center of the map. This property is a double
representing the longitude (negative values for the Western hemisphere).
Remarks
The CenterX property is set when a new Geoset is loaded.
See Also
Map.CenterY property on page 288
Map.ZoomTo method on page 313
Map.CenterY property
Purpose
This property sets the current Y coordinate for the center of the map. This property is a double
representing the latitude.
Remarks
The CenterY property is set when a new Geoset is loaded.
See Also
Map.CenterY property on page 288
Map.ZoomTo method on page 313
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
288
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.ClipLine method
Purpose
This method accepts parameters representing the endpoints of an imaginary line on the map. If
any portion of the line falls within the view rectangle, ClipLine will adjust the parameters so that
none of the resulting line falls outside of the view rectangle.
Syntax
[Boolean=]OBJECT.ClipLine (X1, Y1, X2, Y2)
Part
Description
OBJECT
Represents a Map object.
X1
Double (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
Double (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
Double (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
Double (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.
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 on page 290
Layers.AddUserDrawLayer method on page 265
Map.NumericCoordSys property on page 306
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
289
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.CliplineV method
Purpose
This method accepts parameters representing the endpoints of an imaginary line on the map. If
any portion of the line falls within the view rectangle, ClipLineV will adjust the parameters so that
none of the resulting line falls outside of the view rectangle. It is identical to the Map.ClipLine
method, except that it has Variant parameters rather than double parameters.
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 on page 289
Map.NumericCoordSys property on page 306
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
290
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.ConvertCoord method
Purpose
Converts map coordinates to screen display coordinates or screen coordinates to map
coordinates depending on the Dir parameter passed in the method. Screen coordinates are
specified in pixels.
Syntax
OBJECT.ConvertCoord (ScreenX, ScreenY, MapX, MapY, Dir)
Part
Description
OBJECT
Represents a Map object.
ScreenX
Screen x coordinate in pixels. Single value.
ScreenY
Screen y coordinate in pixels. Single value.
MapX
Map x coordinate (longitude). Double value.
MapY
Map y coordinate (latitude). Double value.
Dir
Direction to convert coordinates, either from Map to Screen, or Screen to Map.
This takes a ConversionConstants value.
Either the Screen coordinates or the Map coordinates are provided, and the others are filled out
based on the Dir specified.
Map.ConvertCoordP method
Purpose
The method takes a screen/map X and Y and a direction (miScreenToMap or miMapToScreen)
and returns a Point whose X and Y properties correspond to the converted map/screen
coordinates.
Syntax
Object.ConvertCoordP(X, Y, Dir)
Part
Description
X
Variant: This is the screen/map coordinate X.
Y
Variant: This is the screen/map coordinate Y.
Dir
Direction to convert coordinates, either from Map to Screen, or Screen to Map.
This takes a ConversionConstants value.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
291
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.ConvertCoordV method
Purpose
Converts map coordinates to screen display coordinates or screen coordinates to map
coordinates depending on the Dir parameter passed in the method. Variant version of
ConvertCoord method. Screen coordinates are specified in pixels.
Syntax
OBJECT.ConvertCoordV (ScreenX, ScreenY, MapX, MapY, Dir)
Part
Description
OBJECT
Represents a Map object.
ScreenX
Screen x coordinate in pixels. Variant value.
ScreenY
Screen y coordinate in pixels. Variant value.
MapX
Map x coordinate (longitude). Variant value.
MapY
Map y coordinate (latitude). Variant value.
Dir
Direction to convert coordinates, either from Map to Screen, or Screen to Map. This
takes a ConversionConstants value.
Either the Screen coordinates or the Map coordinates are provided, and the others are filled out
based on the Dir specified.
Map.CreateCustomTool method
Purpose
This creates a custom tool, that when used, sends a ToolUsed event.
Note:
If you create a Custom Tool of type circle and in the ToolUsed 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
OBJECT
Represents a Map object.
ToolNumber
Number of the tool used to reference it later. This value can be an integer between 1
and 999.
Type
The type describes the tool behavior. This takes a ToolTypeConstants value.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
292
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
Cursor
Cursor shape when the tool created is the CurrentTool and the cursor is over the map.
This takes a CursorConstants value -OR- a custom cursor file name.
ShiftCursor
Variant: A CursorConstants value, indicating the cursor that should appear while the
SHIFT key is held down. Optional. If omitted, the SHIFT key has no effect on the cursor.
CtrlCursor
Variant: A CursorConstants value, indicating the cursor that should appear while the
CTRL key is held down. Optional. If omitted, the CTRL key has no effect on the cursor.
InfoTips
Boolean: Set to true if you want to show InfoTips. Default value is false.
Remarks
Custom tools can be created to build tools that perform specialized behavior. For example, a tool
could be built to have the behavior of displaying information about the object that was clicked on.
Here, we would define a tool of type miToolTypePoint, and in the ToolUsed event handler, write
code to display information about the object that falls under the point that was clicked on (using
Layer.SelectByPoint).
See Also
Map.CurrentTool property on page 293
Map.CurrentTool property
Purpose
This property sets the current tool. This takes a ToolConstants value. The default is miArrowTool.
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 on page 292
Map.Dataset property
Purpose
This property specifies a Dataset to add. This only works at Design time - not at Run time. This
property is for use in Microsoft Visual Basic only.
Note:
This method is not available in MapX Mobile.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
293
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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 on page 167
Map.DatasetGeoField property on page 294
Map.DatasetGeoField property
Purpose
This property specifies which field of the Dataset specified in the Map.Dataset property contains
the geographic information. This is a String specifying the field name.
Note:
This method is not available in MapX Mobile.
Remarks
This is similar to the GeoField parameter of the Datasets.Add method, but specifying the GeoField
for the Dataset specified at Design time.
See Also
Map.Datasets property on page 294
Datasets.Add method on page 167
Map.Datasets property
Purpose
The Datasets collection for the map.
See Also
Dataset Object and Datasets Collection on page 161
Map.DatasetTheme property
Purpose
This property specifies the theme type for the Dataset specified by the Map.Dataset property. This
takes a ThemeTypeConstants value. This defaults to miAutoThemeType.
Note:
This method is not available in MapX Mobile.
Remarks
If you are specifying a Dataset at Design time (Map.Dataset property), then you can have that data
thematically mapped. This controls the theme style. This is similar to the Themes.Add method, but
is available at Design time. You can choose which field or fields to base your theme on in the
MapX Theme tab of the property page.
The DatasetTheme property is ignored if the Dataset property is not set.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
294
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Themes.Add method on page 378
Map.Datasets property on page 294
Map.DefaultConversionResolution property
Purpose
A read/write system setting that controls the resolution (i.e., the number of nodes) used when
converting special MapInfo feature types, such as arcs, into regions or polylines, or when
generating circles, ellipses, arcs or buffers. It is a long integer which can take on any value
between 3 and 32,763.
Remarks
Various methods (listed below) allow you to explicitly specify an optional resolution parameter. If
you do not specify a resolution value, MapX uses the resolution setting specified by the
DefaultConversionResolution property.
This property affects the generation of buffers, circles, ellipses, and arcs. When generating these
types of features, you can control the resolution (sometimes called the “smoothness”) of the
features. For example, the following table shows two different circular regions-one containing 10
nodes, and the other containing 30 nodes.
Circular region with 10 nodes
Circular region with 30 nodes
Increasing the resolution produces a smoother looking region; however, such regions take longer
to generate, and the resulting object requires more storage space.
This property also controls the resolution used when a MapInfo table contains an arc, circle,
rectangle, or rounded rectangle feature, and MapX converts the feature into a region or polyline.
See Also
FeatureFactory.BufferFeatures method on page 189
FeatureFactory.CreateArc method on page 191
FeatureFactory.CreateCircularRegion method on page 193
FeatureFactory.CreateEllipticalRegion method on page 195
Layer.SearchWithinDistance method on page 257
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
295
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.DefaultStyle property
Purpose
This is a Style object that has the style for both symbol and text objects when they are created by
using the Annotation.AddSymbol or Annotation.AddText methods.
See Also
Style Object on page 356
Map.DisplayCoordSys property
Purpose
This returns a read-write CoordSys object (coordinate system) that controls how the map is
displayed.
Note:
If a map includes one or more raster image layers, MapX automatically displays the map
in the projection specified by the most visible raster image. The coordinate system could
then change as the map view changes (due to zooming or panning) if a different raster
image with a different projection becomes the most visible. In this case, you cannot
change the map's display coordinate system.
Remarks
The Map.DisplayCoordSys represents the coordinate system (or “projection”) in which the map is
displayed. By default, the map's coordinate system is set by the geoset. By modifying the map's
DisplayCoordSys (through the CoordSys.Set method), you can display the map in another
coordinate system.
The Map.DisplayCoordSys property only affects the appearance of the map. To access the
coordinate system used to interpret or return map coordinates, use the Map.NumericCoordSys
property.
See Also
Chapter 11: Using Coordinate Systems
CoordSys Object on page 156
Map.NumericCoordSys property on page 306
Map.Distance method
Purpose
This computes the distance between two specified points on the map. The distance is returned as
a double, in the units specified by the MapUnit property.
Syntax
[distance =]OBJECT.Distance(x1,y1,x2,y2)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
296
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
OBJECT
Represents a Map object.
x1
x coordinate of the first point (longitude). Double value.
y1
y coordinate of the first point (latitude). Double value.
x2
x coordinate of the second point (longitude). Double value.
y2
y coordinate of the second point (latitude). Double value
Remarks
The distance is calculated using the Great Circle Calculation.
See Also
CoordSys Object on page 156
Map.NumericCoordSys property on page 306
Map.MapUnit property on page 302
Map.DynamicSelectionSupport property
Purpose
This boolean property controls whether or not Dynamic Selection is enabled. When True the user
will see selection highlighting added to the map while the Radius Select and Rectangle Select
tools are being used. When False selection highlighting is not drawn until the user releases the
mouse button when using the Radius Select and Rectangle Select tools.
Remarks
This property is false by default. It will affect only rectangle and radius selection tools. The
behavior of the tools themselves are the same.
Map.EditableLabels property
Purpose
This is a boolean property on the Map object. Setting it to true allows the labels to be selected and
moved via the user interface with the MapX Select tool (miSelectTool). Setting it to false disables
editing via the user interface.
Remarks
The Labels Collection can always be used to edit labels programatically regardless of the value of
Map.EditableLabels. Map.EditableLabels controls whether users can edit labels (select and move)
using the Select Tool.
The LabelChanged event is fired when this property is True and the user uses the Select tool to
select or move labels
See Also
Label Object and Labels Collection on page 228
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
297
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.ExportMap method
Purpose
This method is used for exporting map images. MapX for the desktop is capable of exporting to the
following formats (see note if using MapX Mobile):
JPG
TIF
GIF
PNG
WMF
PSD
BMP
Note:
If using MapX Mobile, you may only export in BMP. Attempting to export in alternative
formats will generate an error.
Syntax
OBJECT.ExportMap (Location, Format, [Width], [Height])
Part
Description
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.
Note: if using MapX Mobile, you may only paste a map in BMP format to the given
location.
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.
Note: If using MapX Mobile, this parameter is ignored so the size of the exported
map is the same size as the hand held device’s screen.
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.
Note: if using MapX Mobile, this parameter is ignored so the size of the exported map
is the same size as the hand held device’s screen.
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 on page 299
Map.PaperUnit property on page 307
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
298
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.ExportSelection property
Purpose
This returns or sets a Boolean property, controlling whether the selection's highlighting is included
in output.
If set to True, output produced by the Map.ExportMap method or the Map.PrintMap method will
include any current selection highlighting. If set to False, output will not include the highlighting.
To control the style in which the selection highlighting is drawn, set the Map.SelectionStyle
property.
See Also
Map.ExportSelection property on page 299
Map.PrintMap method on page 307
Map.SelectionStyle property on page 311
Map.FeatureEditMode property
Purpose
This property controls the edit mode of the map (i.e., feature editing (miEditModeFeature) or node
editing (miEditModeNode)). Node Editing can be masked with other node operations when set to
one of the FeatureEditModeConstants. The default for this property is miEditModeFeature.
Map.FeatureFactory property
Purpose
This returns a FeatureFactory object, which supports various methods for creating and modifying
features on the map.
Remarks
This property returns a FeatureFactory object, which has methods that support various editing
tasks-creating features, generating buffer regions, combining features, and testing for
intersections between features.
See Also
FeatureFactory Object on page 189
Map.GeoDictionary property
Purpose
This read-only property specifies the location of a registry entry which is used to determine the
GeoDictionary file and the default data directory.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
299
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
When a map control is created, MapX will query the registry key:
HKEY_LOCAL_MACHINE\Software\MapInfo\MapX\5.0\<Value of GeoDictonary Property>
The value of this registry key specifies two things:
•
The GeoDictionary file, which maintains information about which map layers can be
matched to which information. (MapX can be used without a GeoDictionary.)
•
The default data directory. This directory is searched for GeoSet files (*.gst) which are
shown in the Property Pages and the Map.GeoSets collection.
There are three valid options for the registry value:
•
Full file spec for the Geodictionary file (e.g., “C:\Program Files\MapInfo
MapX\Maps\geodict.dct”). The data directory is set to be the path leading to the
Geodictionary file named by this key (in this example, “C:\Program Files\MapInfo
MapX\Maps\”. The in-memory geodictionary is initialized from the Geodictionary file and
layers contained in the Geodictionary can be automatically matched against it too. Layers
added to the map are added to the in-memory geodictionary so they can be auto matched
against.
•
Path specification (e.g., “C:\Program Files\MapInfo MapX\Maps\”). The data directory is
set to this directory. The in-memory geodictionary is initialized empty. Layers added to the
map are still added to the in-memory geodictionary so they can be auto matched against.
•
Empty. The in-memory geodictionary is initialized empty. Layers added to the map are
still added to the in-memory geodictionary so they may be auto matched.
The default value of Map.GeoDictionary is “GeoDictionary”, meaning that MapX will query the
registry entry HKEY_LOCAL_MACHINE\Software\MapInfo\MapX\5.0\GeoDictionary.
See Also
Map.GeoSet property on page 300
Map.GeoSet property
Purpose
This read/write property sets the GeoSet. It returns a String Value. To set this property, the
filespec (entire path) or the `friendly name' of the GeoSet is used.
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.
Map.GeoSets property
Purpose
This read-only property returns a collection of Geoset objects. This collection consists of all
geosets in the Maps directory.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
300
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Geoset Object and Geosets Collection on page 222
Map.GeoSetWidth property
Purpose
A read-only property representing the width of the GeoSet (maximum width of all Layers in the
map). This is a double value in units specified by the MapUnit property.
This property is useful when you need to set the zoom to the extents of the map.
Map.hWnd property
Purpose
This is the handle to the window of the MapX control. Only valid at Run time. This is a read-only
property.
Map.InfotipSupport property
Purpose
This property allows the programmer to control whether or not MapX displays pop-up InfoTips. It is
a Boolean property, and defaults to True.
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 on page 301
Map.CreateCustomTool method on page 292
Map.InfotipPopupDelay property
Purpose
This property controls the duration of time the user needs to have the mouse pointer over an
object before an InfoTip is popped up. This property only applies when Map.InfotipSupport is True.
It is an Integer value, specified in Milliseconds. The default is 500.
See Also
Map.InfotipSupport property on page 301
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
301
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.IsPointVisible method
Purpose
This returns true or false whether the point (in map coordinates) is currently within the visible
portion of the map window.
Syntax
[bool=] OBJECT.IsPointVisible (X, Y)
Part
Description
OBJECT
Represents a Map object.
X
Map Coordinates for east/west position (latitude).
Y
Map Coordinates for north/south position (longitude).
Map.Layers property
Purpose
The Layers collection for the map.
See Also
Layer Object and Layers Collection on page 239
Map.MapUnit property
Purpose
This property sets the units used for distance calculations. Takes a MapUnitConstants value. The
default unit is miUnitMile.
Map.MapPaperHeight property
Purpose
The height of the map control. This is a double value specified in terms of Paper Units
(Map.PaperUnit.). It is a read-only property.
Map.MapPaperWidth property
Purpose
The width of the map control. This is a double value specified in terms of Paper Units
(Map.PaperUnit.). It is a read-only property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
302
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.MapScreenHeight property
Purpose
The MapScreenHeight and MapScreenWidth properties make it easy to position legends. These
properties contain the width and height of the map control, in pixels. Since legends also contain
their width and height, in pixels, it is easy to position legends.
Map.MapScreenWidth property
Purpose
The MapScreenHeight and MapScreenWidth properties make it easy to position legends. These
properties contain the width and height of the map control, in pixels. Since legends also contain
their width and height, in pixels, it is easy to position legends.
Map.MatchNumericFields property
Purpose
This property controls matching on numeric and date fields. This property appears on the Data
(design time) property page. If MatchNumericFields is true, then numeric fields are considered
candidate keys (along with the alpha/numeric or date fields) when MapX is auto-matching. If it is
false, then numeric columns are not considered when performing auto-matching. By default this
property is false.
If you specify a date or numeric GeoField in Datasets.Add, MapX will use it whether or not
MatchNumericFields is TRUE.
Map.MatchThreshold property
Purpose
This is the minimum threshold percentage required for matching a map layer with a data source.
The default = 80.
Map.MaxSearchTime property
Purpose
This property sets the search time for automatic GeoColumn detection and the automatic GeoSet
detection when bringing in data using Datasets.Add. This is an Integer value specifying time in
Seconds. The default time is 30 seconds.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
303
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.MilitraryGridReferenceFromPoint method
Purpose
This method takes a XY point from a map's numeric coordinate system and converts it to a Military
Grid Reference System (MGRS) point.
Syntax
[strPoint=]OBJECT.MilitaryGridReferenceFromPoint (dblX, dblY)
Part
Description
strPoint=
This return value is the converted point. It is a string.
OBJECT
This represents a map object.
dblX
This double value represents the X coordinate point to be converted.
dblY
This double value represents the Y coordinate point to be converted.
Map.MilitaryGridReferenceToPointV method
Purpose
This method converts a Military Grid Reference System MGRS point to a XY point in Map's
numeric coordinate system. This method returns boolean and returns x,y values in variants
Syntax
[bool=] OBJECT.MilitaryGridReferenceToPointV (strMGRS, vX, vY)
Part
Description
bool=
This return value is the converted point. It is a string.
OBJECT
This represents a map object.
strMGRS
This string value represents the MGRS point to be converted.
vX
Variant: This represents the converted X coordinate point.
vY
Variant: This represents the converted Y coordinate point.
Map.MilitaryGridReferenceToPoint method
Purpose
This method converts a Military Grid Reference System MGRS point to a XY point in Map's
numeric coordinate system.
Syntax
[bool=] OBJECT.MilitaryGridReferenceToPointV (strMGRS, dblX, dblY)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
304
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
bool=
This return value is the converted point. It is a string.
OBJECT
This represents a map object.
strMGRS
This string value represents the MGRS point to be converted.
dblX
This double value represents the converted X coordinate point.
dblY
This double value represents the converted Y coordinate point.
Map.MouseIcon property
Purpose
If you need to specify a customized cursor for the mouse icon with the Map.MousePointer
property, use the Map.MouseIcon property. The Map.MouseIcon property lets the programer
specify a custom cursor to use as the default mouse cursor in MapX with a string which specifies
either the full specification path (including the name of the file), or, the custom mouse cursor. The
name must specify either a .cur, .ico, or .ani file type. If the specified cursor can not be loaded, an
exception is thrown.
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 on page 306
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
305
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
CursorConstants on page 451
Map.MousePointer property
Purpose
This property sets the shape of the mouse cursor. This takes a CursorConstants value. The
default is miDefaultCursor, which means that the cursor of the current tool will be used.
Remarks
If Map.MousePointer is set to miCustomCursor (40) and Map.MouseIcon has not been set yet,
then the cursor will be drawn with the shape of miDefaultCursor.The MousePointer property will
still have a value of miCustomCursor.As soon as the Map.MouseIcon is properly set, then the new
cursor shape will be used.
Map.MouseWheelSupport property
Purpose
Controls the level of Intellimouse support: None, Zoom/Scroll only (no Autscroll), or Full. This
property is set with a MouseWheelSupportConstants.
Map.NumericCoordSys property
Purpose
This returns a read-write CoordSys object (coordinate system) that controls how MapX interprets
numeric map coordinates.
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
Map.DisplayCoordSys property on page 296
Chapter 11: Using Coordinate Systems
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
306
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.Pan method
Purpose
This method will pan the map by the given offset in screen coordinates (pixels).
Syntax
OBJECT.Pan (ScreenX, ScreenY)
Part
Description
OBJECT
Represents a Map object
ScreenX
The amount to offset the horizontal screen coordinate.
ScreenY
The amount to offset the vertical screen coordinate.
Map.PanAnimationLayer property
Purpose
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.
Map.PaperUnit property
Purpose
This property sets the unit of measure MapX will use for the map on paper. Specify the unit of
measure by using the PaperUnitConstants. The default is miPaperUnitInch.
Map.PreferCompactLegends property
Purpose
This property sets whether or not to display a compact legend. This takes a Boolean value. The
default value is false.
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.
Map.PrintMap method
Purpose
Prints the map in the specified rectangle to the specified device context.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
307
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
h
Height in HIMETRIC units.
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.
Map.PropertyPage method
Purpose
The PropertyPage method allows the user to control or set various properties of the map object at
run-time. This is the same property page that is available in design mode, although, some
properties cannot be set at run-time using this method.
Note:
This method is not available in MapX Mobile.
Syntax
OBJECT.PropertyPage
Map.RedrawInterval property
Purpose
This property enables incremental drawing. It is the time, in 1/100ths of a second, between when
the display is updated with the off-screen bitmap. The minimum value is 10. A very high value
(e.g., 3000) effectively turns off incremental drawing -- the screen won't be updated until the map
is completely drawn off screen.
Remarks
Currently, the map is drawn to an off-screen bitmap, then transferred to the screen when the
bitmap is complete. Now, you can transfer to the screen more often to show the user that
something is indeed happening. (This is especially useful when drawing streets at 25 mile zoom.)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
308
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.Refresh method
Purpose
Forces the map to get redrawn immediately.
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 on page 287
Map.ReuseEquivalentOnRestore property
Purpose
This is a Boolean property that defaults to True.
When the value of this property is False and the Datasets collection or Map object is being
restored from the State object, MapX discards all existing datasets and restores new ones when
restored from a State object. To completely restore each dataset, Datasets.Restore must also be
called to supply the external source (e.g., ADO recordset.) of each dataset being restored.
When the value of this property is True and the Datasets collection or Map object is being restored
from the State object, MapX attempts to reuse existing datasets that are equivalent to the datasets
being restored. You must call Datasets.Item to find out if an equivalent dataset was found. If no
equivalent dataset is found, you must call Datasets.Restore to completely restore the dataset.
Remarks
This property is very useful in MapXtreme applications to speed up the process of restoring the
Map object state on each session request. Restoring a dataset can be an expensive operation
because MapX must bind and read all data from an external source (such as ADO.) Allowing
MapX to reuse a dataset that matches the one being restored bypasses having to bind and read
from an external source.
Setting the value of this property does not guarantee that MapX will find a matching dataset. For
example, if you have an ASP application that shares a MapX object between sessions, and the
application allows each session to add or remove a dataset, when each session restores its Map
state, the map might or might not have the dataset. If MapX does not find a matching dataset, you
must call Datasets.Restore to completely restore the dataset. You can find out if MapX found a
matching dataset by calling Datasets.Contains.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
309
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Keep in mind that if your external source changes frequently (e.g., while a session is active) you
might not want to reuse existing datasets. If the data does not change frequently, you can start
with a new dataset on the first session request and then allow MapX to reuse existing datasets, if
present, during subsequent session requests.
See Also
State Object on page 349
Datasets.Contains method on page 169
Map.Rotation property
Purpose
This property sets the rotation of the map. Rotation values are specified in degrees, increasing
clockwise, with 0 indicating an unrotated map. Applying a rotation to a map does not change its
zoom level or center point.
Note:
A map containing one or more raster layers cannot be rotated, because MapX is unable to
rotate raster images.
Map.SaveMapAsGeoset method
Purpose
This creates a geoset file representing the current status of the map (layer information, labeling
settings, etc.).
Syntax
OBJECT.SaveMapAsGeoset (name, filespec)
Part
Description
OBJECT
A Map object.
name
String that represents the geoset's “friendly” name (the description that appears in the
Geodictionary). If you specify an empty string, the map's Title is used.
filespec
String that represents a full file path for the geoset file. If no path is specified, the new
file is placed in the data directory. If no extension is specified, the standard .gst extension is used. If the specified file already exists, it is overwritten.
Remarks
If the map contains any temporary layers, user draw layers, or remote layers added via
miLayerInfoTypeServer, those layers are left out of the new geoset file and an exception is thrown
(after the geoset has been saved). Remote layers added via .tab file are saved in the resulting
geoset. This method also throws an exception if there are no layers in the map. Also, shape
files(*.shp) can not be saved into a geoset.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
310
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.SearchPath property
Purpose
This property allows the user to set the search path dynamically. Essentially, a search path is an
"electronically plotted course" of the drive and directory(ies) to where information exists. Before a
programmer sets this property, the search path is initially read from the registry. The SearchPath
property is available at run-time only.
Map.SelectionStyle property
Purpose
This returns or sets a Style object, representing the style in which selected features are drawn.
Remarks
This property returns a read/write Style object that controls the appearance of selected features in
all layers.
To control the appearance of selected regions, set this Style object's RegionXXX properties, such
as RegionColor. The RegionColor and RegionBorderXXX properties are used to draw the box
around selected symbol features. The LineXXX properties are used to draw selected line features.
Note that the SymbolXXX and TextXXX properties do not apply and have no effect.
Note:
The "XXX" is a place holder for the various properties of the Style object that define a
region, line, etc.
Remarks
To omit the selection highlighting from output, set the Map.ExportSelection property to False.
See Also
Style Object on page 356
Map.ExportSelection property on page 299
Map.SetSize method
Purpose
This property sets the size of the control, in pixels.
Syntax
OBJECT.SetSize (W, H)
Part
Description
OBJECT
Represents a Map object.
W
The desired width of the control, in pixels.
H
The desired height of the control, in pixels.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
311
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.SnapTolerance property
Purpose
This property takes an integer between 1 and 50. Use SnapTolerance to specify a tolerance within
which Snap to nodes operates (i.e., the distance in pixels from the mouse cursor that a node must
be for the tool to "snap to" that node) . The default value is 5 pixels.
Remarks
When you are working in a Map window containing many closely positioned objects, you want a
fairly tight Snap tolerance (1, 2, or 3 pixels). This allows you to draw very close to a node without
snapping to it. When objects are more loosely positioned, you can have a looser tolerance. This
allows you to be farther away from a node and still snap to it.
See Also
Node Selecting and Editing in Chapter 12 on page 121
Map.SnapToNodeSupport property on page 312
Map.SnapToNodeSupport property
Purpose
When this boolean property is True, SnapToNode functionality is enabled. With snap to node
enabled a crosshair cursor appears when the mouse cursor is near a node in a selectable layer.
The tool you are using "snaps to" that node, allowing you to more easily use the current tool on
that node (for example, select the node using the select tool). You can determine how close the
cursor needs to be to a node before the crosshair appears by setting the Map.SnapTolerance
property.
Remarks
You may enact this feature by pressing 's' or 'S' key. (This character is defined in the MapX
resource, so that it can be changed on foreign platforms).
This functionality works with any of the MapX stock tools as well as any custom tools created by
your application. This functionality is especially useful when editing the nodes of a feature by
selecting and dragging them with the Select tool.
See Also
Map.SnapTolerance property on page 312
Node Selecting and Editing in Chapter 12 on page 121
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
312
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Map.Title property
Purpose
A Title object specifying the title for the map. This can be set to NULL for no title.
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.
Map.TitleText property
Purpose
This returns or sets a string that appears as the map's title. If you specify an empty string, the title
is hidden.
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 on page 313
Map.Version property
Purpose
This property specifies the version of MapX you are using. This is a String value, and is read-only.
Map.WaitCursorEnabled property
Purpose
This property allows you to turn the Wait Cursor on or off manually. Default is True.
Map.Zoom property
Purpose
Contains or sets the current zoom value for the map. The zoom value is defined as the width
across the map. This is a double value in the units specified by the MapUnit property.
Map.ZoomTo method
Purpose
Zooms and centers the map.
Syntax
OBJECT.ZoomTo (Zoom, x, y)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
313
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
OBJECT
Represents a Map object.
Zoom
The zoom value. MapX defines the zoom value as the width across the control. This is a
double value specified in terms of Map Units (MapUnit).
X
The x coordinate to center the map to. A double value representing the longitude.
Y
The y coordinate to center the map to. A double value representing the latitude.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
314
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
MultivarCategory Object and MultivarCategories Collection
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.
To obtain a MultivarCategories collection, reference the ThemeProperties.MultivarCategories
property.
Object Properties
•
MultivarCategory.Style property on page 315
Collection Properties
•
MultivarCategories.Count property on page 315
•
MultivarCategories.Item property on page 315
See Also
ThemeProperties.MultivarCategories property on page 384
LegendText Object and LegendTexts Collection on page 283
MultivarCategories.Count property
Purpose
This is a read-only integer value, indicating the number of variables used by the theme-the number
of bars in a thematic bar chart, or the number of wedges in a thematic pie chart.
MultivarCategories.Item property
Purpose
This returns one MultivarCategory object from the collection. This object describes the settings for
one of the thematic variables (e.g., one of the bars in a bar chart theme).
MultivarCategory.Style property
Purpose
This property controls the style for objects that fall within this MultivarCategory. This is a Style
object and may be set to an existing style object or you may set the style properties individually.
The defaults are designed to provide highly contrasting styles.
See Also
Style Object on page 356
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
315
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
NotesQueryInfo Object
Perform queries on a Notes Dataset by making a NotesQueryInfo object and using Dataset type 8
(miDatasetNotesQuery).
This Dataset type will allow the MapX user to ask Notes to perform queries upon a database at
run-time. To add a Dataset of this type to MapX, you will need to create a NotesQueryInfo object
and pass it to Datasets.Add.
Note:
This object and its properties are not yet available in MapX Mobile due to the fact that
MapX Mobile does not support remote connectivity.
Object Properties
•
NotesQueryInfo.BeginDate property
•
NotesQueryInfo.Database property
•
NotesQueryInfo.DefaultNumericValue property
•
NotesQueryInfo.DefaultStringValue property
•
NotesQueryInfo.EndDate property
•
NotesQueryInfo.FullTextSearch property
•
NotesQueryInfo.MaxNumDocs property
•
NotesQueryInfo.Query property
•
NotesQueryInfo.Server property
NotesQueryInfo.BeginDate property
Purpose
A string that defines a beginning cutoff date/time or a string that represents it (optional). Notes
modified before this date/time are ignored during the search.
NotesQueryInfo.Database property
Purpose
This is either a name of a Notes database on a server, or a path to a local Notes database (.nsf).
NotesQueryInfo.DefaultNumericValue property
Purpose
Because a Notes Query can return documents that do not contain all of the fields specified, MapX
will return a default numeric (double) if the requested numeric field is not found (optional). This
value defaults to 0.
See Also
Datasets.Add method on page 167
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
316
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
NotesQueryInfo.DefaultStringValue property
Purpose
Because a Notes Query can return documents that do not contain all of the fields specified, MapX
will return a default string if the requested string field is not found (optional). This value defaults to
"".
NotesQueryInfo.EndDate property
Purpose
A string that defines a end cutoff date/time or a string that represents it (optional). Notes modified
before this date/time are ignored during the search.
NotesQueryInfo.FullTextSearch property
Purpose
This is a Boolean value (TRUE or FALSE) that indicates both that the database will have a full text
index and that the Query property is a full-text search query.
See Also
NotesQueryInfo.Query property on page 317
NotesQueryInfo.MaxNumDocs property
Purpose
An integer which specifies the maximum number of Notes to be allowed in the results (optional). If
the input is zero, all notes that match the search criteria will collected.
NotesQueryInfo.Query property
Purpose
If the FullTextSearch property is set to TRUE, this property is a full-text search query string. If the
FullTextSearch property is FALSE, this property become a Notes search formula. See your Notes
database for information on how to form full-text search query or formula strings.
See Also
NotesQueryInfo.FullTextSearch property on page 317
NotesQueryInfo.Server property
Purpose
This is a string that defines which Notes server that the above database is on. This string is left
empty if the Database property refers to a local database.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
317
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
NotesQueryInfo.Database property on page 316
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
318
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
NotesViewInfo Object
The NotesViewInfo object is required for the second parameter to Datasets.Add for Datasets of
type miDatasetNotesView. This Dataset type will access a specified view of a Database.
Object Properties
•
NotesViewInfo.Database property
•
NotesViewInfo.Server
•
NotesViewInfo.View
See Also
Datasets.Add method on page 167
NotesViewInfo.Database property
Purpose
This read/write property is either a name of a Notes database on a server, or a path to a local
Notes database (.nsf).
NotesViewInfo.Server
Purpose
This read/write property is a string that defines which Notes server that the above database is on.
This string is left empty if the Database property refers to a local database.
NotesViewInfo.View
Purpose
This read/write property is a string that refers to the specific view within the database that the data
will be pulled from.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
319
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
OCIQueryInfo Object
An OCIQueryInfo object is passed into the Datasets.Add method as the source parameter if the
Dataset type is miDatasetOCI. This object contains information about how to connect to an OCI
data source and which records to treat as the record set.
When using an OCIQueryInfo object, one must ensure that the proper OCI dlls are installed. In
Visual Basic, choose Project > References. Click the Browse button to add references to
appropriate dlls. The dlls are installed in the MapX Program directory.
Note:
This object and its properties are not yet available in MapX Mobile due to the fact that
MapX Mobile does not support remote connectivity.
Object Properties
•
OCIQueryInfo.ConnectString property
•
OCIQueryInfo.Query property
See Also
Datasets.Add method on page 167
OCIQueryInfo.ConnectString property
Purpose
This property sets a string value that specifies the database you will connect to, the user you will
connect as, and a valid pass word if necessary.
Example
"SRVR=rock;UID=mapx;PWD=mapx"
OCIQueryInfo.Query property
Purpose
This property sets a string value that specifies a valid SQL Select statement.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
320
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ODBCQueryInfo Object
An ODBCQueryInfo object is passed into the Datasets.Add method as the source parameter if the
Dataset type is miDatasetODBC. This object contains information about how to connect to an
ODBC data source and which records to treat as the record set.
Note:
If you use the ODBCQueryInfo object, your project must reference MODBCDataset.DLL
("MapInfo ODBC Dataset Engine Library").
In Visual Basic, choose Tools > References (for VB 4) or Project > References (for VB 5). Click the
Browse button to add references to appropriate dlls. The dlls are installed in the MapX Program
directory.
Note:
This object and its properties are not yet available in MapX Mobile due to the fact that
MapX Mobile does not support remote connectivity.
Object Properties
•
ODBCQueryInfo.ConnectString property
•
ODBCQueryInfo.DataSource property
•
ODBCQueryInfo.SqlQuery property
See Also
Datasets.Add method on page 167
ODBCQueryInfo.ConnectString property
Purpose
This property sets the connect string to connect with an ODBC data source. For example, specify
"ODBC;". You can also include "uid=", "pwd=", or DLG=. If information is missing and needed, the
ODBC driver for the DataSource will prompt the user.
"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).
ODBCQueryInfo.DataSource property
Purpose
This property sets the name of the ODBC data source. If this property is left blank, ODBC will
prompt the user. ODBC DataSources are set up using the ODBC administrator, which can be
found in the Windows Control Panel.
ODBCQueryInfo.SqlQuery property
Purpose
This property specifies the SQL query string which is used to retrieve the rows and columns to
build a Dataset.
For example, specify "select * from USA".
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
321
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Parts Collection
A Parts collection is a grouping of Points collection objects. That is, each object of a Parts
Collection is made up of a Points Collection. A Parts collection has the normal Count, Item, and
Remove methods. The Add method takes a Source Points object and returns the Points object
added to the Parts collection (i.e., a new Points object is added to the Parts collection and the
points are copied from the Source Points collection).
Collection Properties
•
Parts.Count property
•
Parts.Item property
Collection Methods
•
Parts.Add method
•
Parts.Remove method
•
Parts.RemoveAll method
Parts.Add method
Purpose
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).
Syntax
OBJECT.Add(Points)
Points is the Points collection object you want to add.
Parts.Count property
Purpose
This property counts the number of items in collection.
Parts.Item property
Purpose
This property returns a Points collection object from Parts collection. This is a Variant and you
must specify the 1 based index number. This is the default property of the Parts collection.
Parts.Remove method
Purpose
This method removes a Points collection object from this collection.
Syntax
OBJECT.Remove (index)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
322
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Parts.RemoveAll method
Purpose
This method removes all Parts objects from the collection.
Syntax
OBJECT.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
323
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Point Object and Points Collection
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 Purpose
•
Points.GetXY method
•
Points.GetXYV method
•
Points.X method
•
Points.Y method
•
Points.Remove method
•
Points.RemoveAll method
Point.Offset method
Purpose
This method changes the position of a point by changing its coordinates.
Syntax
OBJECT.Offset(double deltaX, double deltaY)
Part
Description
OBJECT
Represents a Point object.
deltaX
The amount to add to the x coordinate.
deltaY
The amount to add to the y coordinate.
double
DeltaX and deltaY are values in the Map's Numeric Coordinate System.
See Also
Map.NumericCoordSys property on page 306
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
324
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Point.Set method
Purpose
This method sets the coordinates of a point.
Syntax
OBJECT.Set(double X, double Y)
Part
Description
OBJECT
Represents a Point object.
X
X is the x coordinate of the point.
Y
Y is the y coordinate of the point.
Point.X property
Purpose
This is the point's X coordinate. X and Y are values in the Map's numeric coordinate system.
See Also
Map.NumericCoordSys property on page 306
Point.Y property
Purpose
This is the point's Y coordinate. X and Y are values in the Map's numeric coordinate system.
See Also
Map.NumericCoordSys property on page 306
Points.Add method
Purpose
This method adds a point to the Points collection.
Syntax
[Point= ]OBJECT.Add(Point, [Position])
Part
Description
OBJECT
Represents a Points object.
Point
The Point object to add.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
325
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Position
Description
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.
Points.AddXY method Purpose
This method creates a new point with the given X and Y values and adds it to a Points collection.
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.
Points.Count property
Purpose
This is the number of items in a collection.
Points.Item property
Purpose
This property returns a Points collection object from Parts collection. This is a Variant and you
must specify the 1 based index number. This is the default property of the Parts collection.
Points.GetXY method
Purpose
This method returns the XY coordinates of a specified point in a Points collection.
Note:
This method is NOT available in MapX Mobile. To get the XY coordinates in MapX Mobile,
you must use the GetXYV method.
Syntax
OBJECT.GetXY(lIndex, dX, dY)
Part
OBJECT
Description
This is a Points collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
326
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
lIndex
long: This by reference value is the index of the point object.
dX
double: This by reference value is the X coordinate.
dY
double: This by reference value is the Y coordinate.
Points.GetXYV method
Purpose
This method returns the XY coordinates of a specified point in a Points collection as variants.
Syntax
OBJECT.GetY(lIndex, vX, vY)
Part
Description
OBJECT
This is a Points object.
lIndex
long: This by reference value is the index of the point object.
vX
variant: This by reference value is the X coordinate.
vY
variant: This by reference value is the Y coordinate.
Points.X method
Purpose
This method returns the X coordinates of a specified point in a Points collection.
Syntax
OBJECT.X(lIndex)
Parts
Description
OBJECT
This is a points object
lIndex
long: This by reference value is the index of the point object.
Points.Y method
Purpose
This method returns the Y coordinates of a specified point in a Points collection.
Syntax
OBJECT.Y(lIndex)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
327
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Parts
Description
OBJECT
This is a points object
lIndex
long: This by reference value is the index of the point object.
Points.Remove method
Purpose
This method removes a Point object from the collection.
Syntax
OBJECT.Remove (index)
Points.RemoveAll method
Purpose
This method removes all Point objects from the collection.
Syntax
OBJECT.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
328
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
RangeCategory Object and RangeCategories Collection
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
RangeCategories.AllOthersCategory property
Purpose
This returns one RangeCategory object from the collection; this object describes a category for all
ranges not in the ranged theme. The RangeCategory object returned with the AllOthersCategory
has Min and Max properties that are not defined and their default value is zero. However, you can
set its Style property as shown in the example below. The text that appears in the legend for the
AllOthersCategory range category object can be set with LegendTexts.AllOthersText property.
See Also
LegendTexts.AllOthersText property on page 283
RangeCategories.Count property
Purpose
This is a read-only integer value, indicating the number of ranges in the ranged theme.
RangeCategories.Item property
Purpose
This returns one RangeCategory object from the collection; this object describes a range in the
ranged theme.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
329
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
RangeCategory.Max property
Purpose
Contains or sets the maximum value for a range in a Ranged theme. This is a double value. An
initial value is set when the theme is created (Themes.Add) depending on the distribution method
(ThemeProperties.DistMethod):
•
If ThemeProperties.DistMethod is miEqualCountPerRange, miEqualRangeSize,
miNaturalBreak, or miStandardDeviation, a new value will be set each time the Theme
object is recomputed.
•
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.
See Also
ThemeProperties.DistMethod property on page 382
RangeCategory.Min property
Purpose
Contains or sets the minimum value for a range in a Ranged theme. This is a double value. An
initial value is set when the theme is created (Themes.Add) depending on the distribution method
(ThemeProperties.DistMethod):
•
If ThemeProperties.DistMethod is miEqualCountPerRange, miEqualRangeSize,
miNaturalBreak, or miStandardDeviation, a new value will be set each time the Theme
object is recomputed.
•
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.
See Also
ThemeProperties.DistMethod property on page 382
Themes.Add method on page 378
Theme.AutoRecompute property on page 374
RangeCategory.NumItems property
Purpose
NumItems is the number of features that fall into the range specified by the Min and Max
properties for this range category. This is an Integer value and is a read-only 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
330
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
RangeCategory.Style property
Purpose
Contains the Style for all objects within the Min and Max properties' range for the given
RangeCategory object. It may be set to an existing style object or you may set the Style properties
individually.
Note:
If you are using ranges for a theme and specifying range colors individually (i.e., per
range), ThemeProperties.SpreadBy must be set to miSpreadByNone.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
331
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Rectangle Object
Rectangle objects are used to specify the extents of an object. Several properties, such as
Map.Bounds, Feature.Bounds, and Layer.Bounds, are rectangle objects. A rectangle is defined by
its minimum and maximum X coordinates, and its minimum and maximum Y coordinates. For
geographic properties (such as Map.Bounds), these coordinates will be specified in terms of the
Map.NumericCoordSys. For methods relating to Windows (such as Style.DrawLineSample), the
properties of the Rectangle object will be in pixel values.
Object Properties
•
Rectangle.Height property
•
Rectangle.Width property
•
Rectangle.XMax property
•
Rectangle.XMin property
•
Rectangle.YMax property
•
Rectangle.YMin property
Object Methods
•
Rectangle.Offset method
•
Rectangle.Set method
Rectangle.Height property
Purpose
The height of the rectangle. The height is defined as Rectangle.YMax - Rectangle.YMin. This is a
read-only double property. To change the height of the rectangle, use the Rectangle.Set method.
Rectangle.Offset method
Purpose
Changes the position of a rectangle by changing its coordinates. This shifts the rectangle by
deltaX in the X direction and deltaY in the Y direction.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
332
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Rectangle.Set method
Purpose
This property sets the coordinates of a rectangle. Rectangle.Set will sort the parameters to ensure
that Rectangle.XMin <= Rectangle.XMax and Rectangle.YMin <= Rectangle.YMax. You're
allowed to pass parameters where x1 > x2 or y1 > y2.
Syntax
OBJECT.Set (x1, y1, x2, y2)
Part
Description
OBJECT
Represents a Rectangle object.
x1, y1
Double values, representing the coordinates of one corner of the rectangle.
x2, y2
Double values, representing the coordinates of the opposite corner of the rectangle.
Rectangle.Width property
Purpose
The width of the rectangle. The width is defined as Rectangle.XMax - Rectangle.XMin. This is a
read-only Double property. To change the width of the rectangle, use the Rectangle.Set method.
Rectangle.XMax property
Purpose
The coordinate of the left edge of the rectangle. It is a read-only double property. In order to
change the location of the rectangle, use the Rectangle.Set or Rectangle.Offset methods.
Rectangle.XMin property
Purpose
The coordinate of the right edge of the rectangle. It is a read-only double property. In order to
change the location of the rectangle, use the Rectangle.Set or Rectangle.Offset methods.
Rectangle.YMax property
Purpose
The coordinate of the top edge of the rectangle. It is a read-only double property. In order to
change the location of the rectangle, use the Rectangle.Set or Rectangle.Offset method.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
333
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Rectangle.YMin property
Purpose
The coordinate of the bottom edge of the rectangle. It is a read-only double property. In order to
change the location of the rectangle, use the Rectangle.Set or Rectangle.Offset method.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
334
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ResolveObject Object and ResolveObjects Collection
A ResolveObjects collection is passed as a parameter to the ResolveDataBindEx event. It is a
collection of the candidate layers which may be bound to when using automatic databinding.
Object Properties
•
ResolveObject.TableName property
•
ResolveObject.SourceMatch property
•
ResolveObject.TableMatch property
Collection Properties
•
ResolveObjects.Count property
•
ResolveObjects.Item property
ResolveObject.TableName property
Purpose
This property is used to set the name of table being resolved.
ResolveObject.SourceMatch property
Purpose
This is the percentage of source rows matching the table. Example: If the source data is 5 rows
and 4 match this value = 80.
ResolveObject.TableMatch property
Purpose
Percentage of map objects matching the source data. Example: If the source data is 5 rows and 4
match and the map has 50 objects then the value = 8.
ResolveObjects.Count property
Purpose
Number of items in collection.
ResolveObjects.Item property
Purpose
This returns a ResolveObject object from a collection. This is a Variant and you can specify the
name or 1 based index number. This is a default property of the ResolveObjects collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
335
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
RowValue Object and RowValues Collection
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 creatable 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.ReadOnly property
•
RowValue.Dataset property
•
RowValue.Field property
•
RowValue.Value property
Collection Properties
•
RowValues.Count property
•
RowValues.ReadOnly property
•
RowValues.Item property
Collection Methods
•
RowValues.Remove method
•
RowValues.Add method
•
RowValues.RemoveAll method
•
RowValues.Clone method
See Also
Layer.UpdateFeature method on page 261
Layer.AddFeature method on page 241
Feature.Update method on page 182
Dataset.RowValues property on page 164
RowValue.ReadOnly property
Purpose
This property determines whether or not the properties can be set on the object.
RowValue.Dataset property
Purpose
This property is used to specify which Dataset the value is for.
RowValue.Field property
Purpose
This property is used to specify the field in the Dataset that the value is for.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
336
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
RowValue.Value property
Purpose
This property is used to specify the value for the field.
RowValues.Count property
Purpose
This read-only property specifies the number of rows in the RowValues collection.
RowValues.ReadOnly property
Purpose
This read-only property specifies whether or not properties can be set on the collection. It will be
"True" for the Datasets.RowValues collection and "False" for independently created RowValue
objects.
RowValues.Item property
Purpose
This returns a specific RowValue object from the RowValues collection.
Syntax
OBJECT.Item (index)
Part
Description
OBJECT
Represents a RowValues collection.
index
Variant: This specifies which item in the collection to return. It can be either a field
name or a numeric index.
RowValues.Remove method
Purpose
This method removes a specified RowValue object from the collection.
Note:
Though removed from the collection, it will leave the Dataset in tact.
Syntax
OBJECT.Remove (index)
Part
OBJECT
Description
Represents a RowValues collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
337
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
index
Description
Variant: This specifies the item in the collection to remove. It can be either a field
name or a numeric index.
RowValues.Add method
Purpose
This property adds a RowValue object to a specified RowValues collection.
Syntax
[RowValues= ] OBJECT.Add (RowValue)
Part
Description
OBJECT
Represents a RowValues collection.
RowValue
This represents a RowValue object to add to the collection.
RowValues.RemoveAll method
Purpose
This method removes all RowValue objects from a RowValues collection.
Note:
Though removed from the collection, it will leave the Dataset in tact.
Syntax
OBJECT.RemoveAll
Part
OBJECT
Description
Represents a RowValues collection.
RowValues.Clone method
Purpose
This method returns a copy of the specified RowValues collection from a Dataset. Fields can be
added or removed from the cloned RowValues collection to do a sparse update i.e., to update just
certain fields. Obtaining the RowValues collection directly from the dataset (without cloning) will
not allow you to add or remove fields.
Note:
This is the only type of updateable dataset is miDatasetLayer.
Syntax
[RowValues= ]OBJECT.Clone
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
338
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
OBJECT
Description
Represents a RowValues collection.
See Also
Feature.Update method on page 182
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
339
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Selection Collection
A fundamental function of MapX is selecting objects or records so that you can perform additional
tasks on them such as getting more information. A Selection is a collection of Feature objects.
The Layer.Selection collection is a special Features collection in that objects can be added to or
removed from it by the end user if they use of any of the selection tools. You can get a snapshot of
a layer's selection by using the Clone method to return a Features object.
MapX gives you a number of commands and tools for making selections, the Select tool, Radius
Select, Marquee Select, and Boundary Select tool.
To select records with the tools, click on or encircle the associated graphic objects.
Use the property and methods in the Selection collection and Feature objects to obtain additional
information or manipulate the features of the collection.
Object Properties
•
Selection.Count property
•
Selection.Item property
Object Methods
•
Selection.Add method
•
Selection.ClearSelection method
•
Selection.Clone method
•
Selection.Common method
•
Selection.Remove method
•
Selection.Replace method
•
Selection.SelectAll method
•
Selection.SelectByID method
•
Selection.SelectByPoint method
•
Selection.SelectByRadius method
•
Selection.SelectByRectangle method
•
Selection.SelectByRegion method
See Also
Layer Object and Layers Collection on page 239
Feature Object and Features Collection on page 174
Selection.Count property
Purpose
Number of items in the collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
340
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Selection.Item property
Purpose
This returns a Feature object from the selection collection - currently only numeric indexes are
supported. This is a default property for the Selection collection.
Selection.Add method
Purpose
This method adds a Feature Object, FindFeature Object or all features from a Features Collection
into the Selection Collection (UNION set operation). The result is that this Selection Collection
contains all features in the selection before the call, and all features in the object they are passed
in. The object passed in will remain unchanged
Syntax
OBJECT.Add (Source)
Part
Description
OBJECT
Represents a Selection collection.
Source
The Feature, Features or FindFeature object to add.
See Also
Feature Object and Features Collection on page 174
FindFeature Object on page 216
Selection.ClearSelection method
Purpose
This method deselects all features in this layer. Use Layers.ClearSelection to clear the selection
from all layers.
Syntax
OBJECT.ClearSelection
Part
OBJECT
Description
Represents a Selection collection.
Selection.Clone method
Purpose
This method makes a copy of the collection as a Features collection object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
341
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.Clone
Part
OBJECT
Description
Represents a Selection collection.
Selection.Common method
Purpose
This method combines this collection with a Feature Object, a FindFeature Object or a Features
Collection so that this Selection collection contains only features that are in both. (INTERSECT set
operation). This will remove each feature from the Selection Collection which is not in the object
passed in. The object passed in will remain unchanged.
Syntax
OBJECT.Common (Source)
Part
Description
OBJECT
Represents a Selection collection.
Source
This is the Feature object, FindFeature object, or Features collection you will
replace OBJECT with.
See Also
Feature Object and Features Collection on page 174
FindFeature Object on page 216
Selection.Remove method
Purpose
This method removes a Feature object, a FindFeature object or all features in a Features
collection from this collection (SUBTRACT set operation). The Selection collection will then
contain only features that are not in the object that is passed in. The object passed in will remain
unchanged.
Syntax
OBJECT.Remove (Source)
Part
Description
OBJECT
Represents a Selection collection.
Source
This is the Feature object, FindFeature object, or Features collection you will
replace OBJECT with.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
342
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Feature Object and Features Collection on page 174
FindFeature Object on page 216
Selection.Replace method
Purpose
This method replaces the contents of the collection with a Feature Object, a FindFeature Object or
a Features Collection. This selection collection will then contain only the features in the object
passed in. The object passed in will remain unchanged.
Syntax
OBJECT.Replace (Source)
Part
Description
OBJECT
Represents a Selection collection.
Source
This is the Feature object, FindFeature object, or Features collection you will
replace OBJECT with.
See Also
Feature Object and Features Collection on page 174
FindFeature Object on page 216
Selection.SelectAll method
Purpose
Selects all features within a layer.
Syntax
Map.Selection.SelectAll SelectionTypeConstant
See Also
SelectionTypeConstants in Appendix G on page 460
Selection.SelectByID method
Purpose
Selects the feature by FeatureID or FeatureKey. FeatureKey is a string value that identifies a
feature. This is the value returned by Feature.FeatureKey property. You can use FeatureKey
anywhere FeatureID can be used.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
343
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.SelectByID (*FeatureID, Flag)
Part
Description
OBJECT
Represents a Selection collection.
*FeatureID
FeatureID of the feature to select. You may also use the FeatureKey.
Flag
This controls whether this selected feature is added to, removed from, or
replaces the current selection. This takes a SelectionTypeConstants value.
Note:
Although the FeatureID parameter is still a functional part of MapX, it is recommended that
you use the FeatureKey for the sake of simplicity and expedience. The FeatureKey is
used to identify a unique record in a table. In previous versions, the FeatureID property
was used for this purpose, but it did not work correctly for seamless and remote layers.
The FeatureKey property works for all layer types.
See Also
Feature.FeatureKey property on page 177
Selection.SelectByPoint method
Purpose
This method selects the feature(s) at a specified location within the layer.
Syntax
OBJECT.SelectByPoint (X, Y, SelectFlag, [SearchResultFlag])
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).
SelectFlag
This controls whether the selected feature is added to, removed from, or replaces
the current selection. This takes a SelectionTypeConstants value.
SearchResultFlag
This optional parameter controls what to return. It takes one or a combination of
SearchResultTypeConstants values.
Remarks
If you are selecting regions, the Selection.SelectByPoint method will select a region that contains
the location. If you are selecting points or lines, the method will select a point or line within 3 pixels
of the location.
By combining (using OR operator) one or more of the SearchResultTypeConstants you may
define whether you want all the features, the topmost feature, all the regions, all the points, the
topmost point, etc. The default is to return all the features.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
344
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Selection.SelectByRadius method
Purpose
Selects features from the layer within a specified radius around a point. A flag
(SelectionTypeConstant) controls whether these selected features are added to, removed from, or
replace the current selection.
Syntax
OBJECT.SelectByRadius (X, Y, Radius, Flag)
Part
Description
OBJECT
Represents a Selection collection.
X
X coordinate of center of circle. Double value (Longitude).
Y
Y coordinate of center of circle. Double value (Latitude).
Radius
Radius of the search. A double specifying the distance from the point specified by
X and Y in Map units.
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 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.
Selection.SelectByRectangle method
Purpose
Selects features within a rectangle.
Syntax
OBJECT.SelectByRectangle (X1, Y1, X2, Y2, Flag)
Part
Description
OBJECT
Represents a Selection collection.
X1
First x coordinate of the rectangle. Double value.
Y1
First y coordinate of the rectangle. Double value.
X2
Second x coordinate of the rectangle. Double value.
Y2
Second y coordinate of the rectangle. Double value.
Flag
This controls whether the selected objects are added to, removed from, or replace the
current selection. This takes a SelectionTypeConstants value.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
345
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
A feature is considered to be "within" the rectangle if and only if its centroid is within the rectangle.
If more control over selection criteria is needed, you may want to use the Layer object's
SearchWithinRectangle method. The Rectangle is a 'Map' rectangle in the Numeric Projection,
and does not represent a screen rectangle.
See Also
Layer.SearchWithinRectangle method on page 259
Selection.SelectByRegion method
Purpose
Selects features from the layer within a region. A flag (SelectionTypeConstant) controls whether
these selected features are added to, removed from, or replace the current selection.
Syntax
OBJECT.SelectByRegion (Layer, *FeatureKey, Flag)
Part
Description
OBJECT
Represents a Selection collection.
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 on page 177
Layer.SearchWithinFeature method on page 258
Layer Object and Layers Collection on page 239
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
346
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
SourceRow Object and SourceRows Collection
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
SourceRow.Row property
Purpose
Contains the row number from the original data source. This is an Integer value and is read-only.
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.
SourceRows.Count property
Purpose
Contains the number of SourceRow objects in a collection. This is a 1 based Integer value, and is
read-only.
SourceRows.Item property
Purpose
This gets a SourceRow object from the collection. An index is used to specify which SourceRow to
get. The index is an Integer value from 1 to SourceRows.Count, or a Feature object. This is the
default property of the SourceRows collection.
Syntax
[SourceRow= ]OBJECT.Item (index)
Part
Description
OBJECT
Represents a SourceRows object.
index
Row in Dataset to get value. This is a Variant, and can be a row number or a Feature object.
The Dataset.SourceRows property is a SourceRows collection, which contains a SourceRow
object for each row in the original data source that was aggregated to the row in the MapX
Dataset.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
347
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
348
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
State Object
The State object allows you to save the current state of an item, such as an object or variable, so
that you can restore the item back to that state at a later time. You can save and restore MapX
objects or variables (e.g., a String or Boolean.)
The State object is very useful in MapXtreme applications to restore the state of the Map object on
each session request. (State.Stream property on page 354 for more information). It is also useful
in MapX applications (e.g., when using Visual Basic) if you want to save and restore Datasets and
Themes into a permanent file so that you can then restore them at a later time. State.WriteToFile
method on page 355 for more information.
Note:
This object is not available in MapX Mobile.
Creating a State object in Visual Basic
To use a State object in Visual Basic, you need to add the "MapInfo MapX V5 State Type Library"
reference to your project . You can then use the object type MapXStateLib.State to create a new
state object.
The following example creates a new State object:
Dim objState as MapXStateLib.State
Set objState = new MapXStateLib.State
Creating a State object in ASP
To use a State object in ASP, you need to use Server.CreateObject and the state object's class ID
"MapX.State.5".
The following example creates a new State object:
Dim objState
set objState = Server.CreateObject("MapX.State.5")
Saving and restoring items
You can save and restore single element variables of any Visual Basic native type (e.g., String,
Variant, Boolean, etc.) Array variables are not supported.
You can save and restore objects as long as they support persistence. The following MapX objects
support persistence: Map, Annotation, Annotations, Layer, Layers, Labels, LabelProperties,
Feature, Dataset, Datasets, Theme, Themes, CoordSys, Style, Field and Fields.
For more information on saving and restoring items, see State.Save and State.Restore.
Saving and restoring the Map object
When you save a Map object, all the Map properties and objects within its hierarchy are saved as
well (e.g., Layers, Title, Datasets, Themes, etc.) The only exception is the Annotations collection.
If you want to save your annotations, you need to explicitly save and restore them after saving and
restoring the Map object.
For example, to save the map and your annotations, do the following:
objState.Save objMap
objState.Save objMap.Annotations
To then restore the map and its annotations, do the following:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
349
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
objState.Restore objMap
objState.Restore objMap.Annotations
Saving and restoring the Map object also saves the Datasets collection object. However, in order
to completely restore each dataset, the Datasets collection might need each dataset external
source (e.g., ADO recordset.) See "Saving and restoring datasets" for more information.
Saving and restoring datasets
When you save and restore the Datasets collection or the Map object, you save and restore each
dataset in the map.
In order to create a dataset you need an external source. This source can be an ADO recordset, a
RDO resultset or even a layer, depending on the type of dataset you are creating. MapX uses this
source to create the dataset. To restore datasets from the state object, you might need to supply
MapX with this source in order to completely restore the dataset. You do this by calling
Datasets.Restore.
The property Map.ReuseEquivalentOnRestore allows MapX to reuse an existing dataset if it is
equivalent to the one being restored. For more information on this property, see
Map.ReuseEquivalentOnRestore property on page 309.
The following example saves and restores a Map with a dataset called "Dataset1":
' Save the map:
objState.Save objMap
' Perform other operations
...
' If equivalent allow reuse of existing layers and/or datasets when
restoring state.
objMap.ReuseEquivalentOnRestore = True
' Restore the map object:
objState.Restore objMap
' If the dataset is not yet present:
if not objMap.Datasets.Contains("Dataset1") then
' Setup the dataset source (e.g., ADO recordset):
...
' Complete restoring the dataset:
objMap.Datasets.Restore "Dataset1", source
end if
Saving the Layers collection or the Layer object explicitly
When you save the Layers collection object or a Layer object explicitly, the Datasets associated
with the layer are not saved. If you are explicitly saving the Layer or Layers objects, you must save
the Datasets or Dataset object explicitly.
Notes on saving the Dataset object explicitly
Saving and restoring an individual dataset only saves property information about the dataset. In
order to save and restore an individual dataset, you must have an existing dataset. This means
that the only information that needs to be restored once you have a dataset is the labeling state of
the dataset (whether the dataset is being used to label a layer) and its themes.
See Also
Datasets.Contains method on page 169
Map.ReuseEquivalentOnRestore property on page 309
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
350
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Dataset Object and Datasets Collection on page 161
Object Methods
•
State.ReadFromFile method
•
State.Reset method
•
State.Restore method
•
State.Save method
•
State.WriteToFile method
Object Properties
•
State.Stream property
State.ReadFromFile method
Purpose
This method initializes the State object from a binary file.
Syntax
OBJECT.ReadFromFile (strFile)
Part
Description
OBJECT
This is a State object.
strFile
String argument, which is the filepath, such as "C:\Temp\State.sav".
Remarks
When using this method on a server-side script running on an internet application such as ASP
you need to make sure that the user account executing the script has read access to the file
specification. Keep in mind, however, that if you are also calling State.WriteToFile you need write
access as well.
See Also
State.WriteToFile method on page 355
State.Reset method
Purpose
This method rewinds the state object to the beginning of its saved or initialized storage. It is
particularly useful when restoring multiple copies of stored objects and/or variables.
Example
Save a map using the following statement:
Stateobj.Save mapobj
Then, restore two copies by using the following statements:
Stateobj.Restore mapobj1
Stateobj.Reset
Stateobj.Restore mapobj2
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
351
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
State.ReadFromFile method on page 351
State.Restore method on page 352
State.Save method on page 353
State.Stream property on page 354
State.Restore method
Purpose
This method restores an item into the State object's internal storage. An item can be an object that
supports persistence (e.g., a Map object) or a variable (e.g., a String variable) You cannot restore
arrays (e.g., a String(5) variable.) In order to restore an item properly, you must call State.Restore
the same number of times and order as State.Save. Incorrect order results in an error.
Syntax
OBJECT.Restore (item)
Part
Description
OBJECT
This is a State object.
item
This is the object or variable to restore.
Examples
A MapX map object is a persistent object. To restore a previously saved map object embedded in
a Visual Basic form, you need to do the following:
objState.Restore Map1.Object
Note:
Object is a property in VB to access the OLE object of an embedded control.
To restore a previously saved map object in ASP (or any other web server application), there is no
Object property, so you can just send the actual object directly:
objState.Restore objMap
Note:
objMap must be an existing Map object.
To restore three previously saved variables, e.g., the map zoom, center x and center y, do the
following:
Dim nZoom
Dim nCenterX
Dim nCenterY
'save state
objState.Save Map1.Zoom
objState.Save Map1.CenterX
objState.Save Map1.CenterY
'restore state calls are made in the same order
objState.Restore nZoom
objState.Restore nCenterX
objState.Restore nCenterY
objMap.ZoomTo nZoom, nCenterX, nCenterY
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
352
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
You can call this method multiple times to restore multiple items.
When restoring persistent objects, you must have an existing object, not just an empty object
variable.
You may call State.Restore multiple times to restore more than one object or variable in the same
State object, as long as you have originally called State.Save the same number of times and order
with equivalent objects and variables.
You do not need to call State.Reset before the first State.Restore call, if calling State.Restore right
after setting the State.Stream property or calling State.Save or State.ReadFromFile) because it is
done automatically.
You cannot restore the property of an object directly. You must restore it into a variable and then
set the object property. For example, to save the Map.Zoom property, do the following:
objState.Save Map1.Zoom
To restore it, however, you must do the following:
Dim nZoom as Double
objState.Restore nZoom
Map1.Zoom = nZoom
See Also
State.Save method on page 353
State.Save method
Purpose
This method saves an item into the State object's internal storage. An item can be an object that
supports persistence (e.g., a Map object) or a variable (e.g., a String variable) You cannot save
arrays (e.g., a String(5) variable.)
Syntax
Part
Description
OBJECT
This is a State object.
item
This is the object or variable to restore.
Examples
A MapX map object is a persistent object. To save a map object embedded in a Visual Basic form,
you need to do the following:
objState.Save Map1.Object
Note:
Object is a property in VB to access the OLE object of an embedded control.
To save a map object in ASP (or any other web server application), there is no Object property, so
you can just send the actual object directly:
objState.Save objMap
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
353
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
To save three variables, e.g., the map zoom, center x and center y, do the following:
objState.Save objMap.Zoom
objState.Save objMap.CenterX
objState.Save objMap.CenterY
Remarks
You can call this method multiple times to save multiple items.
The following MapX objects support persistence: Map, Annotation, Annotations, Layer, Layers,
Labels, LabelProperties, Feature, Dataset, Datasets, Theme, Themes, CoordSys, Style, Field and
Fields.
See Also
State.Restore method on page 352
State.Stream property
Purpose
This property gets or sets an alphabetic string of characters representing the State object's internal
storage.
Example
You can use the State object in an ASP application to save and restore the state of a Map object
on every session request. The following ASP code snippet sends the current state of the Map
object back to the client through a hidden HTML form field:
Dim objState
Set objState = Server.CreateObject("MapX.State.5")
objState.Save objMap
Response.Write("<INPUT TYPE=HIDDEN NAME=""State"" VALUE=" & _
objState.Stream & ">")
The following ASP code snippet then restores the Map object to its previous state on the next
HTTP request:
Dim objState
Set objState = Server.CreateObject("MapX.State.5")
objState.Stream = Request.Form.Item("State")
objState.Restore objMap
Remarks
The value of the Stream property contains alphabetic characters only. It does not contain any
special HTML characters so that it can be written in an HTML page as a string value.
This property is useful in web applications to save and restore the state of the Map object on each
session request. You can save the Map object into a State object and then use the Stream
property to send the state back to the client on a hidden HTML form field. On the next session
request, you can set the Stream property of a new State object to the value of the hidden HTML
form field and call State.Restore to restore the Map object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
354
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Keep in mind that saving Map objects with a lot of information (e.g., maps that have several layers
or temporary layers with several features) can significantly increase the amount of data transferred
between the client and the server. An alternate solution is to save the value of the Stream property
to store the value of the Stream object in a database and send a key back to the client. This key
can then be used on the next session request to retrieve the Stream value from the database.
See Also
State.Restore method on page 352
State.Save method on page 353
State.WriteToFile method
Purpose
This method writes the State object to a binary file.
Syntax
OBJECT.WriteToFile (strFile)
Part
Description
OBJECT
This is a State object.
strFile
String argument, which is the filepath, such as "C:\Temp\State.sav".
Remarks
When using this method on a server-side script running on an internet application such as ASP
you need to make sure that the user account executing the script has write access to the file
specification.
See Also
State.ReadFromFile method on page 351
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
355
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
356
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
•
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
Style.Clone method
Purpose
This returns a stand-alone Style object which is a copy of another Style object.
Syntax
OBJECT.Clone
The OBJECT placeholder represents a Style object.
Remarks
When you reference a Style object that is owned by another object (for example, using an
expression such as objFeature.Style), any changes that you make to the style automatically affect
the style's parent object.
To create a modified style without affecting the parent object, use the Clone method to create a
copy of the style. The style returned by this method is a stand-alone object; changes made to this
Style object do not automatically affect any other object. You can assign a stand-alone Style object
to any object's Style property.
A Style object created through the Clone method supports bitmap symbols if and only if the
original Style object supports bitmap symbols.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
357
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.DrawLineSample method
Purpose
This method is used if the user would like to have a sample of a line style drawn into a HDC.
Syntax
OBJECT.DrawLineSample (HDC, Rectangle)
Part
Description
HDC
The HDC into which the sample is drawn.
Rectangle
A Rectangle object 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.
Style.DrawRegionSample method
Purpose
This method is used if the user would like to have a sample of a region style drawn into a HDC.
Syntax
OBJECT.DrawRegionSample (HDC, Rectangle)
Part
Description
OBJECT
This 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.
Style.DrawSymbolSample method
Purpose
This method is used if the user would like to have a sample of a symbol style drawn into a HDC.
This method does not work on a MetaFile device context.
Syntax
OBJECT.DrawSymbolSample (HDC, Rectangle)
Part
Description
OBJECT
This represents a Style object.
HDC
The HDC into which the sample is drawn.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
358
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Rectangle
Description
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.
Style.DrawTextSample method
Purpose
This method is used if the user would like to have a sample of a text style drawn into a HDC.
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.
Style.ExportLineSample method
Purpose
Exports the line style 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
359
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
BackColor
Description
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.)
Style.ExportRegionSample method
Purpose
Exports the region style sample.
Syntax
OBJECT.ExportRegionSample (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 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.)
Style.ExportSymbolSample method
Purpose
Exports the symbol style sample.
Syntax
OBJECT.ExportSymbolSample (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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
360
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
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.
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.)
Style.ExportTextSample method
Purpose
Exports the text style sample.
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.)
Style.LineColor property
Purpose
Contains the line color. Used for linear objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
361
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.LineInterleaved property
Purpose
A read-write Boolean property. It is used to make a pen style interleaved if that pen style supports
being interleaved with the LineSupportsInterleave property. An interleaved pen style can create
the appearance of intersections on your maps for overlapping intersections and lines.
Style.LineStyle property
Purpose
This returns or sets a line style number (solid, dashed, etc.) and is used to display linear features.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
362
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Chapter 14: The MapX Object Reference
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.
Style.LineStyleCount property
Purpose
A read-only integer value, indicating the number of line styles that are available. The count
includes pen styles read in from the mapx.pen file.
Style.LineSupportsInterleave property
Purpose
A read-only Boolean property. Denotes whether a given pen style supports interleave or not.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
363
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Style.LineInterleaved property on page 362
Style.LineWidth property
Purpose
This property contains the width of a line and is used for linear objects. This is an Integer value.
Remarks
You may specify a style Style.LineWidth in tenths of points or in pixels by setting the
Style.LineWidthUnit property to one of the StyleUnitConstants.
See Also
Style.LineWidthUnit property on page 364
Style.LineWidthUnit property
Purpose
Controls the unit of measurement for the line width. The width is specified in either pixels or tenths
of points, by specifying a StyleUnitConstants value.
See Also
Style.LineWidth property on page 364
Style.PickLine method
Purpose
This displays the Line Style Picker dialog that allows a user to choose line style properties. The
Style object is updated with the new properties if the user clicks OK in the dialog.
Syntax
OBJECT.PickLine
Style.PickRegion method
Purpose
This displays the Region Style Picker dialog that allows a user to choose region style properties.
The Style object is updated with the new properties if the user clicks OK in the dialog.
Syntax
OBJECT.PickRegion
Style.PickSymbol method
Purpose
This displays the Symbol Style Picker dialog that allows a user to choose symbol style properties.
The style object is updated with the new properties if the user clicks OK in the dialog.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
364
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
OBJECT.PickSymbol
Style.PickText method
Purpose
This displays the Text Style Picker dialog that allows a user to choose text style properties. The
style object is updated with the new properties if the user clicks OK in the dialog.
Syntax
OBJECT.PickText
Style.RegionBackColor property
Purpose
Contains the region background color and is used when a RegionPattern other than
miPatternSolid is specified for region objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
FillPatternConstants in Appendix G on page 455
Style.RegionBorderColor property
Purpose
Contains the region border color and is used for region objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
Style.RegionBorderStyle property
Purpose
Contains the line style for a region border and is used for region objects. This takes a
PenStyleConstants value.
Style.RegionBorderWidth property
Purpose
Contains the width of a region border and is used for region objects. This is an Integer value, and
width is specified in pixels.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
365
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.RegionBorderWidthUnit property
Purpose
Controls the unit of measurement for the region border width. The width is specified in either pixels
or tenths of points, by specifying a StyleUnitConstants value.
See Also
Style.RegionBorderWidth property on page 365
Style.RegionColor property
Purpose
Contains the region color and is used for region objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
Style.RegionPattern property
Purpose
Contains the region pattern and is used for region objects. This takes a FillPatternConstants
value.
Style.RegionTransparent property
Purpose
A read-write Boolean value, indicating whether a region drawn with a pattern is transparent. A
value of True makes the region transparent, while False makes it opaque.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
366
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.SupportsBitmapSymbols property
Purpose
A read-only Boolean value, indicating whether the style object supports bitmap symbols.
Remarks
A True value indicates that the Symbol object supports bitmap symbols.
Currently, only Feature, Layer, and Theme objects support bitmap symbols.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
Style.SymbolBitmapColor property
Purpose
A read-write OLE_COLOR value, used to override the non-white pixels in a bitmap symbol.
Remarks
To make the non-white pixels in a bitmap symbol appear in a particular color:
1. Set the SymbolBitmapColor property to the desired color.
2. Set the SymbolBitmapOverrideColor property to True.
When you change a TrueType font symbol into a bitmap symbol - in other words, when you
change the SymbolType property to miSymbolTypeBitmap (1) - MapX sets the
SymbolBitmapColor property to match the SymbolFontColor property.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
Style.SymbolBitmapName property
Purpose
A read-write string value, representing the name of the bitmap file to use as a bitmap symbol.
Remarks
The name that you specify should not include a full directory path. The bitmap file must be in the
custom symbol directory, currently defined to be:
<path>\CUSTSYMB
where <path> is the path where the MapX Common Files are installed, e.g., C:\Program
Files\Common Files\MapInfo Shared\MapXCommon.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
367
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.SymbolBitmapOverrideColor property
Purpose
A read-write Boolean value, indicating whether the non-white pixels in a bitmap symbol are drawn
in an override color.
Remarks
The default is false, meaning that the non–white pixels in a bitmap symbol will appear in their
default colors. If you want all of the non–white pixels to display in an override color (the color
specified by the SymbolBitmapColor property), set this property to True.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
Style.SymbolBitmapSize property
Purpose
A read-write integer value, indicating the size of the symbol, in points. 72 points is equivalent to 1
inch.
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 12point TrueType font symbol into a bitmap symbol, the SymbolBitmapSize will be 12.
The SymbolBitmapSize point values range from 1 - 48. If a bitmap symbol is less than 1 then
SymbolBitmapSize is set to 1. Conversely, if a bitmap symbol is greater than 48 points, then
SymbolBitmapSize is set to 48.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
Style.SymbolBitmapTransparent property
Purpose
A read-write Boolean value, indicating whether the white portion of a bitmap symbol is drawn as
transparent.
Remarks
Default value is False, meaning that the white portion of a bitmap symbol will appear white. Set to
True if you want white portions of the bitmap to be transparent.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
368
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.SymbolCharacter property
Purpose
This property specifies which symbol to use. Used for symbol objects. This takes an Integer value
between 0 and 255, and represents the ASCII code of the character in the TrueType font set to
use.
See Also
Style.SymbolFont property on page 369
Style.SymbolFont property
Purpose
This returns a standard Font object (IFontDispatch, OLE_FONT) which allows you to set font
properties (Bold, Size, etc.) to alter a symbol's appearance and can only apply to TrueType font
symbols.
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 on page 369
Setting Font Attributes in Chapter 7 on page 77
Style.SymbolFontBackColor property
Purpose
This contains the symbol background color and is used for symbol objects and can only apply to
TrueType font symbols. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
Style.SymbolFontColor property
Purpose
Contains the symbol color. Used for symbol objects and can only apply to TrueType font symbols.
This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
369
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.SymbolFontHalo property
Purpose
This read/write property controls whether a halo is drawn around the symbol. Used for symbol
objects and can only apply to TrueType font symbols. A halo is a `buffer' around the symbol - to
help offset it from the map beneath. This is a Boolean value that one can set to true for individual
features.
Style.SymbolFontOpaque property
Purpose
This read/write property controls whether the symbol displays a background color (and is thus
opaque). Used for symbol objects and can only apply to TrueType font symbols. This is a Boolean
value.
Style.SymbolFontRotation property
Purpose
Read-write integer value, indicating the number of degrees to rotate a TrueType symbol.
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.
Style.SymbolFontShadow property
Purpose
Applies only to Layer Styles and Label Styles. Controls whether a shadow is drawn under the
symbol. Used for symbol objects and can only apply to TrueType font symbols. This is a Boolean
value.
Style.MinVectorSymbolCharacter property
Purpose
This property applies to Symbol Style objects. It is a read-only integer property which contains the
minimum value of Style.SymbolCharacter which will yield a Vector symbol. For these symbols, the
Style.SymbolType should be set to miSymbolTypeVector.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
370
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.MaxVectorSymbolCharacter property
Purpose
This property applies to Symbol Style objects. It is a read-only integer property which contains the
maximum value of Style.SymbolCharacter which will yield a vector symbol. For these symbols, the
Style.SymbolType should be set to miSymbolTypeVector.
Style.SymbolVectorColor property
Purpose
This property applies to vector symbol Style objects. It is a read-write OLE_COLOR value which
specifies the color of the vector symbol. The default is miColorBlack.
See Also
Appendix L: OLE_COLOR Values
Style.SymbolVectorSize property
Purpose
This property applies to vector symbol Style objects. It is a read-write Integer value which specifies
the point size of the vector symbol. The default is 12.
Style.TextFont property
Purpose
This returns a standard Font object (IFontDispatch, OLE_FONT) which allows you to set font
properties (Bold, Size, etc.) to alter the appearance of text features.
Remarks
The TextFont property is read-only; however, you can set the properties of the Font object that it
returns.
Style.TextFontAllCaps property
Purpose
Applies only to Layer Styles and Label Styles. Controls whether the text is displayed in all capital
letters. Used for text objects. This is a Boolean value.
Style.TextFontBackColor property
Purpose
Contains the text background color. Used for text objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
371
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.TextFontColor property
Purpose
Contains the text color. Used for text objects. This is an OLE_COLOR value.
See Also
Appendix L: OLE_COLOR Values
Style.TextFontDblSpace property
Purpose
Applies only to Layer Styles and Label Styles. Controls whether the text is displayed using large
spacing between the letters. Used for text objects. This is a Boolean value.
Style.TextFontHalo property
Purpose
This property applies only to Layer Styles and Label Styles. Controls whether a halo is drawn
around the text. This is used for text objects. A halo is a 'buffer' around the text to help offset it from
the map beneath. This is a Boolean value.
Style.TextFontOpaque property
Purpose
Controls whether the text displays a background color (and is thus opaque). This is used for text
objects and is a Boolean value.
Style.TextFontShadow property
Purpose
Applies only to Layer Styles and Label Styles. It controls whether a shadow is drawn under the
text. This is used for text objects and is a Boolean value.
Style.TextFontRotation property
Purpose
This read/write property indicates the number of degrees to rotate a Text object with an integer
value. Negative integers will rotate the text clockwise and positive integers will rotate the text
counter-clockwise. It is valid only for Feature objects and if set/queried for any other object, this
property is ignored/undefined.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
372
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Style.SymbolType property
Purpose
A read-write short value, indicating how to display a point feature (as a character from a TrueType
font, a bitmap, or a VectorSymbol). It should be set to one of the SymbolTypeConstants.
Remarks
To use a TrueType font symbol, set this to miSymbolTypeTrueTypeFont.
To change to a bitmap symbol, set this to miSymbolTypeBitmap.
To change to a vector symbol, set this to miSymbolTypeVector.
Note:
Only some objects (Feature, Layer, Theme) support bitmap symbols. Attempting to set
SymbolType to miSymbolTypeBitmap will throw an exception if the object does not
support bitmap symbols.
See Also
BitmapSymbol Object and BitmapSymbols Collection on page 151
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
373
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Theme Object and Themes Collection
Theme objects contain the attributes of a theme.
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.AutoRecompute property
Purpose
Controls when theme ranges are recomputed. This is a Boolean property, and defaults to TRUE.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
374
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Theme.ComputeTheme property
Purpose
This property controls whether themes are computed from the data on the table. This is a Boolean
property, and defaults to True. A True value will calculate the theme from the raw data.
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.DataMin property on page 375
Theme.DataMax property on page 375
ThemeProperties.NumRanges property on page 384
ThemeProperties.IndividualValueCategories property on page 384
Legend.ShowEmptyRanges property on page 281
Theme.DataMax property
Purpose
Determines the maximum value to set the theme ranges or calculate equal size ranges for ranged
themes when the Theme.ComputeTheme property or the ComputeTheme parameter of the
Themes.Add method is set to FALSE.
See Also
Theme.ComputeTheme property on page 375
Theme.DataMin property on page 375
Theme.DataMin property
Purpose
Determines the minimum value to set the theme ranges or calculate equal size ranges for ranged
themes when the Theme.ComputeTheme property or the ComputeTheme parameter of the
Themes.Add method is set to FALSE.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
375
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Theme.ComputeTheme property on page 375
Theme.DataMin property on page 375
Theme.Fields property
Purpose
This returns a read-only Fields collection, representing the set of fields used by the Dataset that
this theme is based on.
Theme.Layer property
Purpose
This is a read-only property that returns a Layer object, representing the layer that the theme is
based on.
See Also
Layer Object and Layers Collection on page 239
Theme.Legend property
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.
See Also
Legend Object on page 277
Theme.Name property
Purpose
The name of the Theme must be unique within a Themes collection. This is a read/write property,
and is either specified as a parameter to the Themes.Add method or generated by MapX when the
theme is created. This is the default property for the Theme object.
Remarks
The Name property can be used with the Themes.Item property and the Themes.Remove method.
See Also
Themes.Add method on page 378
Themes.Item property on page 379
Themes.Remove method on page 380
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
376
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Theme.Properties property
Purpose
This is the set of properties contained in the Theme object and is determined by the type of
thematic map in use.
Note:
In MapX 3.5, we renamed Theme.Properties to Theme.ThemeProperties, but left
Theme.Properties in the object model for backward compatibility of code. Nonetheless,
Theme.ThemeProperties is the preferred way of getting to the theme's properties.
See Also
Theme.ThemeProperties property on page 377
ThemeProperties Object on page 381
Theme.ThemeDlg method
Purpose
Brings up a stock dialog that allows the user to manipulate the style of the Theme. The particular
dialog brought up will match the type of the Theme object (Range, Dot Density, Pie, Bar,
IndividualValues, or Graduated Symbol). If the user clicks 'OK', the changes made within the
dialog will immediately be applied to the theme on the map.
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.
Theme.ThemeProperties property
Purpose
An object containing properties about the theme. The set of properties contained in the
ThemeProperties object is determined by the type of the Theme object (type of thematic map).
See Also
ThemeProperties Object on page 381
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
377
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Theme.Type property
Purpose
The type of theme for a Theme object. This is a ThemeTypeConstants value and is a read-only
property.
Theme.Visible property
Purpose
This property sets whether or not the theme is visible. This is a Boolean value, and defaults to
TRUE.
Themes.Add method
Purpose
This creates a theme and adds it to the Themes collection for a particular Dataset.
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 programmer’s.
Syntax
OBJECT.Add ([Type], [Field], [Name], [ComputeTheme])
Part
Description
OBJECT
Represents a Themes object.
Type
Specifies the type of thematic map to create. This takes a ThemeTypeConstants
value. 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
378
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
Description
Field(s)
Specifies the field or fields to thematically map. A field can be specified by name,
index, or by a Field object. If you are creating a theme using multiple variables (such as
a bar chart or pie chart), pass in a Fields collection or 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.
ComputeTheme
Boolean. The default value is True which will calculate the theme from the table data. If
the value is set to False an invisible theme object will be created with 10 ranges for
IndividualValue themes and 5 ranges for Ranged themes. You can then manually set
the minimum and maximum values to define the theme with Theme.DataMin and
Theme.DataMax. 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.
See Also
Field Object and Fields Collection on page 203
Theme.DataMax property on page 375
Theme.DataMin property on page 375
Theme.Name property on page 376
Theme.Type property on page 378
Appendix A: MapX Field Naming Conventions
Themes.Count property
Purpose
The number of Theme objects in a Themes collection. This is a read-only property.
Themes.Item property
Purpose
Retrieve a Theme object from the Themes collection. This takes a parameter to specify which
theme. The parameter is a Variant representing the 1 based index number, or the theme name.
This is the default property for the Themes collection.
Syntax
OBJECT.Item (index)
Part
Description
OBJECT
Represents a Themes object.
index
Theme object 1–based index number or theme name.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
379
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
Theme.Name property on page 376
Themes.Remove method
Purpose
Removes the specified Theme object from the Themes collection.
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 Themes object.
index
Theme object 1 based index number or theme name.
See Also
Theme.Name property on page 376
Themes.RemoveAll method
Purpose
Removes all Theme objects from the collection.
Syntax
OBJECT.RemoveAll
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
380
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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.DataValue property
•
ThemeProperties.DistMethod property
•
ThemeProperties.DotSize property
•
ThemeProperties.Graduated property
•
ThemeProperties.Independent property
•
ThemeProperties.IndividualValueCategories property
•
ThemeProperties.MultivarCategories property
•
ThemeProperties.NumRanges property
•
ThemeProperties.RangeCategories property
•
ThemeProperties.Size property
•
ThemeProperties.SpreadBy property
•
ThemeProperties.SymbolStyle property
•
ThemeProperties.ValuePerDot property
•
ThemeProperties.Width property
•
ThemeProperties.PieClockwise property
•
ThemeProperties.PieStartAngle property
•
ThemeProperties.PieHalfPies property
•
ThemeProperties.PieGraduated property
•
ThemeProperties.BarStacked property
•
ThemeProperties.BarGraduatedStack property
•
ThemeProperties.BarIndependentScale property
•
ThemeProperties.BarWidth property
•
ThemeProperties.BarFramed property
•
ThemeProperties.BarFrameStyle
•
ThemeProperties.BorderStyle property
•
ThemeProperties.ShowNegativeValues property
•
ThemeProperties.PositiveSymbolStyle property
•
ThemeProperties.NegativeSymbolStyle property
•
ThemeProperties.GraduateSizeBy property
•
ThemeProperties.DotColor property
•
ThemeProperties.RoundRanges property
•
ThemeProperties.RoundBy property
•
ThemeProperties.InflectRanges property
•
ThemeProperties.InflectionRange property
•
ThemeProperties.InflectionColor property
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
381
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
•
ThemeProperties.ColorMethod property
•
ThemeProperties.ApplyAttribute property
ThemeProperties.AllowEmptyRanges property
Purpose
This is a read/write Boolean property that controls whether empty ranges are allowed in a ranged
theme. The default is False for a new theme, meaning that empty ranges are not allowed in a
ranged theme.
Remarks
If the ThemeProperties.DistMethod property is set to miCustomRanges (value: 0), empty ranges
are allowed, regardless of the value of the AllowEmptyRanges property.
See Also
Legend.ShowEmptyRanges property on page 281
ThemeProperties.DataValue property
Purpose
This applies to GraduatedSymbol, Pie, and Bar themes. It works in conjunction with the Size
property to control how big the thematic graphics are at particular values. This is a double value,
and is the value at which the thematic graphic is drawn at the size specified by the Size property.
The default value for this property is set to the largest data value of the mapped features.
See Also
ThemeProperties.Size property on page 384
ThemeProperties.DistMethod property
Purpose
This property applies to Ranged themes. It controls how ranges (in the RangeCategories
collection) are created when a Theme object is recomputed. This property takes a
DistribMethodConstants value and defaults to miEqualCountPerRange. The available
distribution types are as follows:
Distribution
Description
miEqualRangeSize
Takes the maximum data value and the minimum data value, and chooses
ranges by breaking the range of data values into equally sized pieces (e.g., 025; 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).
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
382
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Distribution
Description
miNaturalBreak
Range breaks are determined using an algorithm that attempts to minimize the
difference between the data values and the average of the data values, minimized on a per range basis.
miStandardDeviation
The middle range breaks at the mean of the data values, and the ranges
above and below the middle range are one standard deviation above or below
the mean.
See Also
RangeCategory Object and RangeCategories Collection on page 329
ThemeProperties.DotSize property
Purpose
This property applies to DotDensity themes. This controls the dot size used by DotDensity
thematic maps. This is a DotSizeConstants value and defaults to miDotSizeSmall.
ThemeProperties.Graduated property
Purpose
This property applies to Pie themes. This 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.
Note:
This property has been replaced by ThemeProperties.PieGraduated. However, it still
exists for backward compatibility
See Also
ThemeProperties.PieGraduated property on page 386
ThemeProperties.Independent property
Purpose
This property applies to Bar themes. This controls whether the data values for the bars should be
treated independently (not comparable values such as Population and AvgIncome). 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, the export ranking bar would be difficult to obtain any meaning
from because the state ranked 1st would have an export bar the size of a state's population bar if
that state had 1 person in it.
Note:
BarIndependentScale is now the preferred name for this property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
383
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
ThemeProperties.BarIndependentScale property on page 387
ThemeProperties.IndividualValueCategories property
Purpose
This returns an IndividualValueCategories collection; used with Individual Value thematic maps.
See Also
IndividualValueCategory Object and IndividualValueCategories Collection on page 226
ThemeProperties.MultivarCategories property
Purpose
This returns a MultivarCategories collection; used with thematic maps that use multiple variables
(bar or pie charts).
See Also
MultivarCategory Object and MultivarCategories Collection on page 315
ThemeProperties.NumRanges property
Purpose
This property applies to Ranged themes. It controls the number of ranges for a ranged thematic
map. This is an Integer value, and defaults to 5.
ThemeProperties.RangeCategories property
Purpose
This returns a RangeCategories collection; used with ranged thematic maps.
See Also
RangeCategory Object and RangeCategories Collection on page 329
ThemeProperties.Size property
Purpose
This property applies to Pie and Bar themes. This 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.
See Also
Map.PaperUnit property on page 307
ThemeProperties.DataValue property on page 382
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
384
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ThemeProperties.SpreadBy property
Purpose
Controls how autospreading is done for ranged thematic maps. MapX can compute a set of colors
between two colors or compute sizes between two sizes.
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 (i.e., per
range), ThemeProperties.SpreadBy must be set to miSpreadByNone.
ThemeProperties.SymbolStyle property
Purpose
This property applies to GraduatedSymbol themes. This controls the symbol that is used, as well
as the size of the symbol drawn at the value specified by the DataValue property. This is a Style
object, and is a read-only property (although the properties of the SymbolStyle are Read/Write).
Note:
ThemeProperties.PositiveSymbolStyle is now the preferred name for this property.
See Also
Style Object on page 356
ThemeProperties.PositiveSymbolStyle property on page 388
ThemeProperties.DataValue property on page 382
ThemeProperties.ValuePerDot property
Purpose
This property applies to DotDensity themes. This specifies that value a dot represents. For
example, if ValuePerDot was 2000, and a region had a population of 48,000, then 24 dots would
be drawn in the region. This is a double value, and defaults to a reasonable value.
ThemeProperties.Width property
Purpose
This property applies to Bar themes. It 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.
See Also
Map.PaperUnit property on page 307
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
385
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ThemeProperties.PieClockwise property
Purpose
This is a Boolean property which applies to pie chart themes. It controls the direction that the pie
wedges are drawn; if true, they are drawn increasing clockwise. The default is true.
See Also
ThemeProperties.PieStartAngle property on page 386
ThemeProperties.PieStartAngle property
Purpose
This property applies to pie chart themes. It is an Integer property specifying the angle at which the
first pie wedge is drawn. It is measured in degrees, increasing counterclockwise, with 0 degrees
pointing to the right. The default is 180 degrees.
See Also
ThemeProperties.PieClockwise property on page 386
ThemeProperties.PieHalfPies property
Purpose
This is a Boolean property which applies to pie chart themes. If True, half pies are drawn instead
of full pies. The default is False.
ThemeProperties.PieGraduated property
Purpose
This is a Boolean property which applies to pie chart themes. It controls whether the size of the
pies vary. If True, then the total size of a pie is graduated by its total value. If False, then all pies
are the same size. The default is True.
Note:
This property replaces ThemeProperties.Graduated. PieGraduated is the preferred
property.
See Also
ThemeProperties.GraduateSizeBy property on page 389
ThemeProperties.BarStacked property
Purpose
This is a Boolean property which applies to Bar chart themes. If True, the bars of the chart will be
stacked on top of each other; if false, the bars will be side by side. The default is False.
See Also
ThemeProperties.BarGraduatedStack property on page 387
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
386
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ThemeProperties.BarGraduatedStack property
Purpose
This Boolean property applies to Bar charts whose ThemeProperties.BarStacked property is True.
This controls whether the total size of a bar chart varies. If true, the size of a bar chart will be
graduated by the total value of the chart; if false, all of the charts will be the same total size. The
default is True.
See Also
ThemeProperties.BarStacked property on page 386
ThemeProperties.GraduateSizeBy property on page 389
ThemeProperties.BarIndependentScale property
Purpose
This property applies to Bar themes. It controls whether the data values for the bars should be
treated independently (not comparable values such as Population and AvgIncome). 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, the export ranking bar would be difficult to obtain any meaning
from because the state ranked 1st would have an export bar the size of a state's population bar if
that state had 1 person in it. This property replaces ThemeProperties.Independent.
ThemeProperties.BarWidth property
Purpose
This is a double property which applies to Bar Themes. It 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. This
property replaces the ThemeProperties.Width property.
See Also
Map.PaperUnit property on page 307
ThemeProperties.BarFramed property
Purpose
This Boolean property is set to false and specifies whether the bar objects are drawn with frames.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
387
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ThemeProperties.BarFrameStyle
Purpose
This is a Style object which determines the style of the frame of a bar chart.
See Also
Style Object on page 356
ThemeProperties.BorderStyle property on page 388
ThemeProperties.BorderStyle property
Purpose
This is a Style object which affects Bar chart and Pie chart themes. It controls the line style of the
border around a pie or bar chart.
See Also
Style Object on page 356
ThemeProperties.BarFrameStyle on page 388
ThemeProperties.ShowNegativeValues property
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 on page 388
ThemeProperties.NegativeSymbolStyle property on page 389
ThemeProperties.PositiveSymbolStyle property
Purpose
This property applies to Graduated Symbol themes. This controls the symbol that is used for all
positive data values, as well as the size of the symbol drawn at the value specified by the
DataValue property. This is a Style object, and is a read/write property (although the properties of
the Style object are Read/Write).
Note:
This property replaces ThemeProperties.SymbolStyle.
See Also
Style Object on page 356
ThemeProperties.ShowNegativeValues property on page 388y
ThemeProperties.NegativeSymbolStyle property on page 389
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
388
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
ThemeProperties.DataValue property on page 382
ThemeProperties.NegativeSymbolStyle property
Purpose
This applies to Graduated Symbol themes whose ThemeProperties.ShowNegativeValues
property is True. It is a Style object which controls the symbol that is used for all negative data
values of the theme. It is a read/write property (although the properties of the Style object are
Read/Write).
See Also
Style Object on page 356
ThemeProperties.ShowNegativeValues propertyy
ThemeProperties.NegativeSymbolStyle property on page 389
ThemeProperties.DataValue property on page 382
ThemeProperties.GraduateSizeBy property
Purpose
This property applies to Graduated Symbol themes, as well as Pie chart and Bar chart themes
which have been set to Graduated. It must be set to a Short value matching one of the
GraduationConstants. It controls the relationship between a data value and the size of the
corresponding symbol or chart on the map. The default is miGraduateBySquareRoot.
See Also
ThemeProperties.PieGraduated property
ThemeProperties.BarGraduatedStack property
ThemeProperties.DotColor property
Purpose
This property applies to Dot Density themes. It controls the color of the dots in the theme. It is an
OLE_COLOR value.
See Also
OLE_COLOR Values in Appendix L on page 538
ThemeProperties.RoundRanges property
Purpose
This is a Boolean property which applies to Ranged themes. It controls whether the boundaries of
the ranges are rounded off. The default is True. The amount that the values are rounded is
controlled by the ThemeProperties.RoundBy property.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
389
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
See Also
ThemeProperties.RoundBy property on page 390
ThemeProperties.RoundBy property
Purpose
This is a double value which applies to Ranged themes. It specifies the interval to round the
ranges to. It only applies when ThemeProperties.RoundRanges is True.
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 on page 389
ThemeProperties.InflectRanges property
Purpose
This is a Boolean property which applies to Ranged themes. In a ranged theme, an inflection point
can be used to separate the data and the ranges into two sections. When InflectRanges is true,
the colors in the ranged theme will spread from the top range color to the InflectionColor, then from
the InflectionColor to the bottom range color. The default is False.
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 on page 390
ThemeProperties.InflectionColor property on page 391
ThemeProperties.RangeCategories property on page 384
ThemeProperties.InflectionRange property
Purpose
This is a Short value which applies to Ranged themes. It controls which range takes on the color
specified in InflectionColor. The ranges above and below the InflectionRange will have a mixture
of InflectionColor and the top and bottom range colors, respectively.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
390
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Remarks
This property only applies if ThemeProperties.InflectRanges is True. The default is 2 (the second
range).
See Also
ThemeProperties.InflectionRange property on page 390
ThemeProperties.InflectionColor property on page 391
ThemeProperties.InflectionColor property
Purpose
This is an OLE_COLOR value which applies to Ranged themes whose
ThemeProperties.InflectRanges is True. It indicates the color of the inflected range. The range that
is inflected on is specified in the ThemeProperties.InflectionRange property. The default is
miColorWhite.
See Also
ThemeProperties.InflectRanges property on page 390
Appendix L: OLE_COLOR Values
ThemeProperties.ColorMethod property
Purpose
This is a Short property which applies to Ranged themes. It should be one of the
ColorSpreadingMethodConstants. It specifies the method used to interpolate between the top
and bottom range colors to get the colors of the intermediate ranges. It is only valid when
ThemeProperties.SpreadBy is set to miSpreadByColor.
See Also
ThemeProperties.SpreadBy property on page 385
ThemeProperties.ApplyAttribute property
Purpose
This is a Short property, which should be set to one of the ApplyAttributeConstants. It applies to
Ranged or Individual Value themes. It controls which of the theme category's style attributes are
actually applied to the theme. It can be used to selectively modify either the color or the size of the
categories of the theme, without affecting the other's appearance. The default is
miApplyAttributeAll.
See Also
ThemeProperties.RangeCategories property on page 384
RangeCategory Object and RangeCategories Collection on page 329
ThemeProperties.IndividualValueCategories property on page 384
IndividualValueCategory Object and IndividualValueCategories Collection on page 226
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
391
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
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
Title.Border property
Purpose
Controls whether or not to draw the title's border. This is a Boolean value, and defaults to True.
Title.Caption property
Purpose
Contains the text of the Title. This is a String value. This is a default property of the Title object.
Title.Editable property
Purpose
Controls whether the title is editable by the end user. By this we mean whether the user can click
on it and move it, resize it, or change its text. This is a Boolean value, and defaults to True.
Title.Position property
Purpose
Contains a value indicating how the text should be drawn with respect to the X,Y coordinates. This
takes a PositionConstants value, and the default is miPositionCC.
Title.TextStyle property
Purpose
A Style object containing the style of the title.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
392
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Title.Visible property
Purpose
Controls whether the title is visible or not. This is a Boolean value, and defaults to True.
Title.X property
Purpose
Contains the X coordinate of the title. This is a Float value, and represents Screen coordinates.
The position of the title is controlled by the X,Y coordinates in conjunction with the Position
property, which controls how the title sits with respect to the X,Y coordinates.
Title.Y property
Purpose
Contains the Y coordinate of the title. This is a Float value, and represents Screen coordinates.
The position of the title is controlled by the X,Y coordinates in conjunction with the Position
property, which controls how the title sits with respect to the X,Y coordinates.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
393
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Variable Object and Variables Collection
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
•
Variables.Item method
•
Variables.Add method
•
Variables.Clone method
•
Variables.Remove method
•
Variables.RemoveAll method
Note:
The default property is Variables.Item, and the Variable object is NOT createable. Also,
there is no limitation in terms of length and character set.
Remarks
A variable is a name "tied to" a variant. When an expression reads an unresolved identifier, it will
try to resolve it in the Variables collection. If a programmer has added the Variable object in
question to the Variables collection, the expression will execute. The variant can be of any type
(string, number, etc.).
Note:
When using a feature object as a variable, you will get the best performance if the Feature
object and the layer being searched have the same coordinate system. This will prevent
"on the fly" coordinate transformations from occurring.
Dataset names and Dataset field names have precedence over variable names.
The Variables collection IS createable.
Note that in the case of Feature objects, a copy of the feature is made during the call to
Variables.Add. If you subsequently modify the feature, the variable will not reflect the changes.
You will need to update the value of the Variable via the Variables.Add method or via the
Variable.Value property.
Variable.Name property
Purpose
This read-only property specifies the name of the variable being placed in the variables collection.
Variable names are not case sensitive within the collection.
See Also
Appendix A: MapX Field Naming Conventions
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
394
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Variable.Value property
Purpose
This read-only property specifies the value of the variable being placed in the Variables collection.
Variables.Count property
Purpose
This read-only property contains an integer value for the number of variables in the Variables
collection.
Variables.Add method
Purpose
This method adds a Variable object to a Variables collection and is the default property/method of
the Variables collection.
Syntax
[Variables collection= ]OBJECT.Add(Name, Value)
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 and Features Collection on page 174
Appendix A: MapX Field Naming Conventions
Appendix J: IDispatch Table
Variables.Clone method
Purpose
This method clones a specified object in a Variables collection and returns a new Variables
collection with a copy of the variables from the specified collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
395
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Syntax
[Variable object= ]OBJECT.Clone
Part
OBJECT
Description
This represents a Variables collection.
Variables.Item method
Purpose
This method returns a specific Variable object from the Variables collection. This is the default
method for the 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.
Variables.Remove method
Purpose
This method removes a specified Variable object from a Variables collection.
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.
Variables.RemoveAll method
Purpose
This method removes all Variable objects from a Variables collection. The Variables collection will
remain intact, though empty, until other Variable objects are added to it.
Syntax
[Variable object= ]OBJECT.Clone
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
396
MapX_Mobile_DevGuide.pdf
Developer Guide
Chapter 14: The MapX Object Reference
Part
OBJECT
Description
This represents a Variables collection.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
397
MapX_Mobile_DevGuide.pdf
MapX Field Naming
Conventions
What Constitutes a Valid Field Name?
•
The name must NOT start with a digit (0-9) or a # character
•
The name may contain only these characters:
•
•
•
•
•
•
A-Z and a-z
0-9
# (pound sign)
_ (underscore)
~ (tilde)
The name may contain these characters ONLY if they occur
in the last position:
•
•
•
•
•
$
@
%
!
&
•
The name must be less than 32 characters in length
•
The following names are not allowed
•
•
•
•
OBJ
OBJECT
ROWID
COLn where n is a number (e.g., COL1 and COL42 are
invalid but COL1x is valid)
Where Are Valid Field Names Enforced?
Presently MapX only validates the field names when it is creating a
new TAB file (by specifying Layers.Add with a LayerInfo.Type value
of miLayerInfoTypeNewTable). Field names that are valid as
specified by the above rules except that they are greater than 31
characters in length will be truncated to 31 characters when creating
the new TAB file (and layer) and no error message is displayed.
A
Developer Guide
Appendix A: MapX Field Naming Conventions
Invalid field names may be used when adding a dataset, adding a field based on and expression
(Datasets.AddField), creating a new temporary layer (Layers.Add with a LayerInfo.Type value of
miLayerInfoTypeTemp), and creating variables (Variables.Add). These field names may cause
unexpected behavior in MapX.
Note:
It is strongly recommended that MapX applications only use valid field names for dataset
fields and variable names.
Using invalid field names may cause unexpected behavior in the following areas:
Layer.Search: Expressions passed in to Layer.Search must be parsed. Field names which
contain spaces, numeric operators, etc. will be interpreted incorrectly and will produce either an
error or unexpected results.
Themes - When adding a theme, a field or fields collection may be specified either by name or by
index. If a field name is specified but the name begins with a number, the field name will be
incorrectly interpreted by MapX as a field index. The theme will be created on the field with that
index if one exists or throw an error. For example, a field named “1990” is invalid but can exist.
Calling Themes.Add with “1990” for the field will most likely throw an exception.
Fields.Item or Fields(“name”) - A field may be specified by name in the fields collection.
Improperly named fields may produce unexpected results for the same reason mentioned above
under Themes.
Dataset.AddField - An invalid field name will be accepted for the name of the new field. However,
if the expression uses the names of other fields which are invalid names then the AddField method
will either throw an exception or produce unexpected results for the new field (similar to
Layer.Search).
Variable names (Variables.Add) - Variable names should follow the same rules for naming as
fields since these are used in expressions.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
399
MapX_Mobile_DevGuide.pdf
B
Custom Dataset Support
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.
In this appendix:
Š
Š
Š
Š
Static Dataset Object Overview . . . . . . . . . . . . . . . . . . . . . . . . .
Interfaces. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ColumnInfo Enumerator object overview . . . . . . . . . . . . . . . .
ColumnInfo Object Overview . . . . . . . . . . . . . . . . . . . . . . . . . .
401
401
406
406
Developer Guide
Appendix B: Custom Dataset Support
Static Dataset Object Overview
A Static Dataset object is a COM object that MapX can use to retrieve data from an arbitrary data
source. Data is fetched and aggregated when the data source is bound (via a call to MapX’s
Datasets.Add(…) method), and then cached by MapX. Changes to source data are not reflected in
the map until a refresh of MapX’s cached data is forced (via a call to MapX’s DataSet.Refresh(…)
method). All of the behavior needed to retrieve and cache data in this manner is abstracted into
three interfaces; IMMapXDataSet, IMMapXStaticDataSet, and IMMapXColumnInfoContainer. A
Static DataSet object must implement all three of these interfaces (note that
IMMapXStaticDataSet is derived from IMMapXDataSet). See below for a more detailed look at the
contract encapsulated by each of these interfaces.
Special Registration
When registered, a Static DataSet object server must make some special entries in the registry so
that MapX knows when to use it:
Add the key:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<DatasetID>
Add the string value:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX\DatasetEngines\<DatasetID>
\DE_CLSID =
The CLSID of the Static Dataset object (in the form “{xxxxxxxx-xxxx-xxxxxxxx-xxxxxxxxxxxx}”).
Where <DatasetID> is a unique numeric identifier for your Static DataSet object. When the “Type”
parameter to Map’s DataSet.Add(…) method is this value, your server will be asked to provided
the Static DataSet object through which MapX will ultimately retrieve data. The values 0 through
1000 are reserved by MapInfo and should not be used.
Note:
Don’t forget to delete these registry entries when your server is unregistered!
Interfaces
The IMMapXDataSet Interface
[
uuid(96e0f395-caec-11d0-9d99-00aa00a478cb),
helpstring("IMMapXDataset Interface"),
version(1.0)
]
interface IMMapXDataset : IUnknown
{
HRESULT Init(
[in] short sType,
[in] VARIANT* pvSourceData,
[in] VARIANT* pvFields );
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
401
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
HRESULT GetSample(
[in] long lColNum,
[in] long lNumSampleValuesRequested,
[in] VARTYPE vtRequested,
[out] VARIANT * pvarData,
[out] long * pNumRecordsFetched);
IMMapXDataSet::Init
HRESULT Init ();
[in]
short
sType
The dataset type requested (the Type parameter to the
DataSets.Add method). MapX has already identified your server as
the server for datasets of this type (via registry entries you made
when your COM server was registered).
[in]
VARIANT *
pvSourceData
A reference to the source data. (The SourceData parameter to the
DataSet.Add method). For example, this parameter contains the
ODBCQueryInfo object when the bind type is miDataSetODBC, and
an IDAORecordset pointer when the bind type is miDataSetDAO.
[in]
VARIANT *
pvFields
Contains an array of VARIANTS. Each VARIANT identifies (either
by name or by index) a column from the source data that the client
programmer wants bound to the matched map layer. If empty
(pvFields->vt = =VT_EMPTY) all columns from the source data
should be bound.
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();
[in]
Long
lColNum
The source data column to get the sample data
from.
[in]
Long
lNumSamplesRequested
The number of sample data values requested.
[in]
VARTYPE
vtRequested
The preferred type for returned data.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
402
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
[out]
VARIANT *
pvData
VARIANT to receive the sample data. When GetSample returns, this VARIANT should contain an
array of the type requested. MapX will try to convert data that is of a different type, but this will
obviously be less efficient.
[out]
Long *
plNumSamplesValuesFetched
The number of sample data values in pvData.
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.
The IMMapXStaticDataset Interface
[
uuid(2e6d4cc0-d132-11d0-9da0-00aa00a478cb),
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();
[in]
Long
lColNum
The source data column from which to fetch the data.
[in]
Long
lIdxRow
The source data row from which to fetch the data.
[in]
vtRequested
vtRequested
The preferred type for returned data.
[out]
VARIANT *
pvarData
VARIANT to hold the fetched data. Should be of the type identified by vtRequested. MapX will try to convert data that is of a different type, but this will obviously be less efficient.
[out]
BOOL *
pbNoMoreData
A flag to indicate that the fetch has gone past the end of the
available source data. If there are 10 rows of source data, set
this flag when MapX tries to fetch the 11th.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
403
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
Description
Fetches a cell of data from the data source.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXStaticDataset::BeginFetch
HRESULT BeginFetch();
Description
Indicates that a fetch sequence is about to begin. Can be used to allocate/set up resources
needed for fetching data.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXStaticDataset::EndFetch
HRESULT EndFetch();
Description
Indicates that a fetch sequence has ended. Can be used to free resources that are used for
fetching data.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
The IMMapXColumnInfoContainer Interface
[
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);
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
404
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
}
IMMapXColumnInfoContainer::GetColumnInfoByName
HRESULT GetColumnInfoByName();
[in]
BSTR
bstrColumnName
The name of the source data column.
[out]
IMMapXColumnInfo **
ppIMMapXColumnInfo
The ColumnInfo object identified by bstrColumnName
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 ();
[in]
Long
lIndex
The index of the source data column.
[out]
IMMapXColumnInfo **
ppIMMapXColumnInfo
The ColumnInfo object identified by lIndex.
Description
Used to retrieve a ColumnInfo object by column number.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfoContainer::GetColumnInfoEnumerator
HRESULT GetColumnEnumerator();
[out]
IMEnumMapXColumnInfo **
ppIMEnumMapXColumnInfo
The enumerator
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
405
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
E_FAIL is returned on any other failure.
ColumnInfo Enumerator object overview
The ColumnInfo Enumerator object is used to enumerate the collection of ColumnInfo objects
contained in a DataSet object. It implements the interface IMEnumMapXColumnInfo (described
below)
The IMEnumMapXColumnInfo Interface
[
uuid(96e0f396-caec-11d0-9d99-00aa00a478cb),
helpstring("IMEnumColumnInfo Interface"),
version(1.0)
]
interface IMEnumMapXColumnInfo : IUnknown
{
HRESULT Next([in] ULONG celt, [out] IMMapXColumnInfo ** rgelt, [out] ULONG
* pceltFetched);
HRESULT Skip([in] ULONG celt);
HRESULT Reset();
HRESULT Clone([out] IMEnumMapXColumnInfo ** ppIMMapXColumnInfo);
}
IMEnumMapXColumnInfo is an example of a standard enumeration interface, modeled after
IEnumUnknown, which is used to enumerate IMMapXColumnInfo pointers. For complete
documentation of IEnumUnknown, see the OLE32 SDK.
ColumnInfo Object Overview
The ColumnInfo object contains information about a column of source data. It implements the
interface IMMapXColumnInfo (described below)
The IMMapXColumnInfo Interface
[
uuid(96e0f394-caec-11d0-9d99-00aa00a478cb),
helpstring("IMMapXColumnInfo Interface"),
version(1.0)
]
interface IMMapXColumnInfo : IUnknown
{
HRESULT Init(
[in] BSTR bstrName,
[in] VARTYPE vt,
[in] long lColNum);
HRESULT GetName([out] BSTR *pbstrName);
HRESULT GetDataType([out] VARTYPE *pvt);
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
406
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
HRESULT GetColumnNumber([out] long *plColNum);
}
IMMapXColumnInfo::Init
HRESULT Init();
[in]
BSTR
bstrName
The name of the source data column.
[in]
VARTYPE
vt
The type of the source data column.
[out]
long
lColNum
The index of the source data column.
Description
Initialize a ColumnInfo object. MapX will never call this method, it is up to the DataSet object to
initialize the ColumnInfo object after it is created. Note that MapX currently supports only numeric
and string data types.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetName
HRESULT GetName();
[out]
BSTR
*pbstrName
The name of the source data column.0
Description
Retrieves the name of the source data column.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetDataType
HRESULT GetDataType();
[out]
VARTYPE
*pvt
The type of the source data column.
Description
Retrieves the data type of the source data column. Note that MapX currently supports only
numeric and string data types.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
407
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix B: Custom Dataset Support
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
IMMapXColumnInfo::GetColumnNumber
HRESULT GetColumnNumber();
[out]
long
*pColNum
The column number of the source data column.
Description
Retrieves the column number of the source data column.
Return Value
S_OK is returned on success.
E_OUTOFMEMORY is returned if an out of memory condition is encountered.
E_FAIL is returned on any other failure.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
408
MapX_Mobile_DevGuide.pdf
Glossary
Application state
See State.
ASCII
The acronym for American Standard Code for Information
Interchange. ASCII is a standard code used in most microcomputers,
computer terminals, and printers for representing characters as
numbers. It not only includes printable characters, but also control
codes to indicate carriage return, backspace, and so forth.
Bitmap
A screen image displayed as an array of dots or bits. Software usually
generates either bitmapped (raster) or object-oriented (vectored)
files.
Boundary region
In GIS a boundary is a region on a map enclosed by a border.
Cambria County, Manitoba, and Argentina would all be represented
as boundaries on a map. Note that a single boundary could
encompass several polygons. Thus, Indonesia is a single boundary
but consists of many polygons.
Cadastral
A map set used to graphically define the cadastre or land ownership
in a given area. A tax map is an example of a cadastral map. The land
registration, assessment roles, and tax maps comprise the cadastre.
Cartesian
A coordinate system using an x,y scale not tied to any real-world
system. Most CAD drawing uses this method of registering objects
(e.g., a drawing of a ball-bearing assembly, floor plans). If a drawing
uses Cartesian coordinates, one corner of the drawing probably has
coordinates 0, 0.
Cartesian coordinates
The conventional representation of geometric objects by x and y
values on a plane.
C
Developer Guide
Appendix C: Glossary
Cartography
The art and science of making maps. In GIS it is also the graphic presentation and visual
interpretation of data.
Centroid
Usually the center of a map object. For most map objects, the centroid is located at the middle of
the object (the location halfway between the northern and southern extents and halfway between
the eastern and western extents of the object). In some cases, the centroid is not at the middle
point because there is a restriction that the centroid must be located on the object itself. Thus, in
the case of a crescent-shaped region object, the middle point of the object may actually lie outside
the limits of the region; however, the centroid is always within the limits of the region.
Client-Side Image Map (CSIM)
An image map embedded on an HTML page. The map consists of a MAP tag, which names the
image map, and a series of AREA tags, each of which describes an area (or hot spot) and a URL
for that area. When a user clicks an area, the browser requests the associated URL. Contrast to
Server-side Image Map (SSIM) .
Client-side script
JavaScript or VBScript code that is executed by the browser. Client-side scripts can be standalone statements, functions, or event handlers.
Common Gateway Interface (CGI)
A way for a Web client to pass arguments to a program (a CGI program) on a Web server, run the
program, and receive the program's results (in HTML). CGI programs can be written in any
programming language (such as C++ or PERL) that runs on the server. By convention, CGI
programs are stored in the server's CGI-BIN directory.
Coordinate
An x,y location in a Cartesian coordinate system, or a Latitude, Longitude location in an earth
coordinate system. Coordinates represent locations on a map relative to other locations. Earth
coordinate systems may use the equator and the Greenwich prime meridian as fixed reference
points. Plane coordinate systems describe a two-dimensional x,y location in terms of distance from
a fixed reference and are usually in the first quadrant so that all coordinates are positive numbers.
Coordinate system
A coordinate system is used to create a numerical representation of geometric objects. Each point
in a geometric object is represented by a pair of numbers. Those numbers are the coordinates for
that point. In cartography, coordinate systems are closely related to projections. You create a
coordinate system by supplying specific values for the parameters of a projection.
Decimal degree
The decimal representation of fractions of degrees. Many paper maps express coordinates in
degrees, minutes, seconds (e.g., 40_30ι10Ι), where minutes and seconds are fractions of
degrees. 30 minutes equal half a degree, and 30 seconds equal half a minute. MapInfo, however,
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
410
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix C: Glossary
expresses coordinates in decimal degrees (e.g., 72.558 degrees), where fractions of degrees are
expressed as decimals. Thus, the longitude: 40 degrees, 30 minutes, would be expressed in
MapInfo as 40.5 degrees.
Degrees longitude, degrees latitude, decimal degrees
Degrees (longitude and latitude) are coordinates used to represent locations on the surface of the
earth. Longitude, or X-coordinate, represents a location's east-west position, where any location
west of the prime meridian has a negative X value. Latitude, or Y-coordinate, represents a
location's north-south position, where any location south of the equator has a negative Y value.
Event handler
An event handler, which can be written in either JavaScript or VBScript, is an attribute for an object
on a page. For example, an event handler describes what to do when a user clicks a button or
selects text in a list box. Both VBScript and JavaScript support explicitly defined event handlers–
for example on Click and on Select. In addition, you can define functions that replace the explicit
event handlers. Such functions are called implicit event handlers.
Fill pattern
The design and color used to fill a closed object.
Frame
Frames divide a Web browser window into regions, each of which can contain a separate,
scrollable page. A frame has a name and a source URL, which specifies the document that the
browser displays in the frame when the frame is first loaded. See Frames page.
Frames page
A type of HTML page that consists of a group of frames, or a frame set. A frame set defines the
size and location of each frame on the page.
When a user follows a link to a frames page, the Web browser first loads the frame set, then loads
the pages referenced by the source URL for each frame in the frame set. See Frame.
Geocode
The process of assigning X and Y coordinates to records in a table or database so that the records
can be displayed as objects on a map.
Geographic Information System (GIS)
An organized collection of computer hardware and software designed to efficiently create,
manipulate, analyze, and display all types of geographically or spatially referenced data. A GIS
allows complex spatial operations that are very difficult to do otherwise.
Graticule
A grid of horizontal (latitude) and vertical (longitude) lines displayed on an earth map, spaced at a
regular distance (e.g., every five degrees, every fifteen degrees). Used to establish a frame of
reference.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
411
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix C: Glossary
Home page
Typically, the starting point of a Web application, the Home page is the page that is displayed by
default when a user accesses a Web site.
Within the HAHTsite IDE, the Web folder and each of its subfolders can have a Home page. The
Web folder's Home page is the Home page for the application.
Hypertext Markup Language (HTML)
A plain text (ASCII) language that enables developers to create Web pages, which can be
displayed by different Web browsers on different computing platforms. HTML uses tags to specify
the structure of the various parts of a document. HTML supports links (using URLs) that point to
other Web documents and files. The HAHTsite IDE supports HTML 2.0 plus many new features
from the draft HTML 3.2 standard.
HTML page
See Static page.
Hypertext Transfer Protocol (HTTP)
The message-based network interface between a Web client and a Web server. HTTP runs on top
of TCP/IP.
Hypertext link
Highlighted text in a Web page that connects to another Web page (anywhere on the Web) or to a
different part of the same Web page. Clicking on a hypertext link from a Web browser (usually
represented by underlined text) enables a user to jump to the location to which the link points.
Hypertext links are implemented with URLs (see URL–Uniform Resource Locator).
Image map
A file that defines the location, shape, and size of “hot spots” for a picture (either JPEG or GIF). A
URL is associated with each hot spot, so one graphic can perform several distinct actions. For
example, one part of a graphic might let users send mail to a Webmaster, another might let them
download a file, and another might bring them back to the site's Home Page. See also Client-side
Image Map (CSIM) and Server-side Image Map (SSIM) .
Integrated Development Environment (IDE)
A software tool that has all of the necessary development functions in one unified environment. In
other words, a full-function software tool suite that includes an extensible language with a
complete set of built-in functions, data types, and control structures, a professional debugger, and
support for team development.
Internet Server Application Programming Interface (ISAPI)
The API for Microsoft's Internet Information Server (IIS). ISAPI provides roughly equivalent
function to CGI, but without the overhead of creating a new process for every request. In addition,
ISAPI provides functions for error handling and security. The disadvantages to using ISAPI are
that the application can run only on Windows NT/IIS systems, and the application– if not written
well–can cause IIS to crash.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
412
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix C: Glossary
Latitude
The horizontal lines on a map that increase from 0 degrees at the Equator to 90 degrees at both
the North (+90.0 degrees) and South (-90.0 degrees) poles. Used to describe the north-south
position of a point as measured usually in degrees or decimal degrees above or below the
equator.
Layer
Basic building block of MapInfo MapX maps. A MapInfo map typically consists of several
superimposed layers (e.g., a layer of street data superimposed over a layer of county or ZIP Code
boundaries). When a table appears in a Map window, it occupies a layer in that Map window.
Typically, each map layer corresponds to one open table; there is also a special Cosmetic Layer
that contains map objects representing temporary map annotations (e.g., text).
Longitude
The vertical lines on a map, running from the North to South poles, used to describe the east-west
position of a point. The position is reported as the number of degrees east (to -180.0 degrees) or
west (to +180.0 degrees) of the prime meridian (0 degrees). Lines of longitude are farthest apart at
the Equator and intersect at both poles, and therefore, are not parallel.
Longitude/Latitude
MapInfo's default coordinate system for representing geographic objects in a map.
Meridian
A line or a portion of a line running from the North to the South pole. A longitudinal line.
Non-Earth map
A map in which objects are not explicitly referenced to locations on the earth's surface. Floor plans
are typical examples.
Netscape Server Application Programming Interface (NSAPI)
The API for Netscape servers. NSAPI provides roughly equivalent function to CGI, but without the
overhead of creating a new process for every request. In addition, NSAPI provides functions for
error handling and security. The disadvantages of using NSAPI are that the application can run
only on systems that are running Netscape servers and that the application– if not written well–can
cause the Netscape server to crash.
ODBC drivers
An ODBC driver is a dynamic-link library (.DLL) file that MapInfo uses to connect to an SQL
database. Each type of SQL database requires a different ODBC driver.
Pixel
The acronym for picture element. The smallest dot that can be displayed on a computer screen. If
a screen is described as having a resolution of 1,024 x 768, the screen shows 1,024 pixels from
right to left, and 768 pixels from top to bottom. Each character, object, or line on the screen is
composed of numerous pixels.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
413
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix C: Glossary
Project link
A reference to a page in a project. Optionally, a project link can reference a bookmark on a page.
Project links are local to the project in which you are working. When you drag a page's icon (from
the project window) to another page, you are creating a project link.
Projection
A mathematical model that transforms the locations of features on the earth's surface to locations
on a two-dimensional surface, such as a paper map. Since a map is an attempt to represent a
spherical object (the earth) on a flat surface, all projections have some degree of distortion. A map
projection can preserve area, distance, shape or direction but only a globe can preserve all of
these attributes. Some projections (e.g., Mercator) produce maps well suited for navigation. Other
projections (e.g., equal-area projections, such as Lambert) produce maps well suited for visual
analysis.
Server-Side Image Map (SSIM)
An image map file that resides on a Web server and is processed by a CGI-BIN script. This file is
distinct from the HTML page that uses the image map. When a user clicks an area on the map, the
browser sends the coordinates of the click to the Web server. The Web server processes the
information, converting the user's click to a URL. Contrast to Client-side Image Map (CSIM).
Site
The target server to which a project is published.
Site description
A project item that describes the site to which a project is published. A site description, which is
stored in the Sites folder, includes configuration information about the target server as well as
information about how and where to transfer the project's static and dynamic pages.
Static page
A standard HTML-compliant Web page. Static pages are stored on a Web server in their HTML
format, and are only updated when new versions of the pages are transferred to the server. In
contrast to Dynamic pages, static pages are not created by a HAHTsite Application Server; static
pages are sent directly to the user's browser. Developers can import static pages into a HAHTsite
project.
Uniform Resource Locator (URL)
The underlying implementation of a hypertext link or image map that contains the address of a
Web page or file somewhere on the World Wide Web. A URL contains information about the
network protocol to use (usually HTTP) and the path to the page or file. An URL example is “http://
www.haht.com/index.html,” which points to the index page for HAHT Software's Web site.
Web browser
Client-side software that requests Web pages from a Web server (by sending URLs) and displays
the pages to the user as hypertext, pictures, and other resources such as audio and video.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
414
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix C: Glossary
Web server
A computer system that runs the Hypertext Transfer Protocol and Web Server software. A Web
server accepts URL-based HTTP requests from a Web user's browser and sends HTML pages
back to the browser. A Web server can manage one or many Web sites. A commercial server, for
example, would typically have many Web sites. A Web server that serves Dynamic pages must be
running an instance of the HAHTsite Application Server.
Web site
A generic term that describes a collection of logically related Web pages that reside on a Web
server. A HAHTsite Web Application is a Web site that is created by the HAHTsite IDE and run by
a HAHTsite Application Server.
Web page
A generic term for an HTML file that is displayed by a Web browser. HAHTsite can create both
static and dynamic Web pages. See Static page and Dynamic page.
Wizard
A series of dialogs that facilitates and simplifies developer operations by presenting simple forms,
screens and prompts. An example is the Wizard the enables you to create a new site template.
WWW link
A complete URL that you can insert onto a page. HAHTsite simply passes the WWW link's string
to the project's page. You are responsible for ensuring that the link's string (URL) is valid.
Zoom layering
A setting that determines the range (e.g., 0-3 miles, 2-5 miles, etc.) at which a layer is visible in a
Map window.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
415
MapX_Mobile_DevGuide.pdf
D
Using the 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
(GeoDictionaryManager50.exe) can be run with a graphical user
interface or with command line parameters. The command line
options are useful for calling GeoDictionaryManager40.exe from
install programs to register the tables that a MapX application may
need to match against into the Geodictionary.
In this appendix:
Š
Š
Š
Š
Background Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
The Geodictionary File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
417
417
418
421
Developer Guide
Appendix D: Using the Geodictionary Manager
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 5.0 (or later versions), a permanent Geodictionary file is no longer required for MapX to
run.
Note:
There has been a change to the command line options that requires that file or path
names with spaces in them require that they be enclosed in double quotes. This may
make some command lines that worked previously fail now.
The Geodictionary File
The Geodictionary is contained in a binary format file usually called geodict.dct. The geodictionary
file can be located or disabled by using the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX 5.0\GeoDictionary. There are three valid
possibilities for this key:
•
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 inmemory 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 applications
MapX applications can share the same Geodictionary file, or use their own. In order for a MapX
application to use its own Geodictionary file (or to not use one at all), the Map.GeoDictionary
property can be changed at design time to point to a different registry entry. Then, when the map
control is initialized at runtime, MapX will query the following registry entry:
HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX 5.0\<value of Map.GeoDictionary>
The value of this registry entry will be interpreted as detailed above. The default value of
Map.GeoDictionary is “GeoDictionary” so that MapX will use the default registry entry.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
417
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix D: Using the Geodictionary Manager
The Geodictionary Manager always reads and updates the default Geodictionary file, referred to
by the registry key HKEY_LOCAL_MACHINE\SOFTWARE\MapInfo\MapX 5.0\GeoDictionary. If
you change the location of the Geodictionary file in the user interface, then the registry key is
updated to point to that new location.
The Geodictionary contains an entry for each registered table (mapinfo .tab file). The data stored
with each entry is:
•
A user-friendly name to refer to the table and to display in the layer control dialogs. This
defaults to the ‘Description’ tag in the .tab file, or the file name if none exists. It can be
edited through the user interface.
•
A list of indexed fields. The user interface allows you to check which of the indexed
fields you want MapX to consider as possible columns to match against during automatic
databinding. Fields that are not checked are ignored. When a table is first registered, all
indexed fields are initially checked by default.
•
A refining table name. Some tables, e.g., US Counties, contain indexed columns that are
not unique. In that situation, a refining table is necessary to determine an exact match for
data. If the table has non-unique indexed columns, the refining column combo box will be
enabled and the user will be able to pick a refining table.
•
A list of Geoset file names. When a table is selected during automatic databinding, the
list of geosets for that table is passed to the ResolveDataBind event for the MapX program
to choose one. MapX will pick the first one by default if the event is not handled. Note: The
table that was matched is always loaded, even if it is not in the geoset that gets loaded.
Also, it is not an error to have no geosets listed for a table in the Geodictionary. In that
case, only the table is loaded. Finally, only geoset files that are located in the same
directory as the Geodictionary file can be added to the list.
User Interface
This section describes the user interface for the Geodictionary Manager.
Run Geodictionary Manager
To run the GeoDictionary Manager when you want to manually register layers:
1. Start -> Programs -> MapInfo MapX x.0
2. Select a Geoset from the Windows Open Dialog.
3. In the Tools menu, select Run GeoDictionary Manager.
The Geodictionary dialog displays.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
418
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix D: Using the Geodictionary Manager
Part
Description
Geodictionary
The Geodictionary edit box is a read-only edit box containing the full path to the
Geodictionary that's being managed. This information is found by looking at the
MapX key in the registry. The button (to the right of the Geodictionary edit box) allows
the user to browse for another Geodictionary to manage. Browsing to another Geodictionary changes MapX's registry key so that all subsequent MapX sessions will use
the new dictionary. The button also lets you change the default MapX search path
which is stored in the registry key “HKEY_LOCAL_MACHINEOFTWAREapInfoap
X.0earchPaths”.
Registered tables
The Registered Tables list box contains a list of the friendly names for all tables registered in the Geodictionary.
Register
This displays the common file open dialog, with the Files of Type combo box set to
“MapInfo Tables (*.tab)”. Copy the table to the data directory (the directory containing
the Geodictionary), or add the directory containing the table to the data search path.
After the table has been assimilated (either by copying or by adding the directory to
the search path), the Table Properties dialog displays. Users can select multiple files
to register by holding Ctrl/Shift key down while clicking. In cases of multiple tables
being selected, the properties button is disabled. See the Table Properties Dialog.
Unregister
Remove the selected table from the Geodictionary. The Unregister button will not
remove the files from the disk. Users can select multiple files to unregister by holding Ctrl/Shift key down while clicking.
Properties
Display the Table Properties dialog for the selected table. See the Table Properties
dialog below.
Set the Geodictionary fields for a given table using the Table Properties Dialog.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
419
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix D: Using the Geodictionary Manager
Part
Description
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
420
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix D: Using the Geodictionary Manager
Part
Remove
Description
Deletes the selected geoset file name from the list of candidate geosets.
Register Layers in Geodictionary
If you want the Geoset Manager to automatically register your layers, choose Tools > Register
Layers. The Register Layers dialog displays.
Check the layers you want to register and click OK.
Command Line Options
The Geodictonary Manager command line provides a mechanism for adding and removing tables
to/from the Geodictionary.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
421
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix D: Using the Geodictionary Manager
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
422
MapX_Mobile_DevGuide.pdf
MapX Events
In this appendix:
Š
Š
Stock Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Custom Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
E
Developer Guide
Appendix E: MapX Events
Stock Events
MapX supports the following stock events:
Event
OLE Dispatch ID
Description
Click
-600
The user presses and releases a mouse button.
DblClick
-601
The user double-clicks.
KeyDown
-602
The user presses down on a key. Useful for building modifiers for
mouse activities.
KeyPress
-603
The user presses a key.
KeyUp
-604
The user releases a key.
MouseDown
-605
The user presses a mouse button.
MouseMove
-606
The user moves the mouse. Can be used to displays cursor coordinates in the Status Bar.
MouseUp
-607
The user releases a mouse button.
Error
-608
An error occurs during an asynchronous activity such as a redraw, or
when a user is using a map tool.
Custom Events
MapX supports the following custom events:
Event
Dispatch ID
Called…
AddFeatureToolUsed event
16
when an Add Feature tool is used.
AnnotationAdded event
7
when annotation is added.
AnnotationChanged event
8
when annotation is added, modified, or deleted.
DataMismatch event
5
during data binding, if a row doesn't match.
DrawUserLayer event
10
when the map window needs updating and the application has created a UserDraw layer.
LabelChanged event
17
whenever a label is about to be added, selected, deselected, or moved.
MapDraw event
15
once before a draw, and once after a draw is completed.
MapInitialized event
13
after map initialization is complete.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
424
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
Event
Dispatch ID
Called…
MapViewChanged event
6
when the map's minimum bounding rectangle has
changed (e.g., when you zoom or pan).
MouseWheel event
12
when a user uses the mouse wheel.
PolyToolUsed event
11
when user uses a polytool (e.g., to draw a polyline).
RequestData event
4
to request data from a cell container when dealing with
unbound data.
ResolveDataBind event
2
during automatic data binding, if data is ambiguous.
ResolveDataBindEx event
14
when it has the same function as the ResolveDataBind Event, but it passes a collection of ResolveObjects instead of a string array.
SelectionChanged event
1
when the selection changes.
ThemeModifyRequested event
9
when user double-clicks legend.
ToolUsed event
3
when user uses a tool on the map.
Depending on your development environment, you may be able to use other events as well. For
example, Visual Basic provides support for these events: DragDrop, DragOver, GotFocus,
LostFocus.
AddFeatureToolUsed event
This event is called whenever the user uses one of the standard object creation tools
(miAddPointTool, miAddLineTool, miAddPolylineTool, or miAddRegionTool). The behavior of this
event is similar to the PolyToolUsed Event.
Dispatch ID = 16
Syntax
AddFeatureToolUsed(ToolNum, Flags, Feature, Shift, Ctrl, EnableDefault)
Part
Description
ToolNum
Indicates the tool number of the Add Feature tool.
Flags
A ToolFlagConstants value; this indicates whether the user is starting, in
the process of, or finishing the tool use.
Feature
A Feature object representing the feature that the user has created thus far.
Shift, Ctrl
Boolean values that indicate whether modifier keys (SHIFT, CTRL) were
pressed at the time the event was fired; True indicates that a key was
pressed.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
425
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
Part
EnableDefault
Description
Boolean. This parameter controls whether MapX allows the tool's standard
behavior to take effect. Default value is True. To prevent the tool's standard
behavior (e.g., to cancel the user's action), set this parameter to False. This
parameter only takes effect when the user concludes the tool use
(miToolEnd).
Remarks
This event is fired multiple times during every use of the object creation tools:
Once at the beginning of the tool use, when the user clicks to place the first node of the feature.
During this call, the Flags variable is set to miToolBegin (0).
For the Add Polyline and Add Region tools, it is fired once for every time the user clicks to add
another node, and also for every time the user deletes a node by pressing the BACKSPACE key.
During this call, the Flags variable has a value equal to miToolInProgress (3).
Fired once at the end of the tool use, when the user performs one of these actions:
•
Ends the drawing of the feature by double clicking (polyline and polygon tools) or
releasing the mouse (line and point tools), in which case the Flags variable will be set to
miToolEnd (1); -or-
•
Presses the ESC key to end the add feature tool, in which case the Flags variable will be
set to miToolEndEscaped (2); -or-
•
Uses the backspace key to delete all of the nodes, in which case the Flags variable will be
set to miToolEndEscaped (2).
The event is fired one last time after miToolEnd and the value of the Flags parameter is set to
miToolCompleted (4).
AnnotationAdded event
Purpose
This event that is called whenever an annotation is added, modified, or deleted. It is called right
before the annotation is changed. The programmer also has an opportunity to prevent the
operation.
Dispatch ID = 7
Syntax
AnnotationChanged event
Purpose
This is an event that is called whenever an annotation is added, modified, or deleted. It is called
right before the annotation is changed, and the programmer has an opportunity to prevent the
operation.
Dispatch ID = 8
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
426
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Appendix E: MapX Events
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
changetype
Object pointer to the annotation object
EnableDefault
Boolean. This parameter controls whether MapX allows the Annotations’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 Annotation.
See Also
AnnotationChangedTypeConstants in Appendix G on page 447
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 does not match.
ByValrow
This is the row number (as long) in the general data source that does not
match.
GeoColValue
This is a string value of the field in the dataset that does not 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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
427
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
Syntax
DrawUserLayer (Layer, hOutputDC, hAttributeDC, RectFull, RectInvalid)
Part
Description
Layer
Layer object: the layer to draw.
hOutputDC
OLE_HANDLE: device context to draw to.
hAttributeDC
OLE_HANDLE: device context to draw to; usually the same as hOutputDC, except when
drawing to a metafile device context.
RectFull
Rectangle object: the full window.
RectInvalid
Rectangle object: the invalidated area.
The rectangles are objects of type Rectangle. The coordinates in the rectangles are screen
(client) coordinates.
Remarks
You can also add a UserDrawLayer via Layers.Add.
LabelChanged event
MapX fires this event whenever a label is about to be added (via the stock Label tool), selected,
deselected, or moved (via the stock Select tool). The MapX programmer has the opportunity to
prevent the operation by setting the EnableDefault value to False.
Note:
This event is only fired for changes made via user interaction (like selecting the label or
moving it). NOT through programmatic changes. For example, Label.AnchorX = -110 will
not fire the event, even though it does move the label.
Syntax
LabelChanged (ChangeType, ChangingLabels, *EnableDefault)
Dispatch ID = 17
Part
Description
changetype
Integer: The type of change that is about to occur (miLabelMove, miLabelAdd, or miLabelSelectionChange)
ChangingLabels
Labels object: Represents a collection of Label objects that are about to change. This
has the same interface as the Layer object’s Labels collection (i.e., it has a Count and
[Item] property).
*EnableDefault
Boolean: Controls whether the MapX default behavior is allowed to take effect. Default
value is True. If you set this to false in the event handler, MapX will ignore the user
interaction about to change the label.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
428
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
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.
Dispatch ID = 15
Syntax
MapDraw (Flag)
Part
Flag
Description
Either miDrawBegin or miDrawEnd.
See Also
MapDrawConstants in Appendix G on page 457
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
429
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
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) or miToolTypePolygon
(5).
Dispatch ID = 11
Syntax
PolyToolUsed(ToolNum, Flags, Pts, Shift, Ctrl, EnableDefault)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
430
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
Part
Description
ToolNum
Indicates the custom tool number.
Flags
A PolyToolFlagConstants value; this indicates whether the user is starting or finishing
the tool use.
Pts
A collection of points (the same kind as used in Feature.Parts.Add).
Shift, Ctrl
Boolean values that indicate whether modifier keys (SHIFT, CTRL) were pressed at the
time the event was fired; True indicates that a key was pressed. For the standard tool
miPolygonSelectTool, MapX only uses the state of these keys when the user concludes
the tool use (i.e., when the Flag parameter is miPolyToolEnd).
EnableDefault
Boolean. If this event was triggered by the standard miPolygonSelectTool, this parameter controls whether MapX allows the tool's standard behavior to take effect. Default
value is True. To prevent the tool's standard behavior (e.g., to cancel the user's action),
set this parameter to False. This parameter only takes effect when the user concludes
the tool use (miPolyToolEnd).
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
431
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
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 geocolumn,
multiple geosets are available for the matched map layer. In these cases, MapX will take the first
one, unless the following ResolveDataBind event handler is defined. If defined, MapX will call it,
and let the handler choose which one to use.
Dispatch ID = 2
Syntax
ResolveDataBind (flag, nummatches, matches, choice, cancel )
Part
Description
flag
Indicates if the event is being called because of multiple geocolumns (0), multiple layers
(1), or multiple geosets (2).
nummatches
Indicates how many entries are in the matches array. The array of strings matches contains list of matches.
matches
Variant: Represents an array of strings.
choice
The return variable. 1 based. 0 means auto–select and has MapX choose the best one).
cancel
Allows the user to cancel the data bind and causes it to fail.
Remarks
ResolveDataBind could get fired 3 times.
First, it chooses columns in the source table, then for the chosen column it chooses a table if there
are > 1, and lastly, for the table it chooses geosets if there are > 1.
The geodictinonary lists geosets for each table.
ResolveDataBindEx event
Purpose
This event has the same function as the ResolveDataBind event, but it passes a collection of
ResolveObjects instead of a string array. So, for situations like multiple geocolumns being
detected in the user data, multiple layers detected that match the geocolumn, 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 )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
432
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
Part
Description
flag
Indicates the event is being called because of multiple geocolumns. 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 multiple geocolumns 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
433
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix E: MapX Events
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
434
MapX_Mobile_DevGuide.pdf
F
MapX Error Codes
This is a table of the MapX errors encountered when writing MapX
applications. For information on handling errors in Visual Basic and
Delphi, see the respective programmer's reference book and/or help
system
.
Error
Description
1000
Out of memory.
1001
Property or method not implemented.
1002
Property not supported by themes of this type.
1003
Object is no longer valid.
1004
No object was found using the index you specified.
1005
Invalid DataSet type specified.
1006
Non-Unique Name specified. (Name already in use by another object).
1007
Invalid GeoField specified. Name not found, or index out of range.
1008
Invalid Secondary GeoField specified. Name not found, or index out of range.
1009
Unable to match a GeoField or BindLayer automatically.
1010
Invalid Fields parameter.
1011
Unexpected error in MapX.
1012
Invalid Theme type specified.
1013
Unexpected error.
1014
No key column was found in the specified dataset. Cannot create theme.
1015
The DataBinding process was cancelled by setting the cancel property in the ResolveDataBind
event.
1016
Invalid aggregation function specified.
1017
No source field specified.
1018
Invalid field type specified.
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1019
Unable to refresh dataset.
1020
Cannot find the BindLayer for this dataset. Unable to create theme.
1021
Unable to create theme.
1022
Invalid ranges.
1023
Invalid number of ranges.
1024
Theme categories cannot be removed.
1025
Invalid distribution method.
1026
Invalid fill pattern.
1027
Invalid pen style.
1028
Invalid Fields Parameter - Name or index of a field not found.
1029
Could not create a default theme.
1030
This property is available at design time only.
1031
Layer specified is not matchable.
1032
Matched or specified Layer is not in any GeoSets.
1033
Invalid Name parameter specified.
1034
The color you specified is invalid.
1035
Invalid Spread by value.
1036
Invalid pen width.
1037
The Coordinate specified was not within the bounds of the map's Numeric CoordSys.
1038
Invalid Zoom specified. Zoom must be > 0.
1039
Invalid Tool specified. The tool number is invalid or doesn't exist, or the tool type or cursor is
invalid.
1040
Invalid paper unit specified.
1041
Invalid mouse pointer specified.
1042
Invalid export format specified.
1043
Unable to create specified file.
1044
An ODBC error has occurred: <error>.
1045
Invalid ODBCQueryInfo object specified. Object not of correct type or SqlQuery not specified.
1046
Property not supported for annotations of this type.
1047
Invalid character code. Value must be between 0 and 255.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
436
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1048
Cannot create a theme of this type based on an attribute data column that has been aggregated
by individual value.
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
Invalid 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
437
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1077
Unable to set or retrieve label style information.
1078
Feature object is no longer valid.
1079
Unable to find or load Helper Dialog DLL.
1080
Error initializing Helper Dialog DLL. Check DLL version.
1081
For the geofield specified or auto detected a secondary geofield is required, and one was not
specified or auto detected.
1082
Fields Add or Remove not allowed after dataset has been created.
1083
Property or Method not supported by layers of this type.
1084
A Lotus Notes error has occurred: <error>.
1085
Invalid NotesViewInfo object specified. Object not of correct type or Database or View not specified.
1086
A numeric overflow or underflow has occurred during a coordinate conversion. Under Windows95/
98, all coordinates are limited to the range of -32767 to +32767. The actual screen or map coordinates may be in range, but the conversion overflowed. See IsPointVisible or ClipLine.
1087
Attempt to set the Animation Layer to an object which is not a valid layer object.
1088
Invalid Filespec parameter.
1089
Invalid DataSet specified.
1090
Feature Type Invalid or not applicable.
1091
Operation not allowed on a standalone feature object.
1092
Error updating feature object.
1093
Error adding feature object.
1094
Error deleting feature object.
1095
Feature property or method not valid for feature type.
1096
Error reading Feature from layer.
1097
A line must have at least 2 points. A region must have at least 3 points.
1098
Invalid rectangle specified.
1099
Cannot find a specified Field in the DataSet.
1100
Invalid Features object.
1101
Invalid Search type specified.
1102
Invalid Search precision specified.
1103
Invalid Points object.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
438
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1104
Invalid Point object.
1105
Invalid Style object.
1106
Attempt to use a new Symbol or Text feature object without first setting the Point property.
1107
Invalid Area unit specified.
1108
Every Feature in a Features collection object must be from the same layer.
1109
Key field not found in layer.
1110
The Layer that the Feature or Features object is from is no longer valid.
1111
Variant could not be converted to the appropriate type.
1112
The reference layer specified has no matchable columns, and therefore cannot be used as a reference layer.
1113
Creating bitmap image failed on map export.
1114
Invalid Circle Type specified.
1115
Resolution must be >= 3.
1116
Invalid Datum object.
1117
Invalid CoordSys object.
1118
Invalid units specified.
1119
Invalid origin longitude specified.
1120
Invalid origin latitude specified.
1121
Invalid standard parallel #1 specified.
1122
Invalid standard parallel #2 specified.
1123
Invalid azimuth specified.
1124
Invalid scale factor specified.
1125
Invalid false easting specified.
1126
Invalid false northing specified.
1127
Invalid range specified.
1128
Invalid bounds specified.
1129
Invalid AffineInfo object.
1130
Datum has not been specified.
1131
Units have not been specified.
1132
Origin longitude has not been specified.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
439
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1133
Origin latitude has not been specified.
1134
Standard parallel #1 has not been specified.
1135
Standard parallel #2 has not been specified.
1136
Azimuth has not been specified.
1137
Scale factor has not been specified.
1138
False easting has not been specified.
1139
False northing has not been specified.
1140
Range has not been specified.
1141
Bounds have not been specified.
1142
Invalid CoordSys type specified.
1143
Invalid AffineTransform object.
1144
Degenerate AffineTransform specified.
1145
Custom dataset error.
1146
The map contains no layers. The Geoset was not saved.
1147
The map contains temporary or userdraw layers. Those layers were not included in the saved
Geoset.
1148
Dataset type does not support dynamic column binding.
1149
Style object does not support bitmap symbols.
1150
Invalid symbol type specified.
1151
Attempt to restore a dataset by name for which there was no saved dataset.
1152
Custom dataset error. Method failed: IMMapXColumnInfoContainer::GetColumnInfoEnumerator.
1153
Custom dataset error. Method failed: IMEnumMapXColumnInfo::Reset.
1154
Custom dataset error. Required interface not supported: IMMapXColumnInfoContainer.
1155
Custom dataset error. Method failed: IMMapXColumnInfo::GetColumnName.
1156
Custom dataset error. Method failed: IMMapXColumnInfo::GetColumnNumber.
1157
Custom dataset error. Method failed: IMMapXColumnInfo::GetDataType.
1158
Custom dataset error. A column contains an unsupported type.
1159
Custom dataset error. Method failed: IMMapXDataset::GetSample.
1160
Custom dataset error. Method failed: IMMapXStaticDataset::BeginFetch.
1161
Custom dataset error. Method failed: IMMapXStaticDataset::FetchData.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
440
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1162
Custom dataset error. Method failed: IMMapXStaticDataset::EndFetch.
1163
Custom dataset error. Method failed: IMMapXDynamicDataset::FetchData.
1164
Custom dataset error. Method failed: IMMapXDataset:Init.
1165
Custom dataset error. Could not find a CLSID for the type of custom dataset specified. Check that
the custom dataset is properly registered.
1166
Custom dataset error. Could not create the custom dataset object. Check that the custom dataset
is properly registered.
1167
Operation not allowed due to license restrictions.
1168
Unable to open one of the Drilldown component tables.
1169
Unable to reset Drilldown layer to specified level.
1170
The Feature is too complex. There are too many parts or points in the Feature object.
1171
A Line or Region Feature must have at least 1 Part.
1172
The stand-alone Feature object is not attached to the map. Use Feature.Attach() before other
Feature methods or properties.
1173
Unable to attach Feature to the map. Make sure Map object is valid.
1174
Error creating buffer.
1175
Operation not allowed on an empty Features collection.
1176
Invalid parameter combination.
1177
Invalid Caption parameter specified.
1178
Invalid Intersection Point flag specified.
1179
Invalid Intersection Test flag specified.
1180
Error Combining Features
1181
Invalid Arc Distance specified.
1182
Invalid Angle specified.
1183
Missing or Invalid RefineBoundary specified in Search method.
1184
XY and PointRef datasets are not allowed with dynamic binding.
1185
Custom dataset error. Required interface not supported.
1186
Custom dataset error. GetSample must return an array.
1187
Custom dataset error. Unsupported type returned.
1188
Error saving geoset.
1189
Unable to find file <file> needed by the coordsys dialog.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
441
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1190
Layer.UpdateFeature(Target, Source) - 'Target' must be a feature from 'Layer'.
1191
Range and individual value themes are not available on SpatialWare layers.
1192
The find method is not available on SpatialWare layers.
1193
Operation not allowed on a map with no layers.
1194
Empty Text Annotations not allowed.
1195
Failed adding key <key> from drilldown level <level>; possibly others failed. Key Field not
indexed?
1196
Failed removing key <key> from drilldown level <level>; possibly others failed.
1197
Invalid minimum zoom value specified. Zoom values must be greater than zero.
1198
Invalid maximum zoom value specified. Zoom values must be greater than zero.
1199
Setting Value not allowed unless ComputeTheme is false.
1200
Invalid style unit value specified.
1201
Cannot add a theme of type miThemeNone.
1202
The ShowCount property is only supported for ranged and individual value themes.
1203
The maps display coordinate system cannot be modified while the map contains visible raster layers.
1204
This line style does not support interleaved styles.
1205
No feature was found using the name you specified.
1206
The AllOthersText property is only supported for ranged and individual value themes.
1207
Invalid Match Threshold specified. Percentage must be between 1 and 100.
1208
The ShowCount property cannot be set to true, when ComputeTheme is false.
1209
The text font size property cannot be changed, when overriding a layer style.
1210
Invalid cache option.
1211
Cannot load specified cursor.
1212
Error occurred while searching within a layer.
1213
Error occurred while updating or drawing the selection.
1214
Invalid feature ID.
1215
Unable to retrieve or set the theme style information.
1216
Error while accessing thematic object.
1217
Error occurred while creating the theme.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
442
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1218
Error occurred while accessing the thematic modifier.
1219
Error occurred while recalculating the theme.
1220
The theme ranges are invalid. Please verify that the ranges do not overlap. You may want to set
AutoRecompute to FALSE when setting custom theme ranges.
1221
This property or method is only supported for themes with custom ranges.
1222
Invalid theme category index specified.
1223
This property or method is not supported for the all others category.
1224
Invalid Layer MBRSearch option specified.
1225
Invalid predominant object type.
1226
Operation not allowed on this datasets collection.
1227
Dataset created without SourceRow information. See Datasets.BuildSourceRows.
1228
This property or method is only supported when ComputeTheme is false.
1229
Error occurred while setting the number of categories for the theme.
1230
A file named <filename> already exists.
1231
Unable to open file <filename>. Verify that the file exists and that you have sufficient access rights
to open it.
1232
Unable to open file <filename>. Verify that the file exists in either the geodictionary directory or on
the list of search paths. Also make sure that you have sufficient access rights to open it.
1233
Error writing file during export.
1234
Invalid BeginAccessType or Invalid EndAccessType.
1235
Theme value must be positive.
1236
This property is not supported for stacked bar charts.
1237
This property is only supported for stacked bar charts.
1238
The GraduateSizeBy property is only supported for graduated stacked bar charts and for bar
charts which are not stacked or independently scaled.
1239
Invalid LayerInfo parameter specified.
1240
Error adding LayerInfo parameter.
1241
Expected LayerInfo parameter <parameter name> is either missing or invalid.
1242
Couldn't open <table name>. Table not found in the geodictionary.
1243
This property is not supported for the current symbol type. The symbol type must match the type
of symbol for which you are changing properties.
1244
Theme deserialization error occurred.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
443
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
1245
Theme serialization error occurred.
1246
Theme recreation error occurred.
1247
Cannot modify layer. Table may be readonly.
1248
Invalid Expression Parameter specified.
1249
Error occurred while creating the legend.
1250
Legend deserialization error occurred.
1251
Legend serialization error occurred.
1252
Legend recreation error occurred.
1253
Table is not mappable. Make sure table has an object column. If table is a server table, make sure
that there is an entry in the MapInfo MapCatalog for it.
1254
Invalid closematch max value specified. Closematch values must be greater than or equal to zero.
1255
Invalid rounding value specified.
1256
This property can only be set when the RoundRanges property is set to true.
1257
This property can only be set when the SpreadBy property is set to miSpreadByColor.
1258
This property can only be set when the InflectRanges property is set to true.
1259
An invalid inflection range index was specified.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
444
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix F: MapX Error Codes
Error
Description
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.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
445
MapX_Mobile_DevGuide.pdf
G
Constants
This section lists the MapX constants and their values
AggregationFunctionConstants
AnnotationChangedTypeConstants
AnnotationTypeConstants
ApplyAttributeConstants
AreaUnitConstants
BindLayerTypeConstants
CircleTypeConstants
ColorConstants
ColorSpreadingMethodConstants
ConversionConstants
CoordSysTypeConstants
CursorConstants
DataSetTypeConstants
DistribMethodConstants
DotSizeConstants
ExportFormatConstants
FeatureEditModeConstants
FeatureTypeConstants
FieldTypeConstants
FillPatternConstants
GraduationConstants
IntersectionPointConstants
IntersectionTestConstants
LabelAlongConstants
LayerBeginAccessConstants
LayerEndAccessConstants
LayerInfoTypeConstants
LayerPackConstants
LayerSrvLayerOptions
LayerTypeConstants
LineTypeConstants
MapDrawConstants
MapUnitConstants
MouseWheelSupportConstants
PaperUnitConstants
PenStyleConstants
PolyToolFlagConstants
PositionConstants
ResolveDataBindConstants
SearchTypeConstants
SearchResultTypeConstants
SelectionTypeConstants
SpreadByConstants
StyleUnitConstants
SymbolTypeConstants
ThemeTypeConstants
ToolConstants
ToolFlagConstants
ToolTypeConstants
AggregationFunctionConstants
miAggregationSum = 0
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
447
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
miUnitSquarePoint = 25
miUnitSquarePica = 26
miUnitSquareDegree = 27
miUnitAcre = 28
miUnitHectare = 29
miUnitSquareLink = 33
miUnitSquareChain = 34
miUnitSquareRod = 35
miUnitPerch = 36
miUnitRod = 37
BindLayerTypeConstants
miBindLayerTypeNormal = 0
miBindLayerTypeXY = 1
miBindLayerTypePointRef = 2
CircleTypeConstants
Constant
Value
Description
miCircleTypeScreen
0
The CreateCircularRegion method 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.
miCircleTypeMap
1
The CreateCircularRegion method creates a region whose points are all
the same geographic distance from the center. However, depending on
which display coordinate system and projection are in use, the region
might appear distorted, rather than “circular.”
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
448
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
449
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
miColorHighlightText = 0x8000000E
miColorButtonFace = 0x8000000F
miColorButtonShadow = 0x80000010
miColorGrayText = 0x80000011
miColorButtonText = 0x80000012
miColorInactiveCaptionText = 0x80000013
miColor3DHighlight = 0x80000014
miColor3DDarkShadow = 0x80000015
miColor3DLight = 0x80000016
miColorInfoText = 0x80000017
miColorInfoBackground = 0x80000018
ColorSpreadingMethodConstants
miColorMethodRGB = 0
miColorMethodHSV = 1
ConversionConstants
miMapToScreen = 0
miScreenToMap = 1
CoordSysTypeConstants
Constant
Value
miAlbersEqualAreaConic
9
miAzimuthalEquidistant
5
miCylindricalEqualArea
2
miEckertIV
14
miEckertVI
15
miEquidistantConic
6
miGall
17
miHotineObliqueMercator
7
miLambertAzimuthalEqualArea
4
Description
Polar aspect only
Also known as Simple Conic
Polar aspect only
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
450
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
Constant
Value
Description
miLambertConformalConic
3
miLambertConformalConicBelgium
19
Modified for Belgium 1972
miLongLat
1
Longitude/Latitude
miMercator
10
miMillerCylindrical
11
miMollweide
13
miNewZealandMapGrid
18
miNonEarth
0
miRobinson
12
miSinusoidal
16
miStereographic
20
miSwissObliqueMercator
25
miTransverseMercator
8
Also known as Gauss-Kruger
miTransverseMercatorDenmarkS34J
21
Modified for Danish System 34 Jylland-Fyn
miTransverseMercatorDenmarkS34S
22
Modified for Sjaelland
miTransverseMercatorDenmarkS45B
23
Modified for Danish System 45 Bornholm
miTransverseMercatorFinland
24
Modified for Finnish KKJ
miMercatorStdParallel
26
Regional Mercator
miPolyconic
27
Polyconic
miAzimuthalEquidistantEqualOblique
28
Azimuthal Equidistant (all origin latitudes)
miLambertAzimuthalEqualArea
Oblique
29
Lambert Azimuthal Equal-Area (all origin latitudes)
miCassiniSoldner
30
Cassini - Solder
Unprojected; cartesian coordinates
CursorConstants
miDefaultCursor = 0
miArrowCursor = 1
miCrossCursor = 2
miIBeamCursor = 3
miIconCursor = 4
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
451
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
452
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
miDrillDownExpandCursor = 37
miDrillDownContractCursor = 38
miInfoCursorOld = 39
miCustomCursor = 40
DataSetTypeConstants
miDataSetDAO = 1
miDataSetODBC = 2
miDataSetUnbound = 3
miDataSetGlobalHandle = 4
miDataSetOLEData = 5
miDataSetLayer = 6
miDataSetNotesView = 7
miDataSetNotesQuery = 8
miDataSetSafeArray = 9
miDataSetOCI = 15
miDataSetDelphi = 1010
miDataSetDelphi4 = 1011
miDatasetDelphi5 = 1012
miDataSetADO = 12
miDataSetRDO = 13
miDatasetXML = 14
DistribMethodConstants
miCustomRanges = 0
miEqualCountPerRange = 1
miEqualRangeSize = 2
miNaturalBreak = 3
miStandardDeviation = 4
DotSizeConstants
miDotSizeSmall = 0
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
453
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
miDotSizeLarge = 1
ExportFormatConstants
miFormatWMF = 0
miFormatBMP = 1
miFormatGIF = 2
miFormatJPEG = 3
miFormatTIF = 4
miFormatPNG = 5
miFormatPSD = 6
FeatureEditModeConstants
miEditModeFeature = 0x1
miEditModeNode = 0x2
miMoveDuplicateNodes = 0x4
miDeleteDuplicateNodes = 0x8
miEditModeAddNode = 0x40
FeatureTypeConstants
miFeatureTypeRegion = 0
miFeatureTypeLine = 1
miFeatureTypeSymbol = 2
miFeatureTypeMixed = 3
miFeatureTypeUnknown = 4
miFeatureTypeText = 5
miFeatureTypeNull = 6
miFeatureTypeMultipoint = 7
miFeatureTypeCollection = 8
FieldTypeConstants
miTypeString = 0
miTypeNumeric = 1
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
454
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
455
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
LabelAlongConstants
miLabelAlongNone = 0
miLabelAlongParallel = 1
miLabelAlongMultiSegment = 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
LayerPackConstants
miPackGraphics = 1
miRebuildGraphics = 2
miPackIndex = 4
miPackRebuildIndex = 8
miPackData = 16
miPackCompactDB = 32
miPackAll = 21 (miPackGraphics & miPackIndex & miPackData)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
456
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
457
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
458
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
459
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
miSearchTypePartiallyWithin = 1
miSearchTypeEntirelyWithin = 2
SearchResultTypeConstants
miSearchResultDefault = 0x0000
miSearchResultTopmost = 0x0001
miSearchResultRegion = 0x0002
miSearchResultPoint = 0x0004
miSearchResultLine = 0x0008
miSearchResultText = 0x0010
miSearchResultAll = 0xFFFE
miSearchResultMultipoint = 0x0020
miSearchResultCollection = 0x0040
SelectionTypeConstants
miSelectionNew = 0
miSelectionAppend = 1
miSelectionRemove = 2
SpreadByConstants
miSpreadByColor = 1
miSpreadByNone = 0
miSpreadBySize = 2
StyleUnitConstants
miStyleUnitPixel = 0
miStyleUnitTenthsOfPoint = 1
SymbolTypeConstants
miSymbolTypeBitmap = 1
miSymbolTypeTrueTypeFont = 0
miSymbolTypeVector = 2
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
460
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
ThemeTypeConstants
miThemeRanged = 0
miThemeBarChart = 1
miThemePieChart = 2
miThemeGradSymbol = 3
miThemeDotDensity = 4
miThemeIndividualValue = 5
miThemeAuto = 6
miLabelRangedTheme = 7
miLabelIndividualValuesTheme = 8
miThemeNone = 9
ToolConstants
miArrowTool = 1000
miPanTool = 1001
miCenterTool = 1002
miZoomInTool = 1003
miZoomOutTool = 1004
miSymbolTool = 1005
miTextTool = 1006
miSelectTool = 1007
miRadiusSelectTool = 1008
miRectSelectTool = 1009
miPolygonSelectTool = 1010
miLabelTool = 1011
miAddLineTool = 1012
miAddPolylineTool = 1013
miAddRegionTool = 1014
miAddPointTool = 1015
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
461
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix G: Constants
ToolFlagConstants
miToolBegin = 0
miToolEnd = 1
miToolEndEscaped = 2
miToolInProgress = 3
ToolTypeConstants
miToolTypePoint = 0
miToolTypeLine = 1
miToolTypeCircle = 2
miToolTypeMarquee
=3
miToolTypePoly = 4
miToolTypePolygon = 5
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
462
MapX_Mobile_DevGuide.pdf
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".
The DataSet.AddField method uses expressions to create a new
field by applying an expression to the existing columns. These
expressions can evaluate to a date, numerical, or string value, as in
“Female_Pop + Male_Pop” or “Proper$(City) + “”, “” + UCase$(State)”
Expressions are formed using dataset field names, constants (i.e.,
specific data values), or variable substitutions, along with functions
and operators which act upon the columns and constants.
MapX allows for the use of variable substitution in expressions. An
expression can contain a reference to a variable name. A variable is a
name along with a variant. When the expression sees an unresolved
identifier it will try to resolve it in the variables collection. The variant
can be of any type (date, string, number, etc., or MapX Feature
object.)
String constants in expressions should be enclosed in double quotes
so that MapX knows to treat it as a string, rather than thinking it is a
dataset field name or variable.
In expressions, MapX will perform a type conversion from boolean to
string for function parameters that expect a string argument.
When specifying dates as string constants, the following applies:
•
Dates consist of a month, a day, and an optional year.
•
The year is specified by four digits.
•
The entire date string should be enclosed in double quotes.
•
The components of a date can be separated by hyphens or
slashes.
In this appendix:
H
Developer Guide
Š
Š
Appendix H: Creating Expressions
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
464
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Operators
Below is a list of the operators used in MapX and related topics.
Operators:
•
•
•
•
•
•
•
•
•
Geographic operators
Mathematical operators
String operators
Comparison operators
Numerical Comparison
String Comparison
Date Comparison
Logical Comparison
Logical operators
Related Topics:
•
•
•
•
String Clauses
Date Clauses
Keywords
Operator Precedence
Geographic operators
MapX supports several geographic operators: contains, contains_within, entirely_within,
intersects, and within. These operators can be used in any MapX expression. All geographic
operators are infix operators (i.e., they operate on two objects and return boolean).
Operator
Evaluates true if the:
object1 CONTAINS object2
Centroid of second object is within the first object.
object1 CONTAINS ENTIRE object2
Second object is entirely inside the first object.
object1 CONTAINS PART object2
First object touches second object.
object1 ENTIRELY WITHIN object2
First object is entirely inside the second object.
object1 INTERSECTS object2
First object touches second object
object1 PARTLY WITHIN object2
First object touches second object.
object1 WITHIN object2
Centroid of first object is within the second object.
Mathematical operators
A+B
+
addition
A-B
-
subtraction
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
465
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
-A (negative)
-
negation
A*B
*
multiplication
A/B
/
division
A\B
\
integer division
A^B
^
exponentiation
Note that you can:
•
Add numbers to dates to yield another date.
•
Subtract a number from a date to yield another date.
•
Subtract a date from a date to yield a number.
When you add numbers to dates, or subtract numbers from dates, MapX treats the numbers as
specifying a number of days. If you want to add or subtract a week, you would use the number 7.
When you want to add or subtract a month, you could use 30 or 31. When MapX subtracts a date
from a date, the resulting number indicates a number of days.
String operators
&
“concatenation” — connects strings and string expressions.
+
“concatenation” — connects strings and string expressions.
Note:
Remember that string constants must be enclosed in double quotes.
Comparison operators
=
“equals”
<>
“not equals”
>
“greater than”
<
“less than”
>=
“greater than or equal to”
<=
“less than or equal to”
Numerical Comparison
Numerical comparisons are based on the numerical values of the expressions and numerical
constants.
Example
All rows where the median age is 42.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
466
MapX_Mobile_DevGuide.pdf
Developer Guide
•
Note:
Appendix H: Creating Expressions
MED_AGE=42
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.
•
Note:
VENDOR=”Acme”
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.
•
Note:
•
RECEIVED>stringtodate(“10-9-91”)
This expression does not select those received on October 9, 1991. When you want them
as well, use the “>=” operator
RECEIVED>=stringtodate(“10-9-91”)
Example
Records for all received before August, no matter what year.
•
Month(RECEIVED)<8
Logical Comparison
Example
All that have shipped.
•
Note:
Shipped
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
467
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Example
All that have not shipped.
•
Str$(Shipped)=”F”
•
Not Shipped
Logical operators
and
Is “true” if (and only if) both of its arguments (the expressions it joins
together) are true. A record must satisfy both of these conditions if it is to be
selected.
or
is “true” if either one, or both, of its arguments (the expressions it joins
together) are true. A record need satisfy only one of these conditions if it is
to be selected. It is also selected if both of its conditions are satisfied.
not
is “true” if its argument (the expression it applies to) is false. A record is
selected if it does not meet the stated condition.
“And”, “or”, and “not” are logical operators. You use them to combine expressions when using
methods like Layer.Search.
For example, suppose you want to select all properties that are worth $250,000 or more and are in
Columbia county. So, you would combine two simple expressions using the “and” operator:
•
COUNTY=”Columbia” and VALUE >= 250000
Now, what if you want all properties worth $250,000 or more and not in Columbia county? You can
use “not” to negate the first clause of the previous expression:
•
not(COUNTY=”Columbia”) and VALUE>=250000
You can use “or” when you want to specify alternative conditions, such as:
•
COUNTY=”Columbia” or COUNTY=”Greene”
String Clauses
Example
All customers from N to Q.
•
Note:
LAST_NAME >=”N” and LAST_NAME <”R”
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.
•
Note:
LAST_NAME>=”C” and LAST_NAME<”D”
The logic of this expression is the same as the logic for expression 47.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
468
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Date Clauses
Example
Records for all received in August 1990
•
Note:
Month(RECEIVED)=8 and Year(RECEIVED)=1990
In this expression we specify the year explicitly, using the “year(<somecolumn>)” function
to extract it from the date.
Example
Records for all received in July or September of 1989
•
month(RECEIVED)=(7, 9) and year(RECEIVED)=89
Keywords
MapX supports the use of keywords “like” and “between”.
Consider the following example, which illustrates “between”:
•
PRICE between 50000 and 100000
You can also use between with character strings.
The keyword “like” is used for string pattern matching.
•
The underscore character matches a single character.
•
The percent character matches zero or more characters.
The comparison is case insensitive.
Example
To determine if a string starts with “South”
•
STATE like “South%”
Operator Precedence
When MapX evaluates expressions it needs to know which components of an expression to
evaluate first. This is called precedence. By convention, certain operators are assigned different
levels of precedence. Those with the highest level are evaluated first. The following table lists
MapX's operators in the order in which they are evaluated. Operators at the same level of
precedence are evaluated from left to right, besides exponentiation, which evaluates from the
right.
Highest Priority:
parenthesis
exponentiation
negation
multiplication, division
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
469
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
addition, subtraction
geographic operators
comparison operators
Not
And
Lowest Priority:
Or
For example, the expression 3+4*2 produces a result of 11. That is because multiplication has a
higher precedence than addition and is performed first. Parenthesis must be used to force MapX
to do the addition first: (3+4)*2.
Now consider this expression, which is intended to select all records July or September of 1989.
•
year(RECEIVED)=89 and month(RECEIVED)=7 or month(RECEIVED)=9
Because “and” has higher precedence than “or”, MapX treats this expression as though
“year(RECEIVED)=89 and month(RECEIVED)=7” was enclosed in parentheses. In this case, any
record for July of 89 or for September of any year would be selected. That's probably not what you
want. However, by adding parentheses to the second expression, you can get what you want:
•
Note:
year(RECEIVED)=89 and (month(RECEIVED)=7 or month(RECEIVED)=9)
When you are not sure how MapX evaluates an expression with several operators, you
should use parentheses to group elements as you want them.
Functions
Functions take data values and perform some operation on them to produce a new value. Most of
MapX's functions take one or two parameters. A parameter can be a column or it can be another
expression.
MapX uses the keyword “obj” or “object” with the geographic functions: Area, CentroidX,
CentroidY, ObjectLen, and Perimeter. This keyword tells MapX that it has to get values based on
the graphical objects in the table rather than the tabular data.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
MapX Functions
The table below lists all of he MapX functions and provides a link to each one.
Abs( ) function
Acos( ) function
Area( ) function
Asc( ) function
Asin( ) function
Atn( ) function
Buffer( ) function
Centroid( ) function
CentroidX( ) function
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
470
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
CentroidY( ) function
Chr$( ) function
Cos( ) function
CurDate( ) function
Day( ) function
DeformatNumber$( )
function
Distance( ) function
Exp( ) function
Fix( ) function
Format$( ) function
FormatDate$( ) function
FormatNumber$( ) function
InStr( ) function
Int( ) function
LCase$( ) function
Left$( ) function
Log( ) function
LTrim$( ) function
Maximum( ) function
MBR( ) function
Mid$( ) function
Minimum( ) function
Month( ) function
ObjectLen( ) function
ObjectType( ) function
Perimeter( ) function
Proper$( ) function
Right$( ) function
Round( ) function
RTrim$( ) function
Sgn( ) function
Sin( ) function
Space$( ) function
Sqr( ) function
StringCompare( ) function
StringCompareIntl( )
function
StringToDate( ) function
Str$( ) function
Tan( ) function
UCase$( ) function
Val( ) function
Weekday( ) function
Year( ) function
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
num_expr
Description
A numeric expression.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
471
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
num_expr
Description
A numeric expression between one and minus one, inclusive.
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
obj_expr
An in object expression
unit_name
A string representing the name of an area unit (e.g., “sq km”).
Remarks
The Area( ) function returns the area of the geographical object specified by obj_expr.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
472
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
string_expr
Description
A String expression
Remarks
The Asc( ) function returns the character code representing the first character in the string
specified by string_expr.
If string_expr is a null string, the Asc( ) function returns a value of zero.
Note that the Windows and Macintosh operating environments use different character sets.
Therefore, the values returned by the Asc( ) function depend partly on the operating environment
that is in use at run-time. However, all MapInfo environments have common character codes
within the range of 32 (space) to 126 (tilde).
On a system that supports double-byte character sets (e.g., Windows Japanese): if the first
character of string_expr is a single-byte character, Asc( ) returns a number in the range 0 - 255; if
the first character of string_expr is a double-byte character, Asc( ) returns a value in the range 256
- 65,535.
On systems that do not support double-byte character sets, Asc( ) returns a number in the range 0
- 255.
Asin( ) function
Purpose
This returns the arc-sine value of a number.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
473
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Syntax
[float=]Asin( num_expr )
Part
num_expr
Description
A numeric expression from one to minus one, inclusive.
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
num_expr
Description
A numeric expression.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
474
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
inputobject
an object expression
resolution
a SmallInt value representing the number of nodes per circle at each corner
width
is a Float value representing the radius of the buffer; if width is negative, and if inputobject is
a closed object, the object returned represents an object smaller than the original object
unit_name
is the name of the distance unit (e.g., “mi” for miles, “km” for kilometers) used by width
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
obj_expr
Description
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
475
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
obj_expr
Description
An object expression
Remarks
The CentroidX( ) function returns the X coordinate (e.g., Longitude) component of the centroid of
the specified object. See the Centroid( ) function for a discussion of what the concept of a centroid
position means with respect to different types of graphical objects (lines vs. regions, etc.).
The coordinate information is returned in Map.NumericCoordSys. By default, MapX uses a
longitude, latitude coordinate system.
CentroidY( ) function
Purpose
This returns the y-coordinate of the centroid of an object.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[float=]CentroidY(obj _expr)
Part
obj_expr
Description
An object expression
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
476
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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.
If the num_expr parameter is fractional, MapX rounds to the nearest integer.
Character 12 is the form-feed character. Thus, you can use the statement Print Chr$(12) to clear
the Message window. Character 10 is the line-feed character; see example below.
Character 34 is the double-quotation mark (“). If a string expression includes the function call
Chr$(34), MapX embeds a double-quote character in the string.
Cos( ) function
Purpose
This returns the cosine of a number.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[float=]Cos (num_expr)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
477
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Parts
num_expr
Description
A numeric expression representing an angle in radians
Remarks
The Cos( ) function returns the cosine of the numeric num_expr value, which represents an angle
in radians. The result returned from Cos( ) will be between one and minus one.
To convert a degree value to radians, multiply that value by pi/ISO. To convert a radian value into
degrees, multiply that value by ISO/pi.
CurDate( ) function
Purpose
Returns the current date in YYYYMMDD format.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
CurDate( )
Return Value
Date
Remarks
The Curdate( ) function returns a Date value representing the current date. The format will always
be YYYYMMDD. To change the value to a string in the local system format use the FormatDate$(
) or Srt$( ) functions.
Day( ) function
Purpose
Returns the day component from a Date expression.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
Day( date_expr )
date_expr is a Date expression
Return Value
SmallInt from 1 to 31
Remarks
The Day( ) function returns an integer value from one to thirty-one, representing the day-of-themonth component of the specified date. For example, if the specified date is 12/17/93, the Day( )
function returns a value of 17.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
478
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
numeric_string
Description
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
479
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
If Map.NumericCoordSys is an earth coordinate system, Distance( ) returns the great-circle
distance between the two points. A great-circle distance is the shortest distance between two
points on a sphere. (A great circle is a circle that goes around the earth, with the circle’s center at
the center of the earth; a great-circle distance between two points is the distance along the great
circle which connects the two points.)
If Map.NumericCoordSys is a non-earth coordinate system, Distance( ) returns the Cartesian
distance.
Exp( ) function
Purpose
This returns the number e raised to a specified exponent.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[float=]Exp( num_expr )
Part
num_expr
Description
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.
Note:
MapX supports general exponentiation through the caret operator ( ^ ).
Fix( ) function
Purpose
This returns an integer value, obtained by removing the fractional part of a decimal value.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[Int=]Fix(num_expr)
Part
num_expr
Description
A numeric expression
Remarks
The Fix( ) function removes the fractional portion of a number, and returns the resultant integer
value.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
480
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
value
A numeric expression
pattern
A string which specifies how to format the results
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.
pattern character
Role in formatting results:
#
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
481
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
pattern character
Role in formatting results:
. (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
value
Description
A number representing the date in a YYYMMDD format.
Remarks
The FormatDate$( ) function returns a string representing a date in the local system format as
specified by the Control Panel.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
482
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Example in Visual Basic:
Assuming Control Panel settings are d/m/y for date order, '-' for date separator, and “dd-MMMyyyy” for short date format:
Dim lyrUSA As MapXLib.Layer
Dim ds As MapXLib.Dataset
Dim ftrs As MapXLib.Features
Set lyrUSA = Map1.Layers.Add("USA")
Set ds = Map1.Datasets.Add(miDataSetDAO, Data1.Recordset, "TestDataset",
"GEOABBR", , lyrUSA, , False)
'Looks for "Oct" in result returned by FormatDate$. Should succeed for each
record in the dataset.
Set ftrs = lyrUSA.Search("InStr(1, FormatDate$(20001011, ""Oct"") <> 0")
If ftrs.Count <> 51 Then
Debug.print "FormatDate$ failed"
End If
FormatNumber$( ) function
Purpose
This returns a string representing a number, including thousands separators and decimal-place
separators that match the user's system configuration.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[string=]FormatNumber$( num )
Part
num
Description
A numeric value or a string that represents a numeric value, such as “1234.56”
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):
Function Call
Result returned
FormatNumber$(“12345.67”)
“12,345.67” (inserted a thousands separator)
FormatNumber$(“12,345.67”)
“12,345.67” (no change)
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
483
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Function Call
Result returned
FormatNumber$(“12345.67”)
“12.345,67” (inserted a thousands separator, and changed the decimal
separator to match user's setup)
FormatNumber$(“12,345.67”)
“12.345,67” (changed both characters to match the user's setup)
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
position
A positive integer, indicating the start position of the search
string
A string expression
substring
A string expression which we will try to locate in string
Remarks
The InStr( ) function tests whether the string expression string contains the string expression
substring. MapX searches the string expression, starting at the position indicated by the position
parameter; thus, if the position parameter has a value of one, MapX will search from the very
beginning of the string parameter.
If string does not contain substring, the InStr( ) function returns a value of zero.
If string does contain substring, the InStr( ) function returns the character position where the
substring appears. For example, if the substring appears at the very start of the string, InStr( ) will
return a value of one.
If the substring parameter is a null string, the InStr( ) function returns zero.
The InStr( ) function is case-sensitive. In other words, the InStr( ) function cannot locate the
substring “BC” within the larger string “abcde”, because “BC” is upper-case.
Int( ) function
Purpose
This returns an integer value obtained by removing the fractional part of a decimal value.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
484
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Syntax
[Int=]Int( num_expr )
Part
num_expr
Description
A numeric expression
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
string_expr
Description
A string expression
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”.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
485
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Left$( ) function
Purpose
This returns part or all of a string, beginning at the left end of the string.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[string=]Left$( string_expr, num_expr )
Part
Description
string_expr
A string expression
num_expr
A numeric expression, zero or larger
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
num_expr
Description
A numeric expression.
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
486
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
string_expr
Description
A string expression
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
num_expr
is a numeric expression
num_expr
is a numeric expression
Remarks
The Maximum( ) function returns the larger of two numeric expressions.
MBR( ) function
Purpose
This returns a rectangle object, representing the minimum bounding rectangle of another object.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
487
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Syntax
[Rectangle object=]MBR( obj_expr )
Part
obj_expr
Description
an object expression
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
488
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
num_expr
is a numeric expression
num_expr
is a numeric expression
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)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
489
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Remarks
The ObjectLen( ) function returns the length of an object expression. Note that only line and
polyline objects have length values greater than zero; to measure the circumference of a
rectangle, ellipse, or region, use the Perimeter( ) function.
The ObjectLen( ) function returns a length measurement in the units specified by the unit_name
parameter; for example, to obtain a length in miles, specify “mi” as the unit_name parameter. See
the Set Distance Units statement for the list of valid unit names.
ObjectType( ) function
Purpose
Returns the type of the object (GeoObject.h).
•
POINT= 1
•
LINE = 2
•
ARC = 3
•
POLYLINE = 4
•
REGION = 5
•
TEXT= 6
•
RECT= 7
•
ROUNDRECT = 8
•
ELLIPSE
Note:
=9
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
object
Description
An Object expression.
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 )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
490
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Part
Description
obj_expr
An object expression
unit_name
A string representing the name of a distance unit (e.g., “km”)
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
string_expr
Description
A string expression
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 )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
491
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Part
Description
string_expr
a string expression
num_expr
a numeric expression
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 )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
492
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Part
string_expr
Description
a string expression
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
num_expr
Description
A numeric expression
Remarks
The Sgn( ) function returns a value of -1 if the num_expr is less than zero, a value of 0 (zero) if
num_expr is equal to zero, or a value of 1 (one) if num_expr is greater than zero.
Sin( ) function
Purpose
This returns the sine of a number.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[float=]Sin( num_expr )
Part
num_expr
Description
A numeric expression
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
493
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Space$( ) function
Purpose
This returns a string consisting only of spaces.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[string=]Space$( num_expr )
Part
num_expr
Description
A numeric expression
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
num_expr
Description
A numeric expression
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
494
MapX_Mobile_DevGuide.pdf
Developer Guide
Note:
Appendix H: Creating Expressions
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
StringCompare( string1, string2 )
string1 and string2 are String expressions
Return Value
SmallInt: -1 if first string precedes second; 1 if first string follows second; zero if strings are equal
Remarks
The StringCompare( ) function performs case-sensitive string comparisons. MapX string
comparisons which use the “=” operator are case-insensitive. Thus, a comparison expression such
as the following:
If
"ABC" = "abc" Then
evaluates as TRUE, because string comparisons are case-insensitive.
The StringCompare( ) function performs a case-sensitive string comparison and returns an
indication of how the strings compare.
Return value:
When:
-1
first string precedes the second string, alphabetically
0
the two strings are equal
1
first string follows the second string, alphabetically
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
495
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Return value:
When:
-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 )
Part
datestring
Description
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 forwardslash 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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
496
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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
expression
Description
A numeric, Date, Pen, Brush, Symbol, Font, Logical or Object expression
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 )
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
497
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Part
num_expr
Description
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
string_expr
Description
A string expression
Remarks
The UCase$( ) function returns the string which is the upper-case equivalent of the string
expression string_expr.
Conversion from lower to upper case only affects alphabetic characters (A through Z); numeric
digits and punctuation marks are not affected. Thus, the function call:
UCase$("A#12a")
returns the string value “A#12A”.
Val( ) function
Purpose
This returns the numeric value represented by a string.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[float=]Val( string_expr )
Part
string_expr
Description
A string expression
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
498
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
Remarks
The Val( ) function returns a number based on the string_expr string expression. Val( ) ignores any
white spaces (tabs, spaces, line feeds) at the start of the string_expr string, then tries to interpret
the first character(s) as a numeric value. The Val( ) function then stops processing the string as
soon as it finds a character that is not part of the number.
If the first non-white-space character in the string is not a period, a digit, a minus sign, or an
ampersand character (&), Val( ) returns zero. (The ampersand is used in hexadecimal notation;
see example below.)
Note:
If the string includes a decimal separator, it must be a period, regardless of whether the
user’s computer is set up to use some other character as the decimal separator. Also, the
string cannot contain thousands separators. To remove thousands separators from a
numeric string, call the DeformatNumber$( ) function.
Weekday( ) function
Purpose
This returns an integer from 1 to 7, indicating the weekday of a specified date.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[SmallInt value from 1 to 7, inclusive; 1 represents Sunday=]Weekday( date_expr )
Part
date_expr
Description
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( ) function
Purpose
This returns the year component of a date value.
Note:
Functions in MapX are used to create expressions and are passed as arguments. They
can ONLY be passed to the Layer.Search and the DataSet.AddField methods.
Syntax
[SmallInt value from 1 to 7, inclusive; 1 represents Sunday=]Year( date_expr )
Part
date_expr
Description
A date expression
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
499
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix H: Creating Expressions
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
500
MapX_Mobile_DevGuide.pdf
Geosets
In this appendix:
Š
Š
Š
Geoset Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Sample Geoset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Supported Geoset Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
I
Developer Guide
Appendix I: Geosets
Geoset Keys
Geosets are files (ending in .GST) that contain information about a set of layers, and can be
loaded at one time. A geoset is loaded by specifying one at design time (as a property), or using
the AddGeosetLayers method of the Layers object. A geoset file is an ASCII file containing
strings. These strings consist of keys and values. The keys correspond to properties in MapX –
properties for the main Map object, as well as for Layer objects.
Keys are hierarchical in nature, and are specified as quoted strings. Key values are also quoted
values – even number are quoted. The following is a sample showing some keys and values:
Sample Geoset
!GEOSET
!VERSION 100
begin_metadata
"\GEOSET" = ""
"\GEOSET\NAME" = "SAMPLE GEOSET"
"\GEOSET\PROJECTION" = "3,62,7,-96,23,20,60,0,0"
"\GEOSET\CENTER" = "-54851.35483414936,1844196.997419479"
"\GEOSET\MBR" = ""
"\GEOSET\MBR\LOWERLEFT" = "-3093309.705881681,-450646.671927353"
"\GEOSET\MBR\UPPERRIGHT" = "2983606.996213382,4139040.666766311"
"\GEOSET\ZOOMLEVEL" = "4019.82"
"\GEOSET\AUTOLAYER" = "FALSE"
"\GEOSET\MAPUNIT" = "0"
"\GEOSET\ROTATION" = "0"
"\TABLE" = ""
"\TABLE\1" = ""
"\TABLE\1\FILE" = "usa_caps.tab"
"\TABLE\1\DESCRIPTION" = "US Capitals"
"\TABLE\1\ISVISIBLE" = "TRUE"
"\TABLE\1\AUTOLABEL" = "FALSE"
"\TABLE\1\DRAWLABELSAFTER" = "FALSE"
"\TABLE\1\SHOWLINEDIRECTION" = "FALSE"
"\TABLE\1\SHOWNODES" = "FALSE"
"\TABLE\1\SHOWCENTROIDS" = "FALSE"
"\TABLE\1\EDITABLE" = "FALSE"
"\TABLE\1\SELECTABLE" = "TRUE"
"\TABLE\1\REGISTERINGEOODICT" = "TRUE"
"\TABLE\1\DISPLAY" = ""
"\TABLE\1\DISPLAY\BRUSH" = ""
"\TABLE\1\DISPLAY\BRUSH\Pattern" = "2"
"\TABLE\1\DISPLAY\BRUSH\Forecolor" = "16777215"
"\TABLE\1\DISPLAY\BRUSH\Backcolor" = "16777215"
"\TABLE\1\DISPLAY\BRUSH\Transparent" = "FALSE"
"\TABLE\1\DISPLAY\PEN" = ""
"\TABLE\1\DISPLAY\PEN\LineWidth" = "1"
"\TABLE\1\DISPLAY\PEN\LineStyle" = "1"
"\TABLE\1\DISPLAY\PEN\Pattern" = "2"
"\TABLE\1\DISPLAY\PEN\Color" = "0"
"\TABLE\1\DISPLAY\LINEPEN" = ""
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
502
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix I: Geosets
"\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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
503
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix I: Geosets
Supported Geoset 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>\
FILE
String – location of .TAB file
DESCRIPTION
String – Table description
ISVISIBLE
TRUE or FALSE (1 or 0) – whether layer is visible
AUTOLABEL
TRUE or FALSE (1 or 0) – – whether layer is autolabeled
DRAWLABELSAFTER
TRUE or FALSE (1 or 0) – whether to draw labels after the layer is drawn
SHOWLINEDIRECTION
TRUE or FALSE (1 or 0) – Corresponds to Layer.ShowLineDirection
SHOWNODES
TRUE or FALSE (1 or 0) – Corresponds to Layer.ShowNodes
SHOWCENTROIDS
TRUE or FALSE (1 or 0) – Corresponds to Layer.ShowCentroids
EDITABLE
TRUE or FALSE (1 or 0) – Corresponds to Layer.Editable
SELECTABLE
TRUE or FALSE (1 or 0) – Corresponds to Layer.Selectable
REGISTERINGEODICT
TRUE or FALSE (1 or 0) – whether to register the geoset in the geodictionary
ZOOM\MIN
Number – minimum zoom value to display layer (Layer.ZoomMin)
ZOOM\MAX
Number – maximum zoom value to display layer (Layer.ZoomMax)
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
504
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix I: Geosets
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\
LINEWIDTH
Number – corresponds to Style.RegionBorderWidth
LINESTYLE
Number – corresponds to Style.RegionBorderStyle
COLOR
Number – corresponds to Style.RegionBorderColor
DISPLAY\LINEPEN\
LINEWIDTH
Number – corresponds to Style.LineWidth
LINESTYLE
Number – corresponds to Style.LineStyle
COLOR
Number – corresponds to Style.LineColor
DISPLAY\FONT\
STYLE
Number – Bit Mask (BOLD 0x01, ITALIC 0x02, UNDER 0x04, STRIKEOUT
0x08, OUTLINE 0x10, SHADOW 0x20, INVERSE 0x40, BLINK 0x80)
EXTSTYLE
Number – Bit Mask (HALO 0x01, ALLCAPS 0x02, DBLSPACE 0x04)
DESCRIPTION
String – font name
SIZE
Number – font size in points
FORECOLOR
Number – Corresponds to Style.TextFontColor
BACKCOLOR
Number – Corresponds to Style.TextFontBackColor
OPAQUE
TRUE or FALSE – Corresponds to Style.TextFontOpaque
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
505
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix I: Geosets
TrueType Font Symbol
Keys
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
BITMAP\NAME
String – Name of the bitmap symbol. Corresponds to Style.SymbolBitmapName.
BITMAP\OVERRIDECOLOR
TRUE or FALSE – Whether to apply color to the symbol. Corresponds to
Style.SymbolBitmapOverrideColor
BITMAP\TRANSPARENT
TRUE or FALSE – Whether the bitmap is transparent. Corresponds to
Style.SymbolBitmapTransparent.
LABEL\
ZOOM\MIN
Number – minimum zoom value to label layer
ZOOM\MAX
Number – maximum zoom value to label layer
FONT
This is the label font. It has the same sub-keys as DISPLAY\FONT above
DUPLICATE
TRUE or FALSE – permit duplicate labels
PARALLEL
TRUE or FALSE – Corresponds to LabelProperties.Parallel
OVERLAP
TRUE or FALSE – Corresponds to LabelProperties.Overlap
PARTIALSEGMENTS
TRUE or FALSE – Corresponds to LabelProperties.PartialSegments
MAXLABELS
Number – Corresponds to LabelProperties.LabelMax
LINETYPE
Number – Corresponds to LabelProperties.LineType
OFFSET
Number – Corresponds to LabelProperties.Offset
POSITION
Number – Corresponds to LabelProperties.Position
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
506
MapX_Mobile_DevGuide.pdf
J
IDispatch Table
This is a table for the IDispatches of MapX.
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
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
BindLayer.LayerType
4
BindLayer.RefColumn1
2
BindLayer.RefColumn2
3
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
508
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
DataSet.GeoField
5
DataSet.Layer
7
DataSet.Name
1
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
509
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Datum.Set
14
Datum.SetFromList
15
Datum.ShiftX
2
Datum.ShiftY
3
Datum.ShiftZ
4
Feature.Area
10
Feature.Attach
20
Feature.Bounds
7
Feature.Caption
8
Feature.CenterX
4
Feature.CenterY
5
Feature.Clone
21
Feature.FeatureID
1
Feature.FeatureKey
23
Feature.HasMultipoint
29
Feature.HasPolyline
28
Feature.HasRegion
27
Feature.Multipoint
26
Feature.Polyline
25
Feature.Region
24
Feature.KeyValue
17
Feature.LabelPoint
13
Feature.Layer
11
Feature.Length
3
Feature.Name
16
Feature.Nodes
22
Feature.Offset
19
Feature.Parts
9
Feature.Perimeter
14
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
510
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Feature.Point
12
Feature.Smooth
15
Feature.Style
6
Feature.Type
2
Feature.Update
18
FeatureFactory.BufferFeatures
1
FeatureFactory.CombineFeatures
2
FeatureFactory.CreateArc
9
FeatureFactory.CreateCircularRegion
11
FeatureFactory.CreateEllipticalRegion
10
FeatureFactory.CreateLine
7
FeatureFactory.CreateCollectionFeature
14
FeatureFactory.CreateMultipoint
15
FeatureFactory.CreateRegion
6
FeatureFactory.CreateSymbol
5
FeatureFactory.CreateText
8
FeatureFactory.EraseFeature
4
FeatureFactory.IntersectFeatures
3
FeatureFactory.IntersectionPoints
13
FeatureFactory.IntersectionTest
12
Features.Add
4
Features.AddByID
9
Features.Bounds
8
Features.Clone
3
Features.Common
5
Features.Count
1
Features.Item
2
Features.Remove
6
Features.RemoveByID
10
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
511
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Features.Replace
7
Field.AggregationFunction
3
Field.Name
2
Field.Type
1
Fields.Add
2
Fields.Count
1
Fields.Item
3
Fields.Remove
4
Fields.RemoveAll
5
Find.Abbreviations
2
Find.CloseMatchMax
10
Find.ClosestAddr
3
Find.FindDataSet
7
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
512
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
FindFeature.Layer
65547
FindFeature.Length
65539
FindFeature.Name
65552
FindFeature.Offset
65555
FindFeature.Parts
65545
FindFeature.Perimeter
65550
FindFeature.Point
65548
FindFeature.Smooth
65551
FindFeature.Style
65542
FindFeature.Type
65538
FindFeature.Update
65554
FindMatch.FeatureID
1
FindMatch.FeatureKey
4
FindMatch.Name
2
FindMatch.Score
3
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
513
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Geosets.Count
1
Geosets.Item
2
Graphic.Caption
1
Graphic.Position
4
Graphic.Style
5
Graphic.X
2
Graphic.Y
3
IndividualValueCategories.AllOthersCategory
3
IndividualValueCategories.Count
1
IndividualValueCategories.Item
2
IndividualValueCategory.NumItems
2
IndividualValueCategory.Style
1
IndividualValueCategory.Value
3
LabelProperties.DataField
13
LabelProperties.DataSet
9
LabelProperties.Duplicate
10
LabelProperties.LabelMax
12
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
514
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Layer.AllFeatures
26
Layer.AutoLabel
6
Layer.BeginAccess
41
Layer.Bounds
32
Layer.ClearCustomLabels
19
Layer.CoordSys
17
Layer.DataSets
39
Layer.DeleteFeature
22
Layer.DrawLabelsAfter
37
Layer.DrillDownAddFeatures
31
Layer.DrillDownRemoveFeatures
30
Layer.DrilldownReset
34
Layer.Editable
46
Layer.EndAccess
42
Layer.FeatureIDFromFeatureName
38
Layer.FeatureKeyFromFeatureName
48
Layer.FileSpec
4
Layer.Find
14
Layer.GetDrilldownFeaturesByID
33
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
515
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Layer.Refresh
36
Layer.Search
40
Layer.SearchAtPoint
29
Layer.SearchWithinDistance
24
Layer.SearchWithinFeature
28
Layer.SearchWithinRectangle
25
Layer.Selectable
3
Layer.Selection
12
Layer.ShowCentroids
44
Layer.ShowLineDirection
45
Layer.ShowNodes
43
Layer.Style
9
Layer.Type
15
Layer.UpdateFeature
20
Layer.Visible
2
Layer.ZoomLayer
7
Layer.ZoomMax
11
Layer.ZoomMin
10
LayerInfo.AddParameter
2
LayerInfo.Type
1
Layers.Add
4
Layers.AddGeoSetLayers
5
Layers.AddServerLayer
13
Layers.AddUserDrawLayer
8
Layers.AnimationLayer
9
Layers.Bounds
12
Layers.ClearSelection
2
Layers.Count
1
Layers.CreateLayer
10
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
516
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Layers.InsertionLayer
15
Layers.Item
6
Layers.LayersDlg
11
Layers.Move
3
Layers.Remove
7
Layers.RemoveAll
14
Legend.BodyTextStyle
6
Legend.Compact
1
Legend.CompactTitle
11
Legend.CompactTitleStyle
5
Legend.CurrencyFormat
8
Legend.ExportLegend
18
Legend.Height
15
Legend.Left
12
Legend.LegendDlg
16
Legend.LegendTexts
7
Legend.PaperHeight
21
Legend.PaperWidth
22
Legend.PrintLegend
20
Legend.ShowCount
19
Legend.ShowEmptyRanges
17
Legend.SubTitle
10
Legend.SubTitleStyle
4
Legend.Title
9
Legend.TitleStyle
3
Legend.Top
13
Legend.Visible
2
Legend.Width
14
LegendText.Text
1
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
517
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
LegendText.Visible
2
LegendTexts.AllOthersText
4
LegendTexts.AutoGenerate
1
LegendTexts.Count
2
LegendTexts.Item
3
Map.AboutBox
-552
Map.Annotations
3
Map.AreaUnit
28
Map.AutoRedraw
6
Map.BackColor
-501
Map.Bounds
29
Map.CenterX
8
Map.CenterY
9
Map.ClipLine
44
Map.ClipLineV
45
Map.ConvertCoord
34
Map.ConvertCoordV
41
Map.CreateCustomTool
36
Map.CurrentTool
20
Map.DataSet
4
Map.DataSetGeoField
1
Map.DataSetTheme
19
Map.DataSets
22
Map.DefaultConversionResolution
50
Map.DefaultStyle
17
Map.DisplayCoordSys
30
Map.Distance
37
Map.ExportMap
39
Map.ExportSelection
32
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
518
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Map.FeatureFactory
49
Map.GeoDictionary
18
Map.GeoSet
10
Map.GeoSetWidth
11
Map.Geosets
27
Map.hWnd
-515
Map.InfotipPopupDelay
61
Map.InfotipSupport
63
Map.IsPointVisible
43
Map.Layers
5
Map.MapPaperHeight
12
Map.MapPaperWidth
13
Map.MapScreenHeight
54
Map.MapScreenWidth
53
Map.MapUnit
25
Map.MatchNumericFields
52
Map.MatchThreshold
57
Map.MaxSearchTime
14
Map.MouseIcon
62
Map.MousePointer
21
Map.MousewheelSupport
51
Map.NumericCoordSys
31
Map.Pan
64
Map.PanAnimationLayer
60
Map.PaperUnit
15
Map.PreferCompactLegends
16
Map.PrintMap
38
Map.PropertyPage
40
Map.RedrawInterval
55
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
519
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Map.Refresh
-550
Map.Rotation
26
Map.SaveMapAsGeoset
47
Map.SearchPath
56
Map.SelectionStyle
33
Map.SetSize
42
Map.Title
23
Map.TitleText
24
Map.Version
2
Map.WaitCursorEnabled
58
Map.Zoom
7
Map.ZoomTo
35
MultivarCategories.Count
1
MultivarCategories.Item
2
MultivarCategory.Style
1
NotesQueryInfo.BeginDate
4
NotesQueryInfo.Database
2
NotesQueryInfo.DefaultNumericValue
8
NotesQueryInfo.DefaultStringValue
7
NotesQueryInfo.EndDate
5
NotesQueryInfo.FullTextSearch
6
NotesQueryInfo.MaxNumDocs
9
NotesQueryInfo.Query
3
NotesQueryInfo.Server
1
NotesViewInfo.Database
2
NotesViewInfo.Server
1
NotesViewInfo.View
3
ODBCQueryInfo.ConnectString
3
ODBCQueryInfo.DataSource
1
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
520
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
ODBCQueryInfo.SqlQuery
2
Parts.Add
4
Parts.Count
1
Parts.Item
2
Parts.Remove
3
Parts.RemoveAll
5
Point.Offset
4
Point.Set
3
Point.X
1
Point.Y
2
Points.Add
4
Points.AddXY
5
Points.Count
1
Points.Item
2
Points.Remove
3
Points.RemoveAll
6
RangeCategories.AllOthersCategory
3
RangeCategories.Count
1
RangeCategories.Item
2
RangeCategory.Max
2
RangeCategory.Min
1
RangeCategory.NumItems
3
RangeCategory.Style
4
Rectangle.Height
5
Rectangle.Offset
8
Rectangle.Set
7
Rectangle.Width
6
Rectangle.XMax
3
Rectangle.XMin
1
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
521
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
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
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
522
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
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
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
523
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
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
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
524
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
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
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
525
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
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
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
526
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix J: IDispatch Table
Method/Property
IDispatch
Themes.Add
2
Themes.Count
1
Themes.Item
3
Themes.Remove
4
Themes.RemoveAll
5
Title.Border
8
Title.Caption
1
Title.Editable
6
Title.Position
7
Title.TextStyle
2
Title.Visible
3
Title.X
4
Title.Y
5
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
527
MapX_Mobile_DevGuide.pdf
Using the Geoset
Manager
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.
Opening an Existing Geoset
MapX includes some sample geosets. Use these as a starting point
for your own geoset or use them as they are. To display an existing
geoset:
1. Choose File > Open Geoset. The Open dialog displays.
K
Developer Guide
Appendix K: Using the Geoset Manager
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
529
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
From here you can set display and label properties, reorder the way in which layers
display, remove or add additional layers and set whether layers are visible, contain
automatic labels, or are selectable. See the description of Layer Control in a following
section, below. You can edit these properties later after displaying the initial geoset.
4. Click OK to display the geoset. Your newly created geoset displays.
Use the information in the sections that follow to manipulate and customize the layers in your
geoset. When you have finished creating your geoset you'll need to save it.
To save your geoset:
1. Choose File > Save. The Save As dialog displays.
2. Enter a name and click Save to save the layers with the attributes you specified.
Manipulating Your Layers with the Map Menu
Use the options available from the Map Menu to control the way in which your map displays.
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
530
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
1. Choose Map > Zoom In, or click the Zoom In button on the menu bar, or right click the
mouse in the Geoset manager window and choose Zoom In.
The Zoom In mouse icon appears.
2. Draw a marquee in the map or layout by diagonally dragging the Zoom In mouse icon. The
area within the marquee is enlarged.
Zoom Out
Use the Zoom Out tool to get a wider area view of a map or a layer.
1. Choose Map > Zoom Out, or click the Zoom Out button, or right click the mouse in the
Geoset Manager window and choose Zoom Out.
The Zoom Out mouse icon appears.
2. Click the Zoom Out mouse icon on the center of the area you want to zoom out on,
enlarging the area by a linear factor of two. This point will be at the center of the map in the
zoomed-out view. Repeat this procedure until you have the appropriate level of
magnification.
To zoom out from a rectangular area:
1. Choose Map > Zoom Out, click the Zoom Out button, or right click the mouse in the
Geoset Manager window and choose Zoom Out.
The Zoom Out mouse icon appears.
2. Draw a marquee in the map or layout by diagonally dragging the Zoom Out mouse icon.
The area within the marquee is reduced, allowing more of the map to display.
Pan
Use Pan to reposition a map within its window.
To move or adjust the map display:
1. Choose Map > Pan, or click the Pan button, or right click the mouse in the Geoset
Manager window and choose Pan.
The Pan mouse icon appears.
2. Click an area of the map.
3. While holding down the left mouse button, drag the map in the appropriate direction. When
you release the mouse button, Geoset Manager redraws the map in its new location.
Zoom To
Zoom to a particular X and Y coordinate on the map and set a zoom level.
Choose Map > Zoom To.
The Zoom To dialog displays.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
531
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
Enter the coordinates to which you want to zoom.
View Entire Layer
Use View Entire Layer to zoom and display an entire layer or all layers in a map.
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.
To display an entire map or map layer:
1. Choose Map > View Entire Layer, or right click with the mouse over the Map window and
choose View Entire Layer. The View Entire Layer dialog displays.
2. Choose a specific layer or All layers to display. Click OK to view the layer(s).
Layer Control
Use the Layer Control dialog to:
•
Change the display of map layers in the active window
•
Determine which layers are displayed, removed, added, selectable, zoom layered, labeled
and set
•
Change the order of map layers.
To access Layer Control:
•
Choose Map > Layer Control, click the Layer Control button, right click the mouse over the
map and choose Layer Control or create a new geoset.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
532
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
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
Up
Moves one or more layers up.
Down
Moves one or more layers down.
Add
Adds one or more layers to the map. Choose from the displayed listbox of tables.
Remove
Removes one or more layers from the map.
Visible
Indicates if the layer is visible. Check this box for the layer, or layers, that you want to
make visible in the map. Sometimes you may want to include layers in your geoset for
computational purposes and not want them actually displayed in the geoset.
Selectable
Indicates if the layer is selectable. Check this box for the layer, or layers, that you
want to make selectable. Layers must be selectable if you want to choose or label
objects. A layer must be displayed to be made selectable. More than one layer may
be selectable at the same time. You may, however, only select from one layer at a
time.
Automatic Labels
Check to label the map automatically. The labels are taken from the table column designated in the Label with section of the Label Options dialog.
Display
This displays the Display Options dialog. Use this dialog to specify display attributes
for map layers.
Labels
This displays the Label Properties dialog. Use this dialog to specify label attributes for
map layers.
To specify display attributes for a map layer, click the Display button from the Layer Control dialog.
Display Mode
Part
Description
Override Style
Check to override the default style of a layer.
Style Button
Enabled when Style Override option is checked. This displays the button appropriate to
the object type contained in the selected layer: Region, Line, Symbol, or Text. Click to
display the corresponding dialog.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
533
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
Zoom Layering
Part
Description
Display within zoom range
Check to activate zoom layering. Zoom layering allows you to set the minimum and maximum distances at which the selected layer will be visible. For
example, if you only want to see particular streets on a map when you are
closer than 3 miles, set the minimum zoom to 0 and the maximum to 3.
Min Zoom
Specify the minimum distance at which the selected layer is visible.
Max Zoom
Specify the maximum distance at which the selected layer is visible.
Automatic Labeling
To automatically label a layer in a map using information from that layer:
1. From the Layer Control dialog, choose the layer you want to label; check the Automatic
Labels check box.
2. Click OK.
The map redisplays with labels from the table column designated in the Label with section of the
Label Options dialog if a dataset is loaded and a field from that dataset is specified.
Only one column per table displays at one time.
Access the Label Properties dialog to change the visibility, content, font, text color, line style, and
position of labels.
The Label Properties Dialog
Label Properties dialog determines the visibility, content, font, text color, line style, and anchor
point of labels. These settings are used for both automatic and interactive labeling using the Label
tool. When using the Label tool, the label is positioned at the place you designate by clicking the
mouse button.
To access the Label Properties dialog:
1. Choose Map > Layer Control.
2. Click the Label button. The Label Properties dialog displays.
Part
Label With:
Description
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.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
534
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
Part
Description
Min Zoom
Specify the minimum distance at which labels are visible.
Max Zoom
Specify the maximum distance at which labels are visible.
Allow duplicate text
Check to place the same label on a map more than once.
Allow overlapping text
Allow more than one object with the same text to be displayed.
Maximum labels
Enter the maximum number of labels that will display; labels are selected from
the designated table in the order in which they are entered in the table. For
example, if the designated table is the States table, and you enter 10, the first ten
states listed in the table, which are in view, will be labeled.
Styles:
Text Style button
Click the Text Style button to display the Text Style dialog. See Text Style Dialog.
Label Lines
Select a line type, or no line type, to attach the label to the anchor point.
None
Do not display a line with the label.
Simple
Create a callout by using a simple line that connects the label to the object's centroid. Label lines display after you move the label from where it was originally created.
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:
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
535
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
Choose Map > Projection, or right-click the mouse over the map and choose projection.
Using the View Menu
Use the Options in the View Menu to designate if Status bars or Toolbars display and to change
map distance units or coordinates.
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
Distance Units
Description
Choose the measure of distance used for the map.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
536
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix K: Using the Geoset Manager
Part
Description
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.
Tools and the GeoDictionary Manager
Use the options in the Tools menu to access the GeoDictionary manager. The GeoDictionary
manager allows you to register layers in the geodictionary. Layers registered in the geodictionary
can be used for databinding in other MapX sessions.
For more information on the Geodictionary Manager, see Appendix D: Using the Geodictionary
Manager.
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
537
MapX_Mobile_DevGuide.pdf
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:
BGR value = (blue * 65536) + (green * 256) + red
Note:
If you have used the MapBasic programming language,
please note that MapBasic uses the following formula to
calculate the RGB values:
RGB value = (red * 65536) + (green * 256) + blue
If you are working with RGB color values (e.g., values used with a
MapBasic application), you will need to convert the colors to BGR
before you can use those color values in MapX.
See Also
ColorConstants in Appendix G on page 448
L
M
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.
Map Name
Copyright
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
Australia Cities
MapInfo from Digital Chart of the World
Australia Highways
MapInfo from Digital Chart of the World
Australia Major Cities
MapInfo from Digital Chart of the World
Australia State Boundaries
MapInfo
Australia State Capital Cities
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
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
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
European Country Boundaries
Data copyright and produced by URPI 1998 and GisNET data licensed to MapInfo by GISdata Limited. ©
GDC Ltd. 1993
European Highways
GisNET data licensed to MapInfo by GISdata Limited. ©
GDC Ltd. 1993
European Major Cities
MapInfo from Digital Chart of the World
European NUTS 1 Level Boundaries
Copyright URPI 1998
European NUTS 2 Level Boundaries
Copyright URPI 1998
World Ocean (Lat / Long)
MapInfo
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 Boundaries
Copyright URPI 1998
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
540
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
Canadian Province Boundaries
MapInfo from Digital Chart of the World
Canadian Province Capital Cities
MapInfo from Digital Chart of the World
US State Boundaries
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
US Geoset
Canadian Province Boundaries
MapInfo from Digital Chart of the World
Mexico State Boundaries
MapInfo from the Bureau of Transportation Statistics
US Cities
MapInfo from Digital Chart of the World
US County Boundaries
MapInfo from Census Bureau
US Highways
MapInfo from the Bureau of Transportation Statistics
US Major Cities
MapInfo from Digital Chart of the World
US State Boundaries
MapInfo from Digital Chart of the World
US State Capitals
MapInfo from Digital Chart of the World
US top 20 Cities
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
World Geoset
World Capitals
MapInfo from Digital Chart of the World
World Countries
MapInfo from Digital Chart of the World
World Graticule
MapInfo
World Ocean (Robinson)
MapInfo
World Top 25 Cities
MapInfo from Digital Chart of the World
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
541
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
Dc Water Layer
MapInfo
DC Zips
© 1995 Geographic Data Technology, Inc.
Asia Geoset
Asia
MapInfo from Digital Chart of the World
Asia Capitals
MapInfo from Digital Chart of the World
Asia Major 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
World Ocean (for Asia)
MapInfo
Mid-Atlantic Geoset
Mid-Atlantic Capitals
MapInfo from Digital Chart of the World
Mid-Atlantic Cities
MapInfo from Digital Chart of the World
Mid-Atlantic Counties
MapInfo
Mid-Atlantic Highway
MapInfo from the Bureau of Transportation Statistics
Mid-Atlantic Major Cities
MapInfo from Digital Chart of the World
Mid-Atlantic States
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
US State Boundaries
MapInfo from Digital Chart of the World
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
China Highways
MapInfo from Digital Chart of the World
China Major Cities
MapInfo from Digital Chart of the World
World Ocean (for Asia)
MapInfo
Mexico Geoset
Mexico Cities
MapInfo from Digital Chart of the World
Mexico Highways
MapInfo from Digital Chart of the World
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
542
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
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
North American 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
Canadian Province Boundaries
MapInfo from Digital Chart of the World
Canadian Province Capital Cities
MapInfo from Digital Chart of the World
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 Cities
MapInfo from Digital Chart of the World
US Highways
MapInfo from the Bureau of Transportation Statistics
US Major Cities
MapInfo from Digital Chart of the World
US State Boundaries
MapInfo from Digital Chart of the World
US State Capitals
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
543
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
World Ocean (Lat / Long)
Copyright
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
Argentina Cities
MapInfo from Digital Chart of the World
Argentina Country Boundary
MapInfo from Digital Chart of the World
Argentina Major Cities
MapInfo from Digital Chart of the World
South America Country Boundaries
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
Brazil Geoset
Brazil Major Cities
MapInfo from Digital Chart of the World
Brazil Cities
MapInfo from Digital Chart of the World
Brazil Country Boundary
MapInfo from Digital Chart of the World
South America Country Boundaries
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
544
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
Israel Geoset
Africa Country Boundary
MapInfo from Digital Chart of the World
Asia
MapInfo from Digital Chart of the World
Israel Cities
MapInfo from Digital Chart of the World
Israel Country Boundary
MapInfo from Digital Chart of the World
Israel Major Cities
MapInfo from Digital Chart of the World
World Ocean (Lat / Long)
MapInfo
South Korea Geoset
Asia
MapInfo from Digital Chart of the World
South Korea Cities
MapInfo from Digital Chart of the World
South Korea Country Boundary
MapInfo from Digital Chart of the World
South Korea Major Cities
MapInfo from Digital Chart of the World
World Ocean (for Asia)
MapInfo
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
Spain Highways
GisNET data licensed to MapInfo by GISdata Limited. ©
GDC Ltd. 1993
Spain Major Cities
MapInfo from Digital Chart of the World
Spain NUTS 2 Boundaries
Copyright URPI 1998
World Ocean (Lat / Long)
MapInfo
India Geoset
Asia
MapInfo from Digital Chart of the World
India Capital Cities
MapInfo from Digital Chart of the World
India District Bdys
Risk Management Solutions, Inc.
India Major Cities
MapInfo from Digital Chart of the World
India Minor Cities
MapInfo from Digital Chart of the World
India State Bdys
Risk Management Solutions, Inc.
World Ocean (for Asia)
MapInfo
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
545
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
US Detail Geoset
Canadian Province Boundaries
MapInfo from Digital Chart of the World
Landmark Map
MapInfo from USGS
Mexico State Boundaries
MapInfo from the Bureau of Transportation Statistics
US Cities
MapInfo from Digital Chart of the World
US County Boundaries
MapInfo from Census Bureau
US Highways
MapInfo from the Bureau of Transportation Statistics
US Major Cities
MapInfo from Digital Chart of the World
US State Boundaries
MapInfo from Digital Chart of the World
US State Capitals
MapInfo from Digital Chart of the World
US top 20 Cities
MapInfo from Digital Chart of the World
US ZIP Code Boundaries
© 1997 Geographic Data Technology, Inc.
World Ocean (Lat / Long)
MapInfo
World Detail Geoset
World Capitals
MapInfo from Digital Chart of the World
World Countries
MapInfo from Digital Chart of the World
World Graticule
MapInfo
World Major Cities
MapInfo from Digital Chart of the World
World Minor Cities
MapInfo from Digital Chart of the World
World Ocean (Robinson)
MapInfo
World Top 25 Cities
MapInfo from Digital Chart of the World
Dallas, TX Geoset
Crime County Map
MapInfo
Crime Demo Map
MapInfo
Dallas City Boundary A
MapInfo from USGS
Dallas City Boundary B
MapInfo from USGS
Dallas Locations
MapInfo
Dallas Major Highways A
MapInfo from USGS
Dallas Major Highways B
MapInfo from USGS
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
546
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
Dallas Streets A
MapInfo from USGS
Dallas Streets B
MapInfo from USGS
Dallas Streets C
MapInfo from USGS
Dallas Water Bodies
MapInfo from USGS
Dallas Water Rivers
MapInfo from USGS
Dallas, TX Raster
Copyright © 1997, Horizons Technology, Inc.
Other Files
Dallas City Boundary from MapXsite Streets 1.0
MapInfo from USGS
Dallas Major Highways from MapXsite Streets 1.0
MapInfo from USGS
Dallas Streets from MapXsite Streets 1.0
MapInfo from USGS
Dallas Water Bodies from MapXsite Streets 1.0
MapInfo from USGS
Dallas Water Rivers from MapXsite Streets 1.0
MapInfo from USGS
US 5-Digit ZIP Code Points
(c) 1999 Geographic Data Technology, Inc.
US 5-Digit ZIP Code Points (compressed point file)
(c) 1995 Geographic Data Technology, Inc.
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 Gender
copyright 1998, The Polk Company, All Rights
Reserved
US County Household demographics
copyright 1998, The Polk Company, All Rights
Reserved
US County Household demographics by Age, Income
copyright 1998, The Polk Company, All Rights
Reserved
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
547
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix M: Data Sources
Map Name
Copyright
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
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
548
MapX_Mobile_DevGuide.pdf
Managing MapX Data
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 5.0\Maps
Demographic data, in the form of a Microsoft Access table
(MAPSTATS.MDB), is installed in the directory:
•
C:\Program Files\MapInfo\MapX 5.0\Data
The exact list of files installed on your computer depends partly on
the options that you chose during installation. (By default, all data
products are installed; but the installer allows you to un-check any or
all geosets to avoid installing them.) The list of files installed also
depends upon which version of the software you installed; the MapX
installation CD provides more data products than the download-forevaluation version of the software.
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:
•
C:\Program Files\Common Files\MapInfo Shared\MapX
Common\GeosetManager40.EXE
For more information about the Geodictionary Manager, see
Appendix K: Using the Geoset Manager.
N
Index
A
Abbreviations property (Find object) 212
ABC‡Eƒ properties (Affine Transform object) 138
AboutBox method (MapObject) 287
Abs( ) function 471
Acos( ) function 472
ActiveAnnotation method (Annotations collection) 143
Add method (DataSets collection) 167
Add method (Features collection) 183
Add method (Fields collection) 206
Add method (Layers Collection) 263
Add method (Parts collection) 322
Add method (Point object) 325
Add method (RowValues collection) 338
Add method (Selection collection) 341
Add method (Themes Collection) 378
Add method (Variables collection) 395
AddByID method (Features collection) 183
AddDateField method (Fields collection) 207
AddFeature method (Layer object) 241
AddFeatureToolUsed Event 425
AddField method (DataSet object) 162
AddFloatField (Fields collection) 207
AddGeosetLayers method (Layers collection) 264
Adding
Map control 18
map to Visual Basic form 19–20
Adding data
data binding 60–61
AddIntegerField (Fields Collection) 208
AddLogicalField method (Fields collection) 208
AddNumericField method (Fields Collection) 209
AddParameter method (LayerInfo object) 275
AddressOutOfRange property (FindResult object) 220
AddServerLayer method (Layers collection) 264
AddSmallIntField method (Fields Collection) 209
AddStringField method (Fields collection) 210
AddSymbol method (Annotations collection) 143
AddText method (Annotations collection) 143
AddUserDrawLayer method (Layers collection) 265
AddXY method (Point object) 326
Affine transformations 114
AffineTransform object 138
AffineTransform property (CoordSys object) 156
AggregationFunction property (Field object) 204
AggregationFunctionConstants 446
AllFeatures method (Layer object) 242
AllOthersCategory property (IndividualValueCategories)
226
AllOthersCategory property (RangeCategories collection)
329
AllOthersText property (LegendTexts collection) 283
AllowEmptyRanges property (ThemeProperties object)
382
AnchorX property (Label object) 229
AnchorY property (Label object) 229
Angle property (Label object) 229
Animation layers 57
AnimationLayer property (Layers collection) 266
Annotation object 142
AnnotationAdded event 426
AnnotationChanged event 426
AnnotationChangedTypeConstants 447
Annotations 55
Annotations collection 142
properties and methods 34–35
Annotations property (MapObject) 287
AnnotationTypeConstants 447
ApplyAttribute property (ThemeProperties object) 391
ApplyAttributeConstants 447
Area property (Feature object) 175
Area( ) function 472
AreaUnit property (MapObject) 287
AreaUnitConstants 447
Asc( ) function 473
ASCII files
defined 409
Asin( ) function 473
Atn( ) function 474
Attach method (Feature object) 175
Attribute data
binding 63
AutoGenerate property (LegendText object) 284
AutoLabel property (Layer object) 242
Automatic labeling
setting for a layer 49
AutoRecompute property (Theme object) 374
AutoRedraw property (MapObject) 287
Azimuth property (CoordSys object) 157
B
BackColor property (MapObject) 287
Bar chart maps
thematic map type 88–89
BarFramed property (ThemeProperties object) 387
BarFrameStyle (ThemeProperties object) 388
Developer Guide
Appendix N: Index
BarGraduatedStack property (ThemeProperties object)
387
BarIndependentScale property (ThemeProperties object)
387
BarStacked property (ThemeProperties object) 386
BarWidth property (ThemeProperties object) 387
BeginAccess method (Layer object) 243
BeginDate property (NotesQueryInfo object) 316
Binding data 39
BindLayer data binding
BindLayer object 66
BindLayer parameter 63
displaying data as points 65–67
BindLayer object 146
Bitmap Symbols
required 134
Bitmaps
defined 409
BitmapSymbol Keys 506
BitmapSymbol object 151
BitmapSymbols collection 151
Bivariate thematic maps 90
BodyTextStyle property (Legend object) 277
Border property (Title object) 392
BorderStyle property (ThemeProperties object) 388
Boundary regions
defined 409
Bounds property (BoundsConstraint object) 153
Bounds property (CoordSys object) 157
Bounds property (Feature object) 176
Bounds property (Layer object) 243
Bounds property (Layers collection) 267
Bounds property (MapObject) 288
BoundsConstraint object 153
BufferFeatures method (FeatureFactory object) 189
BuildSourceRows property (Datasets collection) 163
C
Cadastral
defined 409
Caption property (Feature object) 176
Caption property (Graphic object) 224
Caption property (Label object) 229
Caption property (Title object) 392
Cartesian coordinates 409
Cartography
defined 410
CenterX property (MapObject) 288
CenterX property, CenterY property (Feature object) 177
CenterY property (MapObject) 288
Centroid property (Geoset object) 222
Centroid( ) function 475
Centroids
defined 410
CentroidX( ) function 476
CentroidY( ) function 476
Choose Projection dialog
displaying at run time 110
Chr$( ) function 477
CircleTypeConstants 448
ClearCustomLabels method (Layer object) 246
ClearSelection method (Layers collection) 267
ClearSelection method (Selection collection) 341
Client-side image map (CSIM)
defined 410
Client-side script
defined 410
ClipLine method (MapObject) 289
CliplineV method (MapObject) 290
ClippedBounds property (Layer collection) 267
ClippedBounds property (Layer object) 245
Clone method (CoordSys object) 157
Clone method (Feature object) 176
Clone method (Features collection) 184
Clone method (RowValues object) 338
Clone method (Selection collection) 341
Clone method (Style object) 357
Clone method (Variables collection) 395
CloseMatchMax property (Find object) 212
ClosestAddr property (Find object) 213
ColorConstants 448
ColorMethod property (ThemeProperties object) 391
COM objects
See Static Dataset objects
CombineFeatures method (FeatureFactory object) 191
Common Gateway Interface (CGI)
defined 410
Common method (Features collection) 184
Common method (Selection collection) 342
Compact property (Legend object) 278
CompactTitle property (Legend object) 278
CompactTitleStyle property (Legend object) 278
Comparison operators 466
Component tables
drilldown layers 100
ComputeTheme property (Theme object) 375
ConnectString property (OCIQueryInfo object) 320
ConnectString property (ODBC QueryInfo object) 321
Constants 446
aggregation functions 65
datasets 62
range distribution 84–85
theme type 81
Tool type 126
Contains method (Datasets object) 169
ConversionConstants 450
ConvertCoord method (MapObject) 291
ConvertCoordP method (Map object) 291
ConvertCoordV method (MapObject) 292
Coordinate System Parameters 110
Coordinate systems 410
CoordSys object 107
interpreting type numbers 113–114
MAPINFOW.PRJ file 112–114
reference material 117
specifying for a map 108
CoordSys object 156
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
551
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
obtaining 107
querying properties 107
CoordSys property (BindLayer object) 146
CoordSys property (Layer object) 245
CoordSysTypeConstants 450
Cos( ) function 477
Count property (Annotations collection) 144
Count property (BitmapSymbol object) 151
Count property (DataSets collection) 169
Count property (Features collection) 185
Count property (Fields collection) 210
Count property (Geoset collection) 222
Count property (Labels collection) 233
Count property (Layers collection) 267
Count property (LegendTexts object) 284
Count property (MultivarCategories collection) 315
Count property (Parts collection) 322
Count property (Point object) 326
Count property (RangeCategories collection) 329
Count property (ResolveObjects collection) 335
Count property (RowValues collection) 337
Count property (Selection collection) 340
Count property (SourceRow object) 347
Count property (Theme object) 379
Count property (Variables collection) 395
Creatable
objects 35
Creatable Objects in MapX 35
CreateAllFeaturesConstraint method 243
CreateArc method (FeatureFactory object) 191
CreateBoundsConstraint method (Layer Object) 244
CreateCircularRegion method (FeatureFactory object)
193
CreateCollectionFeature method (FeatureFactory object)
194
CreateCustomTool method (MapObject) 292
CreateEllipticalRegion method (FeatureFactory object)
195
CreateFeaturesConstraint method (Layer Object) 244
CreateLayer method (Layers collection) 268
CreateLine method (FeatureFactory object) 196
CreateMultipoint method (FeatureFactory object) 196
CreateRegion method (FeatureFactory object) 196
CreateSymbol method (FeatureFactory object) 197
CreateText method (FeatureFactory object) 197
Creating
callouts for labels 54
custom tools 125–127
drilldown tools 102
Features collection 72–73
geosets 529–530
map features 76
permanent point layer 68
polygon drawing tools 127–128
RollUp tools 103
selections at specific point 75
themes 80–81
CurrencyFormat property (Legend object) 278
CurrentTool property (MapObject) 293
CursorConstants 451
Custom Dataset Support 400
Custom dataset support 400–406
Custom Symbols 130
Custom tools
creating 125–127
drilldown tools 102
polygon drawing tools 127–128
type constants 126
writing tool handler 126–127
D
Data aggregation
Fields.Add method 64
Using the Fields.Add method 64
Data binding
adding data to a map 60–61
BindLayer 65–67
data source types 60, 70
DataSets.Add method 61
Dynamic parameter 64
Fields parameter 63
Geodictionary 33
making point layer permanent 68
MapX events used in 69
registering MapInfo tables 416
SourceData parameter 62
unbound datasets 70
using Geodictionary 68–69
data binding
Data binding 33
Data sources
data binding 39
Fields.Add method 64
geofield parameter 62–63
types 62, 70
Database property (NotesQueryInfo object) 316
Database property (NotesViewInfo object) 319
DataField property (LabelProperties object) 234
DataMax property (Theme object) 375
DataMin property (Theme object) 375
DataMismatch event 427
Dataset object 161
DataSet property (LabelProperties object) 234
DataSet property (MapObject) 293
Dataset property (RowValue object) 336
Dataset Support 400
DataSetGeoField property (MapObject) 294
Datasets 33
data binding 39
Fields collection 64
name parameter 62
refreshing 69
Themes collection 80–81
type constants 62
datasets 33
DataSets collection 161
working with DataSet objects 61
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
552
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
DataSets property (Layer collection) 246
DataSets property (MapObject) 294
DataSetTheme property (MapObject) 294
DatasetTypeConstants 453
DataSource property (ODBC QueryInfo object) 321
DataValue property (ThemeProperties object) 382
Date Clauses 469
Date Comparison 467
Datum object 171
Datum property (CoordSys object) 157
Decimal degrees
defined 410
Decimals property (Field object) 204
DefaultConversionResolution property (MapObject) 295
DefaultNumericValue property (NotesQueryInfo object)
316
DefaultStringValue property (NotesQueryInfo object) 317
DefaultStyle property (Map object) 296
DeformatNumber$( ) function 479
Degrees latitude
defined 411
Degrees longitude
defined 411
DeleteFeature method (Layer object) 246
Deleting
map features 77
Device Installer 130
Disable method (FeaturesConstraint object) 187
Disable property (BoundsConstraint object) 154
Dispatch ID Table 507
DisplayCoordSys property (Map object) 296
Displaying
data as points 65–67
labels 54
raster images 56
Distance method (Map object) 296
Distance( ) function 479
DistMethod property (ThemeProperties object) 382
DistribMethodConstants 453
Dot density maps
thematic map type 86–87
DotColor property (ThemeProperties object) 389
DotSize property (ThemeProperties object) 383
DotSizeConstants 453
Drawing layers 58
DrawLabelsAfter property (Layer object) 247
DrawLineSample method (Style object) 358
Drawn property (Label object) 229
DrawRegionSample method (Style object) 358
DrawSymbolSample method (Style object) 358
DrawTextSample method (Style object) 359
DrawUserLayer Event 427
Drilldown applications
component table requirements 100
drilldown table requirements 101–102
drilldown tool 102
procedure summary 100
RollUp tool 103
Drilldown layers
description 98–99
limitations and requirements 104
related constants 104
related methods and properties 104
resetting 103
terms and concepts 99–100
Drilldown tables
metadata keys 102
Drilldown tools
creating 102
DrilldownAddFeatures method (Layer object) 247
DrilldownRemoveFeatures method (Layer object) 247
DrilldownReset method (Layer object) 248
Duplicate property (LabelProperties object) 235
Dynamic parameter
dynamic data binding 64
DynamicSelection property (Map object) 297
E
Eccentricity property (Datum object) 171
Editable (Layer object) 248
Editable property (Annotations collection) 144
Editable property (Title object) 392
EditableLabels property (Map object) 297
Edited property (Label object) 229
EditedAnchor property (Label object) 229
EditedAngle property (Label object) 230
EditedCaption property (Label object) 230
EditedLineStyle property (Label object) 230
EditedLineType property (Label object) 230
EditedMultiSegment property (Label object) 230
EditedOffset property (Label object) 231
EditedPosition property (Label object) 231
EditedTextStyle property (Label object) 231
EditedVisibile property (Label object) 231
Editing
map features 75–77
Ellipsoid property (Datum object) 171
Enable method (AllFeaturesConstraint object) 141
Enable method (BoundsConstraint object) 154
Enable method (FeaturesConstraint object) 188
Enabled property (AllFeaturesConstraint object) 140–141
Enabled property (BoundsConstraint object) 154
Enabled property (FeaturesConstraint object) 188
EndAccess method (Layer object) 249
EndDate property (NotesQueryInfo object) 317
EraseFeature method (FeatureFactory object) 198
Error Codes 435
Event handler
defined 411
Events 423
ExactMatch property (FindResult object) 220
Exp( ) function 480
ExportFormatConstants 454
ExportLegend method (Legend object) 278
ExportLineSample method (Style object) 359
ExportMap method (Map object) 298
ExportRegionSample method (Style object) 360
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
553
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
ExportSelection property (Map object) 299
ExportSymbolSample method (Style object) 360
ExportTextSample method (Style object) 361
Expressions 463
F
FalseEasting, FalseNorthing properties (CoordSys object)
157
Feature object 174
Feature objects
properties 74
FeatureEditMode property (Map object) 299
FeatureEditModeConstants 454
FeatureFactory
methods 76
FeatureFactory object 189
FeatureFactory property (Map object) 299
FeatureID property (Feature object) 177
FeatureID property (FindMatch object) 218
FeatureIDFromFeatureName method (Layer object) 249
FeatureKey (Label object) 231
FeatureKey property (Feature object) 177
FeatureKey property (FindMatch object) 218
FeatureKeyFromFeatureName method (Layer object) 249
Features
types 39
Features (FeaturesConstraint object) 188
Features collection 174
creating 72–73
description 72
modifying 73
FeaturesConstraint object 187
FeatureTypeConstants 454
Field object 203
Field property (RowValue object) 336
Fields collection 203
data binding 64
Fields parameter
determining data source fields 63
Fields property (DataSet object) 163
Fields property (Theme object) 376
FieldTypeConstants 454
Filespec property (BindLayer object) 146
FileSpec property (Layer object) 250
Fill patterns
defined 411
FillPatternConstants 455
Find object 212
locating map features 95
result codes 95–96
Find object, Using
locating map features 95
Find property (Layer object) 250
FindDataset property (Find object) 213
FindFeature object 216
storing feature object properties 95–96
FindField property (Find object) 213
FindMatch object 218
FindMatches collection 218
FindRC property (FindFeature object) 216
FindRC property (FindResult object) 220
FindResult object 220
Fix( ) function 480
Font Attributes 77
Format$( ) function 481
FormatDate$( ) function 482
FormatNumber$( ) function 483
Frames 411
FullTextSearch property (NotesQueryInfo object) 317
Functions 470
G
Geocoding
defined 411
Geodictionary
data binding 68–69
geodictionary file 417–418
matching data source to a layer 32
registering layers 421
Geodictionary Manager
command line options 421–422
registering MapInfo tables 416
running 418–421
utility location 549
GeoDictionary property (Map object) 299
Geofield parameter
data sources 62–63
GeoField property (DataSet object) 163
Geographic Information System (GIS)
defined 411
Geoset Keys 502
Geoset keys 502
Geoset Manager
labels 534–535
Layer Control options 532–535
Map menu options 530–536
Pan tool 531
setting projections 535–536
setting zoom level 530–532
utility location 549
View menu options 536
Geoset object 222
GeoSet property (Map object) 300
Geosets
creating 529–530
opening 528–529
overview 32
saving 530
Geosets collection 222
GeoSets property (Map object) 300
GeoSetWidth property (Map object) 301
GetDrilldownFeaturesByID method (Layer object) 250
GetFeatureByID method (Layer object) 251
GetFeatureByKey method (Layer object) 251
GetXY method (Points collection) 326
Glossary of terms 409–415
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
554
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
Graduated property (ThemeProperties object) 383
Graduated symbol maps
thematic map type 86
GraduateSizeBy property (ThemeProperties object) 389
Graduation Constants 455
Graphic object 224
Graphic property (Annotation object) 142
Graticule
defined 411
IntersectionTestConstants 455
Invalidate method (Layer object) 251
IsPointVisible method (Map object) 302
Item method (Variables collection) 396
Item property (Annotations collection) 144
Item property (BitmapSymbol object) 151
Item property (DataSets collection) 169
Item property (Features collection) 185, 341
Item property (Fields collection) 210
Item property (Geoset collection) 223
Item property (IndividualValueCategories collection) 226
Item property (Labels Collection) 233
Item property (Layers collection) 269
Item property (LegendTexts object) 284
Item property (MultivarCategories collection) 315
Item property (Parts collection) 322
Item property (Points collection) 326
Item property (RangeCategories collection) 329
Item property (ResolveObjects collection) 335
Item property (RowValues collection) 337
Item property (SourceRow object) 347
Item property (Theme object) 379
H
HasMultipoint property (Feature object) 178
HasPolyline property (Feature object) 178
HasRegion property (Feature object) 178
Height property (Legend object) 279
Height property (Rectangle object) 332
Home pages
defined 412
HTML
client-side image maps (CSIMs) 410
defined 412
hWnd property (Map object) 301
Hypertext
links 412
transfer protocol (HTTP) 412
K
I
Image maps
defined 412
Independent property (ThemeProperties object) 383
Indexed property (Field object) 204
Individual values maps
thematic map type 82–83
IndividualValueCategories collection 226
IndividualValueCategories property (ThemeProperties object) 384
IndividualValueCategory object 226
InflectionColor property (ThemeProperties object) 391
InflectionRange property (ThemeProperties object) 390
InflectRanges property (ThemeProperties object) 390
InfotipPopupDelay property (Map object) 301
InfotipSupport property (Map object) 301
InsertionLayer (Layers object) 268
Installation
product components 13–14
system requirements 13
InStr( ) function 484
Int( ) function 484
Integrated Development Environment (IDE)
defined 412
Interactive labeling 55
Internet Server Application Programming Interface
defined 412
IntersectFeatures method (FeatureFactory object) 200
IntersectionNotFound property (FindResult object) 221
IntersectionPointConstants 455
IntersectionPoints method (FeatureFactory object) 201
IntersectionTest method (FeatureFactory object) 202
KeyField property (Layer object) 252
KeyLength property (BindLayer object) 147
Keys to the Windows Registry 136
KeyValue property (Feature object) 178
L
Label collection 228
Label object and Label collection 228
Label tool 55
LabelAlong (LabelProperties object) 235
LabelAlongConstants 456
LabelAtPoint method (Layer object) 253
LabelChanged Event 428
LabelMax property (LabelProperties object) 235
LabelPartialObjects property (LabelProperties object) 235
LabelPoint property (Feature object) 179
LabelProperties object 234
controlling label display 54–55
LabelProperties property (Layer object) 253
Labels
controlling display 54
generating for a layer 53–55
in Geoset Manager 534–535
removing 55
Labels property (Layer object) 252
LabelThematics 92
LabelZoom property (LabelProperties object) 236
LabelZoomMax property (LabelProperties object) 236
LabelZoomMin property (LabelProperties object) 236
Latitude
defined 413
Layer Control
Geoset Manager 532–535
Layer Control dialog
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
555
MapX_Mobile_DevGuide.pdf
Developer Guide
calling 45
display options 45
Layer object 239
layer properties 49
Layer property (DataSet object) 163
Layer property (Feature object) 179
Layer property (Label object) 232
Layer property (Theme object) 376
LayerBeginAccessConstants 456
LayerEndAccessConstants 456
LayerInfo object 271
LayerInfoTypeConstants 456
LayerName property (BindLayer object) 147
LayerPackConstants 456
Layers
defined 413
description 42
draw order in collection 50
generating labels 53–55
registering in Geodictionary 421
user draw layers 58
zoom layering 52–53
Layers collection 239
checking layer feature type 51
checking layer type 50
methods 45–48
obtaining 42–44
properties 44–45
Layers property (Map object) 302
LayersDlg method (Layers collection) 269
LayerSrvLayerOptions 457
LayerType property (BindLayer object) 147
LayerTypeConstants 457
LCase$( ) function 485
Left property (Legend object) 279
Left$( ) function 486
Legend object 277
Legend objects
with Theme objects 92
Legend property (Theme object) 376
LegendDlg method (Legend object) 279
LegendText object 283
LegendTexts 283
LegendTexts collection 283
LegendTexts property (Legend object) 280
Length property (Feature object) 179
License String 136
LineColor property (Style object) 361
LineInterleaved property (Style object) 362
LineStyle property (Style object) 362
LineStyleCount property (Style object) 363
LineSupportsInterleave property (Style object) 363
LineType property (Label object) 232
LineType property (LabelProperties object) 236
LineTypeConstants 457
LineWidth property (Style object) 364
LineWidthUnit property (Style object) 364
Links
hypertext 412
Appendix N: Index
Locating map features 95, 95
Log( ) function 486
Logical Comparison 467
Logical operators 468
Longitude
defined 413
Longitude/latitude
defined 413
LTrim$( ) function 487
M
Map control
adding 18
Map creation
creatable objects 35
geoset overview 32
layers overview 30
Map object 29
map properties 29–30
Map features
creating 76
deleting 77
description 72
editing 75–77
modifying 76
obtaining for editing 77
stand-alone 74
Map images
defined 412
Map layer description 42
Map menu
using Geoset Manager 530–536
Map object 285
feature types 39
properties 29
MapDraw Event 429
MapDrawConstants 457
MapInfo tables
data source type 70
registering in Geodictionary 33, 416
MAPINFOW.PRJ file
customizing 113
parameters 112
using settings 112–114
MapInitialized event 429
MapPaperHeight property (Map object) 302
MapPaperWidth property (Map object) 302
Maps and Geosets
Installing 135
MapScreenHeight property (Map object) 303
MapScreenWidth property (Map object) 303
MapUnit property (Map object) 302
MapUnitConstants 457
MapViewChanged event 429
MapX
documentation set description 25–26
key features 10
product components 13–14
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
556
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
system requirements 13
MapX data
installation notes 549
sources 539–548
MapX Events 423
MapX Font Files
required for distribution 133
MapXtreme
glossary of terms 409–415
MatchedFeature property (FindResult object) 221
Matches property (FindResult object) 221
MatchThreshhold property (Map Object) 303
Mathematical operators 465
Max property (RangeCategories collection) 330
Maximum( ) function 487
MaxNumDocs property (NotesQueryInfo object) 317
MaxSearchTime property (Map object) 303
MaxVectorSymbolCharacter property (Style object) 371
MBR( ) function 487
Meridian
defined 413
Methods
DataSets collection 61
FeatureFactory 76
Fields collection 64
Layers collection 45–48
Selection collection 75
Themes collection 80–81
Mid$( ) function 488
MilitaryGridReferenceToPoint method (Map object) 304
MilitaryGridReferenceToPointV method (Map object) 304
MilitraryGridReferenceFromPoint method (Map object)
304
Min property (RangeCategories collection) 330
Minimum( ) function 489
MinVectorSymbolCharacter property (Style object) 370
Modifying
existing map features 76
Features collection 73
themes 90–92
Month( ) function 489
MouseIcon property (Map object) 305
MousePointer property (Map object) 306
MouseWheel Event 429
MouseWheelSupportConstants 458
Move method (Layers collection) 269
MultipleMatches property (FindResult object) 221
Multipoint property (Feature object) 179
MultiSegment property (Label object) 232
MultivarCategories collection 315
MultivarCategories property (ThemeProperties object)
384
MultivarCategory object 315
N
NADCON Support Files 131
Nadcon Support Files
required for distribution 133
Name parameter
datasets 62
Name property (BitmapSymbol object) 151
Name property (DataSet object) 163
Name property (Feature object) 180
Name property (Field object) 204
Name property (FindMatch object) 218
Name property (Layer object) 253
Name property (Theme object) 376
NegativeSymbolStyle property (ThemeProperties object)
389
Netscape Server Application Programming Interface
(NSAPI)
defined 413
Node Selecting and Editing 121
Nodes property (Feature object) 180
NoFeatures method (Layer object) 253
Non-earth maps
defined 413
NotesQueryInfo object 316
NotesViewInfo object 319
Numerical Comparison 466
NumericCoordSys property (Map object) 306
NumItems property (IndividualValueCategories collection) 227
NumRanges property (ThemeProperties object) 384
O
Object editing tools 121
ObjectInfo( ) function 489
ObjectLen( ) function 489
Objects
creatable 35
OCIQueryInfo object 320
ODBC drivers
defined 413
ODBCQueryInfo object 321
Offset method (Feature object) 180
Offset method (Point object) 324
Offset method (Rectangle object) 332
Offset property (Label object) 232
Offset property (LabelProperties object) 237
OLE_COLOR Values 538
Opening
geosets 528–529
Operators 465
OriginLatitude, OriginLongitude properties (CoordSys object) 157
OtherBoundary property (Find object) 214
Overlap property (LabelProperties object) 237
OverrideStyle property (Layer object) 254
OverwriteFile property (BindLayer object) 148
P
Pack method (Layer object) 254
Pan method (Map object) 307
Pan tool
Geoset Manager 531
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
557
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
PanAnimationLayer property (Map object) 307
PaperHeight property (Legend object) 280
PaperUnit property (Map object) 307
PaperUnitConstants 458
PaperWidth property (Legend object) 280
Parallel property (LabelProperties object) 237
Parameter property (LayerInfo object) 276
PartialSegments property (LabelProperties object) 237
Parts collection 322
Parts property (Feature object) 181
PathName property (Geoset object) 222
PenStyleConstants 459
Perimeter property (Feature object) 181
Perimeter( ) function 490
PickCoordSys method (CoordSys object) 158
PickLine method (Style object) 364
PickRegion method (Style object) 364
PickSymbol method (Style object) 364
PickText method (Style object) 365
Pie chart maps
thematic map type 89–90
PieClockwise property 386
PieGraduated property (ThemeProperties object) 386
PieHalfPies property (ThemeProperties object) 386
PieStartAngle property 386
Pixels
defined 413
Point object 324
Point property (Feature object) 181
Point reference binding 67
Points collection 324
Polygon drawing tools 127–128
Polyline property (Feature object) 181
PolyToolFlagConstants 459
PolyToolUsed Event 430
Position of labels 54
Position property (Graphic object) 224
Position property (Label object) 232
Position property (LabelProperties object) 237
Position property (Title object) 392
PositionConstants 459
PositiveSymbolStyle property (ThemeProperties object)
388
Precision (Field object) 204
PredominantFeatureType property (Layer object) 255
PreferCompactLegends property (Map object) 307
PrimeMeridian property (Datum object) 172
PrintLegend method (Legend object) 280
PrintMap method (Map object) 307
Product features 10
Project links
defined 414
Projections
defined 414
setting in Geoset Manager 535–536
Proper$( ) function 491
Properties
Annotations collection 34–35
BindLayer object 66
Feature object 74
Layer object 49
Layers collection 44–45
Map object 29
Theme objects 82
Properties property (Theme object) 377
Property Page
modifying a map 29–30
PropertyPage method (Map object) 308
Q
Query property (NotesQueryInfo object) 317
Query property (OCIQueryInfo object) 320
R
Range property (CoordSys object) 158
RangeCategories collection 329
RangeCategories property (ThemeProperties object) 384
RangeCategory object 329
Ranged maps
range distribution types 84–85
thematic map type 83–85
Raster Format Handlers
Installing 134
Raster images
displaying 56
ReadFromFile method (State object) 351
ReadOnly property (Dataset object) 165
ReadOnly property (RowValue object) 336
ReadOnly property (RowValues collection) 337
Rectangle object 332
RedrawInterval property (Map object) 308
RefColumn1 property (BindLayer object) 149
RefColumn2 property (BindLayer object) 149
ReferenceLayer property (BindLayer object) 149
ReferenceLayerfield property (BindLayer object) 150
RefineDataset property (Find object) 214
RefineField property (Find object) 214
RefineLayer property (Find object) 214
RefineRegion property (FindResult object) 221
Refining boundaries
feature searches 95
Refresh method (BitmapSymbol collection) 152
Refresh method (DataSet object) 164
Refresh method (Layer object) 255
Refresh method (Map object) 309
Refreshing datasets 69
Region property (Feature object) 182
RegionBackColor property (Style object) 365
RegionBorderColor property (Style object) 365
RegionBorderStyle property (Style object) 365
RegionBorderWidth property (Style object) 365
RegionBorderWidthUnit property (Style object) 366
RegionColor property (Style object) 366
RegionPattern property (Style object) 366
RegionTransparent property (Style object) 366
Remove method (Annotations collection) 144
Remove method (DataSets collection) 169
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
558
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
Remove method (Features collection) 185
Remove method (Fields collection) 210
Remove method (Layers collection) 270
Remove method (Parts collection) 322
Remove method (Point object) 328
Remove method (RowValues object) 337
Remove method (Selection collection) 342
Remove method (Theme object) 380
Remove method (Variables collection) 396
RemoveAll method (Annotations collection) 145
RemoveAll method (DataSets collection) 170
RemoveAll method (Fields collection) 211
RemoveAll method (Layers collection) 270
RemoveAll method (Parts collection) 323
RemoveAll method (Point object) 328
RemoveAll method (RowValues collection) 338
RemoveAll method (Theme object) 380
RemoveAll method (Variables collection) 396
RemoveByID method (Features collection) 185
Removing
labels 55
Replace method (Features collection) 186
Replace method (Selection collection) 343
RequestData event 431
Reset method (State object) 351
ResolveDataBind event 432
ResolveDataBindConstants 459
ResolveDataBindEx event 432
ResolveObject object 335
ResolveObjects collection 335
Restore method (DataSets collection) 165
Restore method (State object) 352
Result codes
Find object 95–96
Right$( ) function 491
RollUp tools
creating 103
RotateX, RotateY, RotateZ properties (Datum object) 172
Rotation property (Map object) 310
Round( ) function 492
RoundBy property (ThemeProperties object) 390
RoundRanges property (ThemeProperties object) 389
Row property (SourceRow object) 347
RowCount property (DataSet object) 164
RowValue object 336
RowValues collection 336
RowValues property (Dataset object) 164
RTrim$( ) function 492
S
Sample applications
additional programs 10
Sample Geoset 502
Save method (Map object) 353
SaveMapAsGeoset method (Map object) 310
Saving
geosets 530
ScaleAdjust property (Datum object) 172
ScaleFactor property (CoordSys object) 158
Score property (FindMatch object) 218
Search method (Find object) 215
Search method (Layer object) 255
Search type constants
selections 75
SearchAtPoint method (Layer object) 256
SearchEx method (Find object) 213
SearchPath property (Map object) 311
SearchResultTypeConstants 460
SearchTypeConstants 459
SearchWithinDistance method (Layer object) 257
SearchWithinFeature method (Layer object) 258
SearchWithinRectangle method (Layer object) 259
Secondary Geofield parameter 63
SecondaryGeoField property (DataSet object) 165
Selectable property (Layer object) 259
SelectAll method (Selection collection) 343
SelectByID method (Selection collection) 343
SelectByPoint method (Selection collection) 344
SelectByRadius method (Selection collection) 345
SelectByRectangle method (Selection collection) 345
SelectByRegion method (Selection collection) 346
Selected property (Label object) 232
Selection collection 340
description 72
methods 75
Selection property (Layer object) 259
SelectionChanged event 433
Selections
creating at specific point 75
search type constants 75
SelectionChangedEvent 75
SelectionStyle property (Map object) 311
SelectionTypeConstants 460
SemiMajorAxis, SemiMinorAxis properties (Datum object) 172
Server (NotesViewInfo object) 319
Server property (NotesQueryInfo object) 317
Server-side image map
defined 414
Set method (AffineTransform object) 139
Set method (CoordSys object) 158
Set method (Datum object) 172
Set method (Point object) 325
Set method (Rectangle object) 333
SetSize method (Map object) 311
Sgn( ) function 493
Shapefile (.shp) 271
ShowCentroids (Layer object) 260
ShowCount property (Legend object) 281
ShowEmptyRanges property (Legend object) 281
ShowLineDirection (Layer object) 260
ShowNegativeValues property (ThemeProperties object)
388
ShowNodes (Layer object) 260
Sin( ) function 493
Sites
description 414
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
559
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
Size property (ThemeProperties object) 384
Smooth property (Feature object) 182
SnapTolerance (Map object) 312
SnapToNodeSupport (Map object) 312
SourceData parameter
data binding 62
SourceMatch property (ResolveObject object) 335
SourceRow object 347
SourceRows collection 347
SourceRows property (DataSet object) 166
Space$( ) function 494
Specifying styles
labels 54
SpreadBy property (ThemeProperties object) 385
SpreadByConstants 460
SqlQuery property (ODBC QueryInfo object) 321
Sqr( ) function 494
Stand-alone features 74
Standard tools
available types 120
StandardParallelOne, StandardParallelTwo properties
(CoordSys object) 159
State Object 349
Static dataset objects
interfaces 401–406
registration 401
Static pages
defined 414
Str$( ) function 497
Stream property (State object) 354
String Clauses 468
String Comparison 467
String operator 466
StringCompare( ) function 494
StringCompareIntl( ) function 495
StringToDate( ) function 496
Style object 356
Style property (Feature object) 182
Style property (Graphic object) 224
Style property (IndividualValueCategories collection) 227
Style property (Label object) 233
Style property (LabelProperties object) 238
Style property (Layer object) 260
Style property (MultivarCategory object) 315
Style property (RangeCategories collection) 331
StyleUnitConstants 460
Substitute property (FindResult object) 221
SubTitle property (Legend object) 281
SubTitleStyle property (Legend object) 281
Supported Formats
raster images 56
SupportsBitmapSymbols property (Style object) 367
SupportsPack method (Layer object) 260
SymbolBitmapColor property (Style object) 367
SymbolBitmapName property (Style object) 367
SymbolBitmapOverrideColor property (Style object) 368
SymbolBitmapSize property (Style object) 368
SymbolBitmapTransparent property (Style object) 368
SymbolCharacter property (Style object) 369
SymbolFont property (Style object) 369
SymbolFontBackColor property (Style object) 369
SymbolFontColor property (Style object) 369
SymbolFontHalo property (Style object) 370
SymbolFontOpaque property (Style object) 370
SymbolFontRotation property (Style object) 370
SymbolFontShadow property (Style object) 370
SymbolStyle property (ThemeProperties object) 385
SymbolType property (Style object) 373
SymbolTypeConstants 460
SymbolVectorColor property (Style object) 371
SymbolVectorSize property (Style object) 371
System requirements
MapX 13
T
TableMatch property (ResolveObject object) 335
TableName property (ResolveObject object) 335
Tan( ) function 497
Text objects 55
Text property (LegendText object) 283
TextFont property (Style object) 371
TextFontAllCaps property (Style object) 371
TextFontBackColor property (Style object) 371
TextFontColor property (Style object) 372
TextFontDblSpace property (Style object) 372
TextFontHalo property (Style object) 372
TextFontOpaque property (Style object) 372
TextFontRotation property (Style object) 372
TextFontShadow property (Style object) 372
TextStyle property (Title object) 392
Thematic legends 92
Thematic maps
bivariate 90
types 82–90
using data 79
Theme object 374
Theme objects
properties 82
ThemeDlg method 91
ThemeDlg method (Theme object) 377
ThemeModifyRequested event 433
ThemeProperties object 381
ThemeProperties property (Theme object) 377
Themes
creating 80–81
modifying 90–92
type constants 81
Themes collection 374
methods 80–81
ThemeProperties object 91–92
Themes property (DataSet object) 166
ThemeTypeConstants 461
Title object 392
Title property (Legend object) 281
Title property (Map object) 313
TitleText property (Map object) 313
Tool handler 126–127
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
560
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
ToolConstants 461
ToolFlagConstants 462
Tools
object editing 121
polygon drawing tools 127–128
specifying current tool 120
standard types 120
ToolTypeConstants 462
ToolUsed event 433
ToolUsedEvent 127
Top property (Legend object) 282
True Type Font Symbol Keys 506
Type property (Annotation object) 142
Type property (CoordSys object) 160
Type property (DataSet object) 166
Type property (Feature object) 182
Type property (Field object) 205
Type property (Layer object) 261
Type property (LayerInfo object) 275
Type property (Theme object) 378
TypeEx property (Field object) 205
Visual Basic
adding a map 19–20
W
WaitCursorEnabled property (Map object) 313
Web browser
defined 414
Web server
defined 415
Web sites
defined 415
home pages 412
Weekday( ) function 499
Width (Field object) 204
Width property (Legend object) 282
Width property (Rectangle object) 333
Width property (ThemeProperties object) 385
Wizards
defined 415
WriteToFile method (State object) 355
WWW links
defined 415
U
X
UCase$( ) function 498
Unbound datasets
data source type 62, 70
Uniform Resource Locator (URL)
defined 414
Units method (Affine Transform object) 139
Units property (CoordSys object) 160
Unload method (BitmapSymbol collection) 152
Update method (Feature object) 182
UpdateFeature method (Layer object) 261
User draw layers 58
UserName property (Geoset object) 222
Using the Fields.Add method
adding column data as a field 64
X method (Points collection) 327
X property (Graphic object) 225
X property (Point object) 325
X property (Title object) 393
XMax property (Rectangle object) 333
XMin property (Rectangle object) 333
X-Y coordinates
displaying as points 67
specifying in a different CoordSys 109
Y
V
Val( ) function 498
Value method (DataSet object) 166
Value property (DataSet object) 166
Value property (IndividualValueCategories collection) 227
Value property (RowValue object) 337
Value property (Variable object) 395
ValuePerDot property (ThemeProperties object) 385
Variable object and Variables collection 394
Version property (Map object) 313
View (NotesViewInfo object) 319
View menu
using Geoset Manager 536
Visible property (Label object) 233
Visible property (LabelProperties object) 238
Visible property (Layer object) 262
Visible property (Legend object) 282
Visible property (LegendText object) 284
Visible property (Theme object) 378
Visible property (Title object) 393
Y method (Points collection) 327
Y property (Graphic object) 225
Y property (Point object) 325
Y property (Title object) 393
Year( ) function 499
YMax property (Rectangle object) 333
YMin property (Rectangle object) 334
Z
ZIP Code data
displaying as points 67
Zoom
layering 415
Zoom layering
labels 54
map layers 52–53
setting for a layer 50
Zoom level
setting in Geoset Manager 530–532
Zoom property (Map object) 313
ZoomLayer property (Layer object) 262
ZoomMax property (Layer object) 262
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
561
MapX_Mobile_DevGuide.pdf
Developer Guide
Appendix N: Index
ZoomMin property (Layer object) 262
ZoomTo method (Map object) 313
MapX Mobile 5.0.5
© 2004 MapInfo Corporation. All rights reserved.
562
MapX_Mobile_DevGuide.pdf
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising