MapServerFindResult

A class containing the result of a Find operation on a map service.

Property

Type

Description

FeatureID

int

The unique ID of a returned feature.

FieldName

string

The field name which contained the search value.

LayerID

int

The unique ID of the layer which contains the find result.

Properties

PropertySet

A set of name/value pairs containing the field names and values for the feature returned. By default all values are returned as strings. Fields that are not visible in the map will not be visible in the result.

Shape

Geometry

The geometry of the returned feature.

Value

string

The attribute value which contained the search value.

Remarks

By default the this object respects field aliases set in the map or in the geodatabase. However, you have an option to retrieve the original field names instead of any field aliases: set LayerResultOptions.ReturnFieldNamesInResults to true. This option is valid for all Feature layers (IsFeatureLayer from MapLayerInfo), CAD Feature Layers, CAD Annotation Layers and Coverage Annotation Layers.

Also, by default this object respects numerical formatting set in the map. For example, a number may be formatted to display two digits to the right of the decimal. It is important to note that by default these values, though numerical in nature, are in fact a string. To retrieve the original data type of the field use LayerResultOptions.FormatValuesInResults. When setting this property to false, this object will contain unformatted field-value pairs using their original data types. Note one exception - the Shape field will always be returned as a string. This option is valid for all Feature layers (IsFeatureLayer from MapLayerInfo), CAD Feature Layers, CAD Annotation Layers and Coverage Annotation Layers.

To retrieve geometry of a find result, do not use the Shape field contained within the Properties field; instead use the Shape property. This geometry has the same spatial reference system as the MapServerInfo.DefaultMapDescription. If the Shape field is not visible in the map, the Shape property may still contain geometry depending on how LayerResultOptions.IncludeGeometry is set.

In some cases, for performance reasons, you may want limit or adjust the geometry being returned. See the LayerResultOptions discussion for more information.

11/8/2016