Search – Pitney Bowes MapXtreme User Manual

Page 472

Advertising
background image

Appendix B: Customizing MapXtreme

Customizable Classes

MapXtreme v7.1

479

Developer Guide

Public Shared Sub MapInfo_Engine_CustomProperties()
Dim bag As CustomProperties = New CustomProperties
bag.Add("One", 1)
bag.Add("DateNow", DateTime.Now)
Dim i As Integer = CType(bag("One"), Integer)
Dim ts As DateTime = CType(bag("DateNow"), DateTime)
End Sub

Search

To customize your search functions, there are a few classes that you can work with to accomplish
almost any kind of search that you desire. The QueryFilter class allows you to create custom
“where” clause to be used in SQL queries; the QueryDefinition class allows you to define a custom
SQL query to be executed; and a SearchResultProcessor sets up the post processing of the results
of your query.

For an example of how these classes are used, refer to the Search sample application included in
the Samples directory of your MapXtreme installation (the default installation location is: C:\Program
Files\MapInfo\MapXtreme\7.x.x\Samples\Desktop\Features\Search).

QueryFilter

The IQueryFilter interface defines the interface that all query filters must support. A QueryFilter is
used to define all or part of the “where” clause of a QueryDefinition.

QueryDefinition

The QueryDefinition class defines a query to be executed by a search. The QueryDefinition is made
up of a filter (IQueryFilter), Columns, and OrderBy. If no Columns are specified, then “*” is used.

ISearchResultProcessor or SearchResultProcessor

The SearchResultProcessor implements the ISearchResultProcessor interface which is used to do
post processing on the results of a search to narrow down the rows selected.

FeatureStyleModifier or FeatureOverrideStyleModifier

Create your own FeatureStyleModifiers to change the appearance of a layer by deriving from
FeatureStyleModifier or FeatureOverrideStyleModifier. These classes are used to specify a specific
FeatureStyle modification for the objects in a specific layer.

The following example creates a modifier that sets regions in USA.TAB to red if the population has
decreased from 1990 to 2000.

using MapInfo.Mapping;
using MapInfo.Styles;
using System.Drawing;

internal class UsaPopulationDecreasedModifier :
MapInfo.Mapping.FeatureStyleModifier

Advertising