"assignVariableToShape"

Assigns a variable and a value to a shape so that the shape can be selected by the variable.

Synopsis

void assignVariableToShape(string strLayer, string strField, string strShape, string strVariable, string strValue);

Parameters

Parameter Description
strLayer The layer of the shape
strField The unique shape field of the layer
strShape The name of the shape
strVariable The name of a variable to be assigned to the shape.
strValue The value for the variable. You can use the variable later, for example, to change the color of one or more shapes that contain this variable.

Description

A GIS Viewer will typically contain several layers and each of the layers contains shapes (polygons, lines, rectangles). To select a set of shapes, assign a variable to the shapes. Therefore, you can approach all shapes that are assigned to this variable and the defined value.

Example

The code below will show all shapes that contain the variable "Cit" with the value 1. First the variable "Cit" and the value 1 will be assigned to the shape "Luxemburg" and then the shape will be zoomed.

main()
{
  GisViewer_ewo1.assignVariableToShape( "COUNTRY", "CAPITAL", "Luxembourg", "Cit", 1) ; 
  GisViewer_ewo1.zoomByVariableValue("Cit",1); 
}

Assignment

GIS Viewer