final class labelObj (View source)

labelObj are always embedded inside other classes.

Properties

int $align
float $angle
int $anglemode
int $antialias
int $autominfeaturesize
colorObj $backgroundcolor

(deprecated since 6.0)

colorObj $backgroundshadowcolor

(deprecated since 6.0)

int $backgroundshadowsizex

(deprecated since 6.0)

int $backgroundshadowsizey

(deprecated since 6.0)

int $buffer
colorObj $color
string $encoding
string $font
int $force
int $maxlength
int $maxsize
int $mindistance
int $minfeaturesize
int $minlength
int $minsize
int $numstyles
int $offsetx
int $offsety
colorObj $outlinecolor
int $outlinewidth
int $partials
int $position
int $priority
int $repeatdistance
colorObj $shadowcolor
int $shadowsizex
int $shadowsizey
int $size
int $wrap

Methods

__construct()

No description

string
convertToString()

Saves the object to a string. Provides the inverse option for updateFromString.

int
deleteStyle(int $index)

Delete the style specified by the style index. If there are any style that follow the deleted style, their index will decrease by 1.

void
free()

Free the object properties and break the internal references.

string
getBinding(mixed $labelbinding)

Get the attribute binding for a specified label property. Returns NULL if there is no binding for this property.

string
getExpressionString()

Returns the label expression string.

getStyle(int $index)

Return the style object using an index. index >= 0 && index < label->numstyles.

string
getTextString()

Returns the label text string.

int
moveStyleDown(int $index)

The style specified by the style index will be moved down into the array of classes. Returns MS_SUCCESS or MS_FAILURE.

int
moveStyleUp(int $index)

The style specified by the style index will be moved up into the array of classes. Returns MS_SUCCESS or MS_FAILURE.

int
removeBinding(mixed $labelbinding)

Remove the attribute binding for a specfiled style property.

int
set(string $property_name, $new_value)

Set object property to a new value.

int
setBinding(mixed $labelbinding, string $value)

Set the attribute binding for a specified label property.

int
setExpression(string $expression)

Set the label expression.

int
setText(string $text)

Set the label text.

int
updateFromString(string $snippet)

Update a label from a string snippet. Returns MS_SUCCESS/MS_FAILURE.

Details

final __construct()

No description

final string convertToString()

Saves the object to a string. Provides the inverse option for updateFromString.

Return Value

string

final int deleteStyle(int $index)

Delete the style specified by the style index. If there are any style that follow the deleted style, their index will decrease by 1.

Parameters

int $index

Return Value

int

final void free()

Free the object properties and break the internal references.

Note that you have to unset the php variable to free totally the resources.

Return Value

void

final string getBinding(mixed $labelbinding)

Get the attribute binding for a specified label property. Returns NULL if there is no binding for this property.

Example: .. code-block:: php $oLabel->setbinding(MS_LABEL_BINDING_COLOR, "FIELD_NAME_COLOR"); echo $oLabel->getbinding(MS_LABEL_BINDING_COLOR); // FIELD_NAME_COLOR

Parameters

mixed $labelbinding

Return Value

string

final string getExpressionString()

Returns the label expression string.

Return Value

string

final styleObj getStyle(int $index)

Return the style object using an index. index >= 0 && index < label->numstyles.

Parameters

int $index

Return Value

styleObj

final string getTextString()

Returns the label text string.

Return Value

string

final int moveStyleDown(int $index)

The style specified by the style index will be moved down into the array of classes. Returns MS_SUCCESS or MS_FAILURE.

ex label->movestyledown(0) will have the effect of moving style 0 up to position 1, and the style at position 1 will be moved to position 0.

Parameters

int $index

Return Value

int

final int moveStyleUp(int $index)

The style specified by the style index will be moved up into the array of classes. Returns MS_SUCCESS or MS_FAILURE.

ex label->movestyleup(1) will have the effect of moving style 1 up to position 0, and the style at position 0 will be moved to position 1.

Parameters

int $index

Return Value

int

final int removeBinding(mixed $labelbinding)

Remove the attribute binding for a specfiled style property.

Example: .. code-block:: php $oStyle->removebinding(MS_LABEL_BINDING_COLOR);

Parameters

mixed $labelbinding

Return Value

int

final int set(string $property_name, $new_value)

Set object property to a new value.

Parameters

string $property_name
$new_value

Return Value

int

final int setBinding(mixed $labelbinding, string $value)

Set the attribute binding for a specified label property.

Example: .. code-block:: php $oLabel->setbinding(MS_LABEL_BINDING_COLOR, "FIELD_NAME_COLOR"); This would bind the color parameter with the data (ie will extract the value of the color from the field called "FIELD_NAME_COLOR"

Parameters

mixed $labelbinding
string $value

Return Value

int

final int setExpression(string $expression)

Set the label expression.

Parameters

string $expression

Return Value

int

final int setText(string $text)

Set the label text.

Parameters

string $text

Return Value

int

final int updateFromString(string $snippet)

Update a label from a string snippet. Returns MS_SUCCESS/MS_FAILURE.

Parameters

string $snippet

Return Value

int