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

Class: SMap_View

Source Location: /SMap/View.php

Class SMap_View

Class Overview

A view of the map

Multiple views can be controlled at the same time. A view is like a porthole through which you can see the map, but only part of it at a time. The view has controls associated with it to pan, zoom, etc.

Located in /SMap/View.php [line 51]



		
				Author(s):
		
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Direct descendents
Child Class Description
SMap_View_Raster A view composed of images
SMap_View_Inset A view intended to be inset in a layer
SMap_View_Links A view composed of a table of links

[ Top ]
Property Summary
static array   $regLayers   Registered layers
array   $bkCol   Background color for this view
array   $bounds   The bounds of this view
integer   $id   Id of this view
array   $layers   All of the layers in this view
object   $map   The map that contains this view
array   $scale   What is the scale in each direction?
array   $tiles   A cached copy of all of the tiles
integer   $zoom   The zoom of this view

[ Top ]
Method Summary
static object The   createLayer()   Creates a view
SMap_View   __construct()   Give this view an identity
object The   addLayer()   Adds a layer.
array   getAdjViewBounds()   Adjust the view coords if we are in an image
string   getName()   Return the name of this view
array   getTiles()   Creates and returns the set of tiles that represent this view
string   getXHTML()   Handle getting the XHTML
void   sendObj()   Send an object to another tile
mixed   __get()   Access useful vars read-only

[ Top ]
Properties
static array   $regLayers = array(
'group' => array(false, 'SMap_Layer_Group'),'points'=>array(false,'SMap_Layer_Points'),'polygon'=>array(false,'SMap_Layer_Polygon'),'ogr'=>array(false,'SMap_Layer_OGR'),'images'=>array(false,'SMap_Layer_Images'),'grid'=>array(false,'SMap_Layer_Grid'),'zoom'=>array(false,'SMap_Layer_Zoom'),'pan'=>array(false,'SMap_Layer_Pan'))
[line 117]

Registered layers

API Tags:
Access:  protected


[ Top ]
array   $bkCol [line 110]

Background color for this view

API Tags:
Access:  protected


[ Top ]
array   $bounds [line 87]

The bounds of this view

API Tags:
Access:  protected


[ Top ]
integer   $id = 0 [line 59]

Id of this view

A view with id 0 is the main view. All others are negotiable.

API Tags:
Access:  protected


[ Top ]
array   $layers = array() [line 66]

All of the layers in this view

API Tags:
Access:  protected


[ Top ]
object   $map [line 73]

The map that contains this view

API Tags:
Access:  protected


[ Top ]
array   $scale [line 103]

What is the scale in each direction?

This is SMap Units per one pixel.

API Tags:
Access:  protected


[ Top ]
array   $tiles [line 80]

A cached copy of all of the tiles

API Tags:
Access:  protected


[ Top ]
integer   $zoom [line 94]

The zoom of this view

API Tags:
Access:  protected


[ Top ]
Methods
static method createLayer  [line 269]

  static object The createLayer( string $layer, integer $arg1, [mixed $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null], [ $arg9 = null]  )

Creates a view

Serves as a view factory. The first argument is the name of a view that is registered with, and the rest of the arguments are passed to the view.

Parameters:
string   $layer:  View name
integer   $arg1:  Normally the Layer ID
mixed   $arg2:  Additional arguments...
   $arg3: 
   $arg4: 
   $arg5: 
   $arg6: 
   $arg7: 
   $arg8: 
   $arg9: 

API Tags:
Return:  created view
Access:  public


[ Top ]
Constructor __construct  [line 134]

  SMap_View __construct( SMap $map, integer $viewId, [array $bkCol = null]  )

Give this view an identity

Parameters:
object The   $map:  controlling map
integer   $viewId:  This view's ID
array   $bkCol:  View's background color

API Tags:
Usedby:  SMap::createView()
Access:  public


Redefined in descendants as:

[ Top ]
addLayer  [line 221]

  object The addLayer( mixed $layer, [integer $arg1 = null], [mixed $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null]  )

Adds a layer.

If there are no layers, then this layer becomes the bottom most layer. If there is a layer, then this layer is composited on top of it.

Parameters:
mixed   $layer:  SMap_Layer subclass or layer to create
integer   $arg1:  Normally a Layer ID
mixed   $arg2:  Additional arguments passed to layer constructor
   $arg3: 
   $arg4: 
   $arg5: 
   $arg6: 
   $arg7: 
   $arg8: 

API Tags:
Return:  added layer
Access:  public
See:  SMap_Layer


[ Top ]
getAdjViewBounds  [line 182]

  array getAdjViewBounds( SMap $map, array $tG  )

Adjust the view coords if we are in an image

Uses the current bounds and the tile grid to calculate the view bounds of the original image. Sometimes it's missing data, so it does the best it can.

Parameters:
object The   $map:  map we are in
array   $tG:  The tile grid

API Tags:
Return:  The overall view bounds
Access:  protected


[ Top ]
getName  [line 324]

  string getName( )

Return the name of this view

The name is defined by SMap_Lang, so this method simply uses that value.


API Tags:
Return:  View name
Access:  public


[ Top ]
getTiles  [line 344]

  array getTiles( )

Creates and returns the set of tiles that represent this view

This constructs a set of tiles that fully represent this view. Objects have been added to each tile, and they have been flattened and constrained.


API Tags:
Return:  The tiles in this view
Usedby:  SMap::handleImageMap()
Usedby:  SMap::getViewXHTML()
Access:  public
See:  SMap_View::getXHTML()


[ Top ]
getXHTML  [line 438]

  string getXHTML( array $tiles  )

Handle getting the XHTML

Parameters:
array   $tiles:  The array of tiles

API Tags:
Return:  XHTML of the map
Usedby:  SMap::getViewXHTML()
Access:  public
Abstract:  
See:  SMap_View::getTiles()


Redefined in descendants as:

[ Top ]
sendObj  [line 308]

  void sendObj( SMap_Object $newObj, integer $newX, integer $newY  )

Send an object to another tile

Used to create an object in another tile dynamically. This is intended to only be used by methods in SMap_Object during rendering. The normal method of adding an object to a tile is to include it in the return value of SMap_Layer::getMapObjs() or SMap_Layer::getImgObjs().

Parameters:
object New   $newObj:  object
integer   $newX:  X location of tile in tile grid
integer   $newY:  Y location of tile in tile grid

API Tags:
Usedby:  SMap_Object_Area_Label::copyOver()
Access:  public


[ Top ]
__get  [line 163]

  mixed __get( string $nm  )

Access useful vars read-only

Parameters:
string   $nm:  Name of member

API Tags:
Return:  Value of member
Access:  public


[ Top ]

Documentation generated on Mon, 09 Apr 2007 18:56:33 -0500 by phpDocumentor 1.3.0