phpDocumentor SMap
Objects
[ class tree: SMap ] [ index: SMap ] [ all elements ]

Class: SMap_Object

Source Location: /SMap/Object.php

Class SMap_Object

Class Overview

An Object that can appear in a layer

The Object is the basic unit of drawing. Layers generate these Objects and pass them back to the tile when SMap_Layer::getMapObjs() or SMap_Layer::getImgObjs() is called. At this point each tile has an ordered array of Objects.

The Objects are then organized by calling SMap_Object::applyTile() to pass a SMap_Tile to each Object. The intent is for each Object crop each and define the bounds which will be clipping the object. At this point, the Object has the option of returning false, and it will not be drawn.

At this point, each Object should have all of the information required to be drawn. So SMap_Object::draw() is called on each Object, and a canvas is passed. The Canvas should be fairly efficent at rasterizing only when needed.

Keep in mind that some of these steps are skipped when using cached images. For more information on the caching process, see SMap_Tile::flatten().

In order to work correctly, SMap_Object_Area_Label has some hooks in interesting places also. Only developers should need to worry about that, though.

Located in /SMap/Object.php [line 69]



		
				Author(s):
		
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Direct descendents
Child Class Description
SMap_Object_Point A point on a map
SMap_Object_Line A line between two points
SMap_Object_Area An area on the map encompassing one or more pixels
SMap_Object_Cached Manipulate a cache

[ Top ]
Property Summary
mixed   $alt  
array   $color   The color
string   $label   Are we labeling this object?
object   $layer   The layer that this object resides in
object   $map   The map that this object resides in
object   $tile   The tile that has been applied to this object
string   $url   Does this object link to anything?
object   $view   The view that this object resides in

[ Top ]
Method Summary
SMap_Object   __construct()   Give the object a context
boolean   applyTile()   Apply a tile to this object
void   draw()   Draw this object on a canvas
array   getInnerBounds()   Get the rough inner rectangular bounds for this object.
void   label()   Are we drawing a label for this object?
mixed   map()   Return a map of this object
void   setColor()   Set the color for this object
void   setLink()   Set this to link to something

[ Top ]
Properties
mixed   $alt = '' [line 98]
API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
array   $color [line 120]

The color

API Tags:
Access:  protected
See:  SMap_Object::setColor()


Redefined in descendants as:

[ Top ]
string   $label = null [line 105]

Are we labeling this object?

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
object   $layer [line 76]

The layer that this object resides in

API Tags:
Access:  protected


[ Top ]
object   $map [line 90]

The map that this object resides in

API Tags:
Access:  protected


[ Top ]
object   $tile [line 112]

The tile that has been applied to this object

API Tags:
Access:  protected


[ Top ]
string   $url = '' [line 97]

Does this object link to anything?

API Tags:
Access:  protected


Redefined in descendants as:

[ Top ]
object   $view [line 83]

The view that this object resides in

API Tags:
Access:  protected


[ Top ]
Methods
Constructor __construct  [line 128]

  SMap_Object __construct( SMap_View $view, SMap_Layer $layer  )

Give the object a context

Parameters:
object The   $view:  view that contains this object
object The   $layer:  layer that produced this object

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
applyTile  [line 188]

  boolean applyTile( SMap_Tile $tile  )

Apply a tile to this object

Do whatever precalculation is needed to display this object in a given tile. Return if this object is visible.

Parameters:
object The   $tile:  tile

API Tags:
Return:  Is visible?
Usedby:  SMap_Tile::addObject()
Abstract:  


Redefined in descendants as:

[ Top ]
draw  [line 195]

  void draw( SMap_Canvas $canvas  )

Draw this object on a canvas

Parameters:
object   $canvas: 

API Tags:
Usedby:  SMap_Tile::createImage()
Abstract:  


Redefined in descendants as:

[ Top ]
getInnerBounds  [line 170]

  array getInnerBounds( )

Get the rough inner rectangular bounds for this object.


API Tags:
Return:  A bounding the array
Abstract:  


Redefined in descendants as:

[ Top ]
label  [line 177]

  void label( SMap_Object_Area_Label $label  )

Are we drawing a label for this object?

Parameters:
object Apply   $label:  a label to this object

API Tags:
Abstract:  


Redefined in descendants as:

[ Top ]
map  [line 208]

  mixed map( )

Return a map of this object

If we are returning a client side image map, returned set of arrays represent the "area" of the image map. They have indexes at ['alt'], ['coords'], ['shape'], and ['href'].


API Tags:
Return:  An array of arrays of coords, or false.
Usedby:  SMap_Tile::getImageMap()
Abstract:  
See:  SMap_Layer::getTileMap()
See:  SMap_Tile::getImageMap()


Redefined in descendants as:

[ Top ]
setColor  [line 146]

  void setColor( mixed $r, [integer $g = 0], [integer $b = 0], [integer $a = null]  )

Set the color for this object

This is a generic color setting method, and means different things to different subclasses. If the first parameter is false, then the color is default.

Parameters:
mixed   $r:  Red channel or false (for no color)
integer   $g:  Green channel
integer   $b:  Blue channel
integer   $a:  Alpha channel (127 == clear)


[ Top ]
setLink  [line 160]

  void setLink( string $url, string $alt  )

Set this to link to something

Parameters:
string   $url:  The URL
string   $alt:  The URL's description

API Tags:
Access:  public


[ Top ]

Documentation generated on Mon, 09 Apr 2007 18:54:51 -0500 by phpDocumentor 1.3.0