Class MarkerTemplate : addOption Method


void addOption( String name, String type, String default, String description, [ String minimumValue ], [ String maximumValue ] )

Summary

Add an option for this template


Remarks

Use this to add a new option, or overwrite an existing option.

Options allow the user to change Marker fucntionality without having to edit any JavaScript. Generally speaking the more options and flexibility you add to your template the more useful it will be.


Parameters

ParameterDescription
String name Option name
String type Type of the option
String default Default value if the user doesn't change it.
String description Description as it appears on the option popup window.
String minimumValue [optional] For type "Integer" this is the minimum acceptable value.
String maximumValue [optional] For "Integer" this is the maximum acceptable value.


Examples

Code below taken from the Category template (in the standard-category.dgmarker file)."

template.addOption( "Use icons", "bool", "0", "When adding a category marker add an icon if an icon is available." );

...

if( this.getOptionValue( "Use icons" ) )
{
var strImage = "%DGIMAGEDIR%Categories.dgimglib:cat-" + programme.category.id + ".png";
if( system.doesImageExist( strImage ) )
{
marker.displayIconName = strImage;
}
}


See Also

  • MarkerTemplate : getOptionValue


    Requirements

    Build 1062