classObj
final class classObj (View source)
Class Objects can be returned by the layerObj
_ class, or can be
created using:
Properties
string | $group | ||
string | $keyimage | ||
labelObj | $label | Removed (6.2) - use addLabel, getLabel, . |
|
float | $maxscaledenom | ||
hashTableObj | $metadata | ||
float | $minscaledenom | ||
string | $name | ||
int | $numlabels | read-only (since 6.2) |
|
int | $numstyles | read-only | |
int | $status | MS_ON, MS_OFF or MS_DELETE |
|
string | $template | ||
string | $title | ||
int | $type |
Methods
The second argument class is optional. If given, the new class created will be a copy of this class.
Saves the object to a string. Provides the inverse option for updateFromString.
Draw the legend icon and return a new imageObj.
Delete the style specified by the style index. If there are any style that follow the deleted style, their index will decrease by 1.
Draw the legend icon on im object at dstX, dstY.
Free the object properties and break the internal references.
Returns the :ref:expression <expressions>
string for the class
object.
Fetch class metadata entry by name. Returns "" if no entry matches the name. Note that the search is case sensitive.
Return the style object using an index. index >= 0 && index < class->numstyles.
Returns the text string for the class object.
The style specified by the style index will be moved down into the array of classes. Returns MS_SUCCESS or MS_FAILURE.
The style specified by the style index will be moved up into the array of classes. Returns MS_SUCCESS or MS_FAILURE.
Remove the labelObj at index from the labels array and return a reference to the labelObj. numlabels is decremented, and the array is updated.
Remove a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
Set object property to a new value.
Set the :ref:expression <expressions>
string for the class
object.
Set a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
Set the text string for the class object.
Update a class from a string snippet. Returns MS_SUCCESS/MS_FAILURE.
Details
final
__construct(layerObj $layer, classObj $class)
The second argument class is optional. If given, the new class created will be a copy of this class.
final int
addLabel(labelObj $label)
Add a labelObj to the classObj and return its index in the labels array.
.. versionadded:: 6.2
final string
convertToString()
Saves the object to a string. Provides the inverse option for updateFromString.
final imageObj
createLegendIcon(int $width, int $height)
Draw the legend icon and return a new imageObj.
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.
final int
drawLegendIcon(int $width, int $height, imageObj $im, int $dstX, int $dstY)
Draw the legend icon on im object at dstX, dstY.
Returns MS_SUCCESS/MS_FAILURE.
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.
final string
getExpressionString()
Returns the :ref:expression <expressions>
string for the class
object.
final labelObj
getLabel(int $index)
Return a reference to the labelObj at index in the labels array.
See the labelObj_ section for more details on multiple class labels. .. versionadded:: 6.2
final int
getMetaData(string $name)
Fetch class metadata entry by name. Returns "" if no entry matches the name. Note that the search is case sensitive.
.. note:: getMetaData's query is case sensitive.
final styleObj
getStyle(int $index)
Return the style object using an index. index >= 0 && index < class->numstyles.
final string
getTextString()
Returns the text string for the class object.
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 class->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.
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 class->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.
final labelObj
removeLabel(int $index)
Remove the labelObj at index from the labels array and return a reference to the labelObj. numlabels is decremented, and the array is updated.
.. versionadded:: 6.2
final int
removeMetaData(string $name)
Remove a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
final int
set(string $property_name, $new_value)
Set object property to a new value.
final int
setExpression(string $expression)
Set the :ref:expression <expressions>
string for the class
object.
final int
setMetaData(string $name, string $value)
Set a metadata entry for the class. Returns MS_SUCCESS/MS_FAILURE.
final int
settext(string $text)
Set the text string for the class object.
final int
updateFromString(string $snippet)
Update a class from a string snippet. Returns MS_SUCCESS/MS_FAILURE.
.. code-block:: php set the color $oClass->updateFromString('CLASS STYLE COLOR 255 0 255 END END');