Packageorg.omoa
Classpublic class Map
InheritanceMap Inheritance flash.display.Sprite

This class is the main dispatcher object of an omoa map.



Public Properties
 PropertyDefined By
  height : Number
[override]
Map
  mapframeMargin : int = 10
Map
  synchronizeMapFrames : Boolean = false
Map
  width : Number
[override]
Map
Protected Properties
 PropertyDefined By
  dataModels : Vector.<IDataModel>
Map
  layers : Vector.<ILayer>
Map
  mapFrames : Vector.<MapFrame>
Map
  spaceModels : Vector.<ISpaceModel>
Map
Public Methods
 MethodDefined By
  
Map()
Map
  
addDataModel(dataModel:IDataModel):void
Map
  
addLayer(layer:ILayer):void
Adds a new layer to the layer pool and stores its the space model.
Map
  
addMapFrame(mapFrame:MapFrame, name:String = null):void
Adds a MapFrame to the mapframe pool and, if it is has no parent display object, adds it as child to the display list.
Map
  
addSpaceModel(spaceModel:ISpaceModel):void
Adds a SpaceModel to the SpaceModel pool of the map and links it to existing DataModels.
Map
  
Returns the number of layers in the layer pool.
Map
  
Returns the number of mapframes.
Map
  
createDataModel(name:String, url:String, parameters:Object, loaderClassName:String = Text):IDataModel
Map
  
createLayer(name:String, spaceModel:ISpaceModel = null, layerClassName:String = SymbolLayer):ILayer
Creates a new layer of the given class and adds it to the internal layer pool.
Map
  
Creates a new MapFrame as a child sprite of the map sprite and adds it to the internal list on mapframes.
Map
  
createSpaceModel(name:String, url:String, parameters:Object = null, loaderClassName:String = Shapefile):ISpaceModel
Creates a SpaceModel and adds it to the map.
Map
  
datamodel(name:String):IDataModel
Map
  
getLayer(index:uint):ILayer
Returns a layer by index.
Map
  
getMapFrame(index:uint):MapFrame
Returns a mapframe by index.
Map
  
layer(name:String):ILayer
Returns a layer from the layer pool.
Map
  
Layout all MapFrames (that are child sprites of the map) horizontaly with equal width.
Map
  
mapframe(name:String):MapFrame
Returns a mapframe by name.
Map
  
resize(width:Number, height:Number):void
Resizes the map object and calls layoutMapFrames().
Map
  
spacemodel(name:String):ISpaceModel
Returns an ISpaceModel instance from the model pool.
Map
  
Map
Property Detail
dataModelsproperty
protected var dataModels:Vector.<IDataModel>

heightproperty 
height:Number[override]


Implementation
    public function get height():Number
    public function set height(value:Number):void
layersproperty 
protected var layers:Vector.<ILayer>

mapframeMarginproperty 
public var mapframeMargin:int = 10

mapFramesproperty 
protected var mapFrames:Vector.<MapFrame>

spaceModelsproperty 
protected var spaceModels:Vector.<ISpaceModel>

synchronizeMapFramesproperty 
public var synchronizeMapFrames:Boolean = false

widthproperty 
width:Number[override]


Implementation
    public function get width():Number
    public function set width(value:Number):void
Constructor Detail
Map()Constructor
public function Map()



Method Detail
addDataModel()method
public function addDataModel(dataModel:IDataModel):void

Parameters

dataModel:IDataModel

addLayer()method 
public function addLayer(layer:ILayer):void

Adds a new layer to the layer pool and stores its the space model. Remember: For layers to be displayed you need to add them to a MapFrame.

Parameters

layer:ILayer

addMapFrame()method 
public function addMapFrame(mapFrame:MapFrame, name:String = null):void

Adds a MapFrame to the mapframe pool and, if it is has no parent display object, adds it as child to the display list. The layers of the MapFrame are added to the layer pool of the map.

Parameters

mapFrame:MapFrame — The map frame.
 
name:String (default = null) — An identifier (unique among the MapFrames).

addSpaceModel()method 
public function addSpaceModel(spaceModel:ISpaceModel):void

Adds a SpaceModel to the SpaceModel pool of the map and links it to existing DataModels. SpaceModels and DataModels in the model pool are linked against each other using matching SpaceModel-Ids and Classification-Id (must be the first dimension of the DataModel).

Parameters

spaceModel:ISpaceModel — The SpaceModel to be added.

See also

countLayers()method 
public function countLayers():uint

Returns the number of layers in the layer pool.

Returns
uint
countMapFrames()method 
public function countMapFrames():uint

Returns the number of mapframes.

Returns
uint
createDataModel()method 
public function createDataModel(name:String, url:String, parameters:Object, loaderClassName:String = Text):IDataModel

Parameters

name:String
 
url:String
 
parameters:Object
 
loaderClassName:String (default = Text)

Returns
IDataModel
createLayer()method 
public function createLayer(name:String, spaceModel:ISpaceModel = null, layerClassName:String = SymbolLayer):ILayer

Creates a new layer of the given class and adds it to the internal layer pool. Remember: For layers to be displayed you need to add them to a MapFrame.

Parameters

name:String — An unique layer identifier.
 
spaceModel:ISpaceModel (default = null) — An ISpaceModel instance (or the ID-String of one).
 
layerClassName:String (default = SymbolLayer) — The Classname of the layer. If the layer is not from the omoa namespace you need to include the full package name.

Returns
ILayer — The layer created. You don't need to necessarily need to store it. You can fetch it any time by calling map.layer("layer name").
createMapFrame()method 
public function createMapFrame(name:String):MapFrame

Creates a new MapFrame as a child sprite of the map sprite and adds it to the internal list on mapframes.

Parameters

name:String — The name of the mapframe.

Returns
MapFrame — The MapFrame.
createSpaceModel()method 
public function createSpaceModel(name:String, url:String, parameters:Object = null, loaderClassName:String = Shapefile):ISpaceModel

Creates a SpaceModel and adds it to the map.

Parameters

name:String — A name that is unique among the SpaceModels of the map.
 
url:String — An Url that is passed to the loader.
 
parameters:Object (default = null) — The parameters for the loader.
 
loaderClassName:String (default = Shapefile) — The class name of the loader: "Shapefile", "RasterSpaceModel" or "AsmaSpaceXml"

Returns
ISpaceModel — Returns the ISpaceModel(Loader)
datamodel()method 
public function datamodel(name:String):IDataModel

Parameters

name:String

Returns
IDataModel
getLayer()method 
public function getLayer(index:uint):ILayer

Returns a layer by index.

Parameters

index:uint — The index of the layer in the layer pool.

Returns
ILayer — The layer.
getMapFrame()method 
public function getMapFrame(index:uint):MapFrame

Returns a mapframe by index.

Parameters

index:uint

Returns
MapFrame
layer()method 
public function layer(name:String):ILayer

Returns a layer from the layer pool.

Parameters

name:String — The name of the layer.

Returns
ILayer — The layer instance.
layoutMapFrames()method 
public function layoutMapFrames():void

Layout all MapFrames (that are child sprites of the map) horizontaly with equal width. This layout is a fixed behaviour at the moment. If you want your own layout you either subclass Map or you add the MapFrame to another DisplayObjectContainer and do the layout for yourself.

mapframe()method 
public function mapframe(name:String):MapFrame

Returns a mapframe by name.

Parameters

name:String — The name of the mapframe.

Returns
MapFrame — The MapFrame.
resize()method 
public function resize(width:Number, height:Number):void

Resizes the map object and calls layoutMapFrames().

Parameters

width:Number — Width of the whole map, including mapframeMargin
 
height:Number

spacemodel()method 
public function spacemodel(name:String):ISpaceModel

Returns an ISpaceModel instance from the model pool.

Parameters

name:String — The name of the ISpaceModel.

Returns
ISpaceModel
updateDebug()method 
public function updateDebug():void