Pitney Bowes MapXtreme User Manual

Page 213

Advertising
background image

Chapter 10: Creating Expressions

Expression Examples

MapXtreme v7.1

220

Developer Guide

modifier.Name = "'Date/Time: ' + DateTimeToString( dateTimeColumn,

'm/d/yyyy hh:mm tt')"
End Sub

For more information on labeling, see

Labels

.

InfoTips Expression Example

InfoTips are text items that display when a tool hovers over a Feature. Expressions can be used to
generate text for InfoTips in a similar fashion to the way they are used for labels. Use the
MapTool.SetInfoTipExpression static helper function to set the InfoTip. It takes care of creating the
InfoTip hashtable and adding the layer entry into the hashtable if it does not already exist. Each tool
can be set to have InfoTips enabled or disabled.

The following example will generate a two-line text label to display the Table alias and the X or Y
coordinate for the centroid of the object that the cursor is hovering over.

VB example:

Public Shared Sub MapInfo_Mapping_HowDoICreateExprForInfoTip(ByVal
mapControl1 As MapControl)
MapTool.SetInfoTipExpression(mapControl1.Tools.MapToolProperties,_

CType(mapControl1.Map.Layers(0), FeatureLayer), "@TableAlias + _
char(13) + _ 'Centroid X:' + MI_CentroidX(obj) + ' Y:' + _
MI_CentroidY(obj)")

End Sub

For more information on InfoTips, see

Layer Control

.

Advertising