Packagecom.afcomponents.umap.providers
Classpublic class MapType
ImplementsIMapType
SubclassesArcGISMapType

MapType class provides the default implemetation of the IMapType interface.

You can use it to define custom map types. Each map type should contain one or more ITileLayer objects. Use TileLayer class for the default implemetation of this interface.

See also

com.afcomponents.umap.providers.TileLayer
com.afcomponents.umap.providers.DefaultProvider


Public Properties
 PropertyDefined by
  caption : String
Gets or sets map types caption that will be used in the MapTypeControl.
MapType
  copyrightMessage : String
Gets or sets the copyright message prefix.
MapType
  errorMessage : String
Gets or sets the error message that will be displayed if tile data is unavailable.
MapType
  layerCount : uint
[read-only] Returns the number of ITileLayer objects registered with the map type.
MapType
  layers : Array
[read-only] Returns an Array which holds ITileLayer objects registered with the map type.
MapType
  linkColor : uint
Gets or sets the text color of the temrs of use link.
MapType
  maxZoom : uint
Returns maximum zoom level for the map type.
MapType
  minZoom : uint
Returns minimum zoom level for the map type.
MapType
  name : String
Returns the name of the map type.
MapType
  projection : IProjection
Gets or sets the IProjection that should be used with this map type.
MapType
  serverCount : uint
[read-only] Indicates the tile size in pixels.
MapType
  textColor : uint
Gets or sets the text color of the copyright message.
MapType
Public Methods
 MethodDefined by
  
MapType(name:String, textColor:uint = 0x000000, linkColor:uint = 0x7777CC, caption:String = null, errorMessage:String = "", copyrightMessage:String = "")
Creates new MapType object.
MapType
  
addLayer(layer:ITileLayer):void
Adds new ITileLayer object to the tile layer collection.
MapType
  
dispose():void
Releases all the resources accuired by the object.
MapType
  
getCopyrights(bounds:LatLngBounds, zoom:Number):String
Returns an String with the copyright message for the specified view bounds and zoom level.
MapType
  
toString():String
Returns a textual representation of the object.
MapType
Property detail
captionproperty
caption:String  [read-write]

Gets or sets map types caption that will be used in the MapTypeControl.

Implementation
    public function get caption():String
    public function set caption(value:String):void
copyrightMessageproperty 
copyrightMessage:String  [read-write]

Gets or sets the copyright message prefix.

Implementation
    public function get copyrightMessage():String
    public function set copyrightMessage(value:String):void
errorMessageproperty 
errorMessage:String  [read-write]

Gets or sets the error message that will be displayed if tile data is unavailable.

Implementation
    public function get errorMessage():String
    public function set errorMessage(value:String):void
layerCountproperty 
layerCount:uint  [read-only]

Returns the number of ITileLayer objects registered with the map type.

Implementation
    public function get layerCount():uint
layersproperty 
layers:Array  [read-only]

Returns an Array which holds ITileLayer objects registered with the map type.

Implementation
    public function get layers():Array
linkColorproperty 
linkColor:uint  [read-write]

Gets or sets the text color of the temrs of use link.

Implementation
    public function get linkColor():uint
    public function set linkColor(value:uint):void
maxZoomproperty 
maxZoom:uint  [read-write]

Returns maximum zoom level for the map type.

Implementation
    public function get maxZoom():uint
    public function set maxZoom(value:uint):void
minZoomproperty 
minZoom:uint  [read-write]

Returns minimum zoom level for the map type.

Implementation
    public function get minZoom():uint
    public function set minZoom(value:uint):void
nameproperty 
name:String  [read-write]

Returns the name of the map type.

Implementation
    public function get name():String
    public function set name(value:String):void
projectionproperty 
projection:IProjection  [read-write]

Gets or sets the IProjection that should be used with this map type. By default the MercatorProjection is used.

Implementation
    public function get projection():IProjection
    public function set projection(value:IProjection):void
serverCountproperty 
serverCount:uint  [read-only]

Indicates the tile size in pixels. Default 256.

Implementation
    public function get serverCount():uint
textColorproperty 
textColor:uint  [read-write]

Gets or sets the text color of the copyright message.

Implementation
    public function get textColor():uint
    public function set textColor(value:uint):void
Constructor detail
MapType()constructor
public function MapType(name:String, textColor:uint = 0x000000, linkColor:uint = 0x7777CC, caption:String = null, errorMessage:String = "", copyrightMessage:String = "")

Creates new MapType object.

Specify name of the map type and additional parameters. Don't forget to add at least one ITileLayer object that will be used to display the map data.

Parameters
name:String — Map type's name
 
textColor:uint (default = 0x000000) — Color of the copyright text.
 
linkColor:uint (default = 0x7777CC) — Color of the terms of use link.
 
caption:String (default = null) — Map type's caption that will be displayed in the MapTypeControl's button. If ommited, equals map type's name.
 
errorMessage:String (default = "")
 
copyrightMessage:String (default = "")

See also

Method detail
addLayer()method
public function addLayer(layer:ITileLayer):void

Adds new ITileLayer object to the tile layer collection. Please note that after adding new tile layer, minimum, maximum zoom levels, and server counter will be updated.

Parameters
layer:ITileLayer — Valid ITileLayer object.
dispose()method 
public function dispose():void

Releases all the resources accuired by the object.

getCopyrights()method 
public function getCopyrights(bounds:LatLngBounds, zoom:Number):String

Returns an String with the copyright message for the specified view bounds and zoom level.

Parameters
bounds:LatLngBounds
 
zoom:Number

Returns
String
toString()method 
public function toString():String

Returns a textual representation of the object. Template: (property name=value, property name=value, ...)

Returns
String