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

Class: SMap_Layer_Points

Source Location: /SMap/Layer.php

Class SMap_Layer_Points

Class Overview

A set of points

This is a layer with a set of points added to it. Because each point represents something, they are geneally clickable. If there are too many points, then it may not be as useful to make each point clickable.

Located in /SMap/Layer.php [line 717]

SMap_Layer
   |
   --SMap_Layer_Points

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From SMap_Layer

SMap_Layer::$id
SMap_Layer::$map

Inherited From SMap_Layer

SMap_Layer::__construct()
Construct the layer
SMap_Layer::cacheStatus()
How cachable is this layer?
SMap_Layer::getAdjViewBounds()
Adjust the view coords if we are in an image
SMap_Layer::getID()
Returns the ID of this layer
SMap_Layer::getImageFmt()
Recommended format for this layer
SMap_Layer::getImgObjs()
Composite this layer onto the tile (in a raster way)
SMap_Layer::getMap()
Return the map that contains this layer
SMap_Layer::getMapObjs()
Composite this layer onto the tile
SMap_Layer::hasCachedRects()
Might have cached rects in the DB
SMap_Layer::isValidZoom()
Is this layer zoomed to a useful resolution?
SMap_Layer::pxOffBound()
Get the bound at a pixel offset from a bound.

[ Top ]
Property Summary
boolean   $addLabels   Enable/Disable labels
array   $color   What color are the points in this layer?
array   $pts   Set of points to draw
boolean   $transient   A flag to mark any labels as transient

[ Top ]
Method Summary
void   add()   Add a point to this layer
array   allocPoints()   Create the point objects
array   getImgObjs()   Returns the points represented as objects
array   getMapObjs()   Returns the points represented as objects
array   getPoints()   Return the points added to this layer

[ Top ]
Properties
boolean   $addLabels = true [line 750]

Enable/Disable labels

API Tags:
Access:  protected


[ Top ]
array   $color = null [line 726]

What color are the points in this layer?

Should be formatted as three color values, followed by an alpha value.

API Tags:
Access:  protected


[ Top ]
array   $pts = array() [line 736]

Set of points to draw

The points, formatted as X map unit, Y map unit, a label, and a URL. The label and URL are optional.

API Tags:
Access:  protected


[ Top ]
boolean   $transient = false [line 743]

A flag to mark any labels as transient

API Tags:
Access:  protected


[ Top ]
Methods
add  [line 761]

  void add( float $x, float $y, [string $label = null], [string $url = null]  )

Add a point to this layer

Parameters:
float   $x:  X coord
float   $y:  Y coord
string   $label:  Label the point
string   $url:  URL link

API Tags:
See:  SMap_Layer_Points::getPoints()


[ Top ]
allocPoints  [line 796]

  array allocPoints( SMap_View $view, SMap_Tile $tile  )

Create the point objects

Create a set of objects to represent the points. These could either be SMap_Object_Point or SMap_Object_Area_Rec objects, depending on the number of them created.

More points mean that each one takes needs to consume less space, so we use SMap_Object_Point objects. Fewer points means we can spread out a bit, so we use SMap_Object_Area_Rec objects. If there is only a few points, we can add SMap_Object_Area_Label objects to each point.

Parameters:
object The   $view:  view we are rendering
object The   $tile:  tile where the points are located

API Tags:
Return:  The created objects
Usedby:  SMap_Layer_Points::getImgObjs()
Usedby:  SMap_Layer_Points::getMapObjs()
Access:  protected


[ Top ]
getImgObjs  [line 921]

  array getImgObjs( SMap_View $view, SMap_Tile $tile  )

Returns the points represented as objects

Parameters:
object The   $view:  view that's being rendered
object The   $tile:  tile which uses thes

API Tags:
Return:  The object primitives
Access:  public
Uses:  SMap_Layer_Points::allocPoints()


Redefinition of:
SMap_Layer::getImgObjs()
Composite this layer onto the tile (in a raster way)

[ Top ]
getMapObjs  [line 909]

  array getMapObjs( SMap_View $view, SMap_Tile $tile  )

Returns the points represented as objects

Parameters:
object The   $view:  view that's being rendered
object The   $tile:  tile which uses this

API Tags:
Return:  The object primitives
Access:  public
Uses:  SMap_Layer_Points::allocPoints()


Redefinition of:
SMap_Layer::getMapObjs()
Composite this layer onto the tile

[ Top ]
getPoints  [line 775]

  array getPoints( SMap_Tile $tile  )

Return the points added to this layer

Collects and returns the points displayed in this layer. The format of the returned array is defined in $pts.

Parameters:
object The   $tile:  tile obj to display the pts on

API Tags:
Return:  The points
Access:  protected
See:  SMap_Layer_Points::$pts


[ Top ]

Documentation generated on Mon, 09 Apr 2007 18:53:21 -0500 by phpDocumentor 1.3.0