4.17.
RectObj Class
Up one level
Constructor, members, and methods.
- Constant names and class member variable names are case-sensitive in PHP.
- Several MapScript functions (all those that access files in the back end such as ms_newMapObj(), drawMap(), etc.) will affect the value of the current working directory (CWD) in the PHP environment. This will be fixed eventually but in the meantime you should be careful about these side-effects.
Constructor:
RectObj are sometimes embedded inside other objects. New ones can
also be created with:
RectObj ms_newRectObj() (Note: the memebers (minx, miny,maxx,maxy) are
initialized to -1);
Members:
double minx
double miny
double maxx
double maxy
Methods:
int set(string property_name, new_value)
Set object property to a new value. Returns -1 on error.
void setextent(double minx, double miny, double maxx, double maxy)
Set the rectangle extents.
int draw(mapObj map, layerObj layer, imageObj img,
int class_index, string text)
Draws the individual rectangle using layer. The class_index is used
to classify the rectangle based on the classes defined for the layer.
The text string is used to annotate the rectangle.
Returns MS_SUCCESS/MS_FAILURE.
double fit(int width, int height)
Adjust extents of the rectangle to fit the width/height specified.
int project(projectionObj in, projectionObj out)
Project the rectangle from "in" projection (1st argument) to "out"
projection (2nd argument). Returns MS_SUCCESS/MS_FAILURE.
void free()
Destroys resources used by a rect object.