Click or drag to resize

Parameter Statement

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Parameter Statement
Syntax PARAMETER %<param_name> [ = <default>]
Example PARAMETER %color_set = 1

The parameter statement declares a constant and exposes it to user code. This allows the value of the parameter to be set before the map is drawn. The parameter can then be used to change the appearance of the map by testing the value in if statements.

Accessing a Parameter from User Code

A parameter defined in Chameleon can be accessed from user code via the GetParameterValue(String) and SetParameter methods. A list of parameters is available via ParameterNames.

cam
MapStyle style = MapStyle.Create("style.cam");
if (style.GetParameterValue("param") == 1.5)
style.SetParameter("param", 1);
...
/* Resets "param" to the value it was
defined as in the Chameleon script file */
style.ClearParameter("param");