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

__construct(mapObj $map, string $symbolname)

Creates a new symbol with default values in the symbolist.

int
ms_newSymbolObj(mapObj $map, string $symbolname)

Old style constructor

void
free()

Free the object properties and break the internal references.

array
getPatternArray()

Returns an array containing the pattern. If there is no pattern, it returns an empty array.

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.

int
set(string $property_name, $new_value)

Set object property to a new value.

int
setImagePath(string $filename)

Loads a pixmap symbol specified by the filename.

int
setPattern(array $int)

Set the pattern of the symbol (used for dash patterns).

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.

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);

Parameters

mapObj $map
string $symbolname

final int ms_newSymbolObj(mapObj $map, string $symbolname)

Old style constructor

Parameters

mapObj $map
string $symbolname

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 array getPatternArray()

Returns an array containing the pattern. If there is no pattern, it returns an empty array.

Return Value

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.

Return Value

array

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 setImagePath(string $filename)

Loads a pixmap symbol specified by the filename.

The file should be of either Gif or Png format.

Parameters

string $filename

Return Value

int

final int setPattern(array $int)

Set the pattern of the symbol (used for dash patterns).

Returns MS_SUCCESS/MS_FAILURE.

Parameters

array $int

Return Value

int

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 ....

Parameters

array $double

Return Value

int