static void drawBox(
SMap_Canvas
$canvas,
$xy,
$color,
$borderColor
)
|
|
Draw this rectangle
Parameters:
API Tags:
Draw a shadow around an area, prepare for the main rect to be drawn
Parameters:
API Tags:
static array findOverlap(
array
$rB, integer
$scale,
$wrap,
$vB, [
$sD = 0]
)
|
|
Finds if and how a viewport falls on an rectangle
Used to find if the rect falls within a view area, and then how to crop said rect. All parameters are in SMap Units.
The returned array is a set of bounds arrays (with pixel corners). The reason that there might be more than one return bound array is if the rect bounds wrap, and appear again. Example: one image for the globe; and we are viewing the International Date Line.
The returned arrays have integers at: ['w'] & ['h'] for width and height of the overlapping rectangle in pixels. ['vx'] & ['vy'] for view x and y offset in pixels. ['rx'] & ['ry'] for the rectangle offset in pixels (where in the rectangle are we viewing).
Parameters:
|
array |
$rB: |
View bounds (SMap Units) |
|
integer |
$scale: |
Stack depth |
|
|
$wrap: |
|
|
|
$vB: |
|
|
|
$sD: |
|
API Tags:
static void handleWrap(
array
$rB, integer
$scale, array
$wrap, integer
$vB, integer
$sD,
&$sets,
$thisSide,
$otherSide
)
|
|
Handle wrapping of an rectangle in a viewport
Called by self::findOverlap() when wrapping is detected. Preforms some adjustments on the view bounds, recursively calls self::findOverlap(), and adjusts the results back into the correct place.
I'm not sure if this seperate function is the best way to handle this because half the function is a switch statement that could have been avoided. The calculations are annoying and this shouldn't be called often, though.
Parameters:
|
array |
$rB: |
View bounds |
|
integer |
$scale: |
Stack depth |
|
array |
$wrap: |
Current set of overlapping rectangle parts |
|
integer |
$vB: |
Index of this side |
|
integer |
$sD: |
Index of the other side |
|
|
&$sets: |
|
|
|
$thisSide: |
|
|
|
$otherSide: |
|
API Tags:
Give the object a context
Parameters:
API Tags:
Redefinition of:
- SMap_Object::__construct()
- Give the object a context
Redefined in descendants as:
Parameters:
API Tags:
Redefinition of:
- SMap_Object::applyTile()
- Apply a tile to this object
Redefined in descendants as:
Draw this rectangle on an image
Parameters:
API Tags:
Redefinition of:
- SMap_Object::draw()
- Draw this object on a canvas
Redefined in descendants as:
Place the label on the rectangle
Parameters:
API Tags:
Redefinition of:
- SMap_Object::label()
- Are we drawing a label for this object?
Retrn the appropriate image map for this rectangle
All returned parameters are strings appropriate for drawing an (X)HTML image map.
API Tags:
Redefinition of:
- SMap_Object::map()
- Return a map of this object
Redefined in descendants as: