symbolObj
final class symbolObj (View source)
Properties
int | $antialias | ||
string | $character | ||
int | $filled | ||
string | $font | ||
string | $imagepath | read-only | |
int | $inmapfile | If set to TRUE, the symbol will be saved inside the mapfile. |
|
int | $patternlength | read-only | |
int | $position | ||
string | $name | ||
int | $numpoints | read-only | |
float | $sizex | ||
float | $sizey | ||
int | $transparent | ||
int | $transparentcolor |
Methods
Creates a new symbol with default values in the symbolist.
Free the object properties and break the internal references.
Returns an array containing the pattern. If there is no pattern, it returns an empty array.
Returns an array containing the points of the symbol. Refer to setpoints to see how the array should be interpreted. If there are no points, it returns an empty array.
Set object property to a new value.
Loads a pixmap symbol specified by the filename.
Set the pattern of the symbol (used for dash patterns).
Set the points of the symbol. Note that the values passed is an array containing the x and y values of the points. Returns MS_SUCCESS/MS_FAILURE.
Details
final
__construct(mapObj $map, string $symbolname)
Creates a new symbol with default values in the symbolist.
.. note:: Using the new constructor, the symbol is automatically returned. The If a symbol with the same name exists, it (or its id) will be returned. $nId = ms_newSymbolObj($map, "symbol-test"); $oSymbol = $map->getSymbolObjectById($nId);
final int
ms_newSymbolObj(mapObj $map, string $symbolname)
Old style constructor
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 array
getPatternArray()
Returns an array containing the pattern. If there is no pattern, it returns an empty array.
final array
getPointsArray()
Returns an array containing the points of the symbol. Refer to setpoints to see how the array should be interpreted. If there are no points, it returns an empty array.
final int
set(string $property_name, $new_value)
Set object property to a new value.
final int
setImagePath(string $filename)
Loads a pixmap symbol specified by the filename.
The file should be of either Gif or Png format.
final int
setPattern(array $int)
Set the pattern of the symbol (used for dash patterns).
Returns MS_SUCCESS/MS_FAILURE.
final int
setPoints(array $double)
Set the points of the symbol. Note that the values passed is an array containing the x and y values of the points. Returns MS_SUCCESS/MS_FAILURE.
Example: .. code-block:: php $array[0] = 1 # x value of the first point $array[1] = 0 # y values of the first point $array[2] = 1 # x value of the 2nd point ....