Maptitude GISDK Help |
Determines the positions of mappable fields in the arrays returned by GetMappableFields().
indices_array = GetMappableFieldIndices(string layer_name, string field_type, array mappable_field_names)
Argument |
Contents |
layer_name |
The input layer; or null for the current layer. |
field_type |
The string "All" to consider all fields in the view; the string "String" to consider only string-typed fields, or the string "Numeric" to consider only integer- and real-typed fields |
mappable_field_names |
An array of mappable field names or full field specs, such as those returned by GetMappableFields() |
An array, of the same length as the input mappable_field_names array, containing indices (integers starting from 1) and/or nulls.
For each field in the input mappable_field_names array, the corresponding element in the returned array gives the position that the field would occupy in the two arrays that are returned by GetMappableFields(), when called with the same layer_name and field_type arguments. (See GetMappableFields() for details.) A null entry indicates that the named field does not exist, or that the named field does not have the specified type (so that it would not appear in the arrays returned by GetMappableFields() when called with the same field_type argument).
Various operations change the arrays returned by GetMappableFields(), including: creating a new mappable joined view, adding expression fields, etc.. Therefore, the indices returned by GetMappableFieldIndices() may not be valid after such operations.
GetMappableFieldIndices() correctly handles fields which are part of mappable joined views. As discussed in the documentation for GetMappableFields(), a field on the layer's base view has a counterpart in any mappable joined view, but GetMappableFields() returns only the field on the base view, and not its counterpart in the joined view, since these two fields are equivalent for the layer. A full field specification of such a field on the joined view is not among the strings in the arrays returned by GetMappableFields(), and hence simple string comparisons cannot determine its index position. However, GetMappableFieldIndices() correctly returns its index position; i.e., the index position of the equivalent field in the base view.
GetMappableFieldIndices() returns null if the layer does not exist, the layer_name is null and there is no current layer, or the input mappable_field_names array is null.
Error Type |
Meaning |
Error |
The mappable_field_names array contain some non-string values; or the input layer is not geographic, e.g., it is an image layer; or some of the mappable field names are ambiguous. |
Function |
Summary |
Creates a list of the fields that are mappable to a layer |
|
Gets a list of the fields in a view |
©2025 Caliper Corporation | www.caliper.com |