"setPropShapeWildcard"

Set a property of various shapes that match a wildcard.

Synopsis

void setPropShapeWildcard(string strLayer, string strField, string strVarValue, double dRangeMin, double dRangeMax, string strProperty, string strValue);

Parameters

Parameter Description
strLayer The layer of the shapes whose property should be set.
strField The name of the shape field. The 'strVarValue' will be compared to the value of this specified field.
strVarValue The shape meaning the 'strVarValue' will be compared to the value of the specified field.
dMinRange Minimum range for the numerical comparison. See description.
dMaxRange Maximum range for the numerical comparison. See description.
strProperty

The property that should be set.

'SYMBOL=x'

'VISIBLE=0/1' (Visibility)

'FILLRGB=%X' (Fill RGB color; HEX format)

'FILLNAME=RED' (Fill color)

'LINERGB=%X" (Line RGB color; HEX format)

strValue

The value of the property. This value will be set.

For example: the property "VISIBLE" and the value "1" (VISIBLE).

or

The property "FILLNAME" (Fill color) and the value "red".

Description

Set a property of various shapes that match a wildcard.

The wildcard works in one of two ways.

a) When (strVarValue != "") the 'strStringValue' will be compared to the value of the specified field

b) When (strVarValue == "" ) then a numerical comparison is executed. Match is found when the numerical value of the field is within this range.

The function setPropShapeWildCard is used to set a property for N shapes. It accepts : a field name (one of the fields in the DBF file ), a string and 2 floats. When the string is not empty, the function will search for a match in the database field, for example field "NAME" and value "Austr*".

When the string is empty, then the 2 values (dMinRange, dMaxRange) are being used. All shapes that have the numerical value between these 2 values, will be used. As an example: color all countries with a "POPULATION" between 10 and 20 million.)

It is to consider that the values for the properties FILLRGB and LINERGB must be stated using the HEX format otherwise a correct displaying of the colors can not be ensured.

Example

Sets the fill color of the land Finland to blue.

main()
{
  GisViewer_ewo1.setPropShapeWildcard( "COUNTRY", "NAME", "Finland", 0, 0, "FILLNAME" , "Blue" );
}

Sets the fill color to red (HEX: FF0000)

main()
{
  GisViewer_ewo1.setPropShapeWildcard( "COUNTRY", "NAME", "Finland", 0, 0, "FILLRGB" , "FF0000" );
}

Assignment

GIS Viewer