| Package | org.openscales.core.layer |
| Class | public class Layer |
| Inheritance | Layer flash.display.Sprite |
| Subclasses | Aggregate, HTTPRequest, ImageLayer, SwitchLayers, VectorLayer |
| Property | Defined By | ||
|---|---|---|---|
| aggregate : Aggregate
The aggregate which contains this layer, null most of the time. | Layer | ||
| alpha : Number [override] [write-only]
opacity of the layer (between 0 and 1)
| Layer | ||
| available : Boolean [read-only]
The boolean that say if the layer is available or not (according to map)
This is a readonly parameter. | Layer | ||
| availableProjections : Vector.<String>
Define the layer available projections by its SRS codes. | Layer | ||
| constraints : Vector.<Constraint>
A list of constraints for the layer
| Layer | ||
| DEFAULT_MAXEXTENT : Bounds [static] [read-only] | Layer | ||
| displayed : Boolean [read-only]
Is this layer currently displayed ?
| Layer | ||
| displayInLayerManager : Boolean
Indicates if the layer should be displayed in the LayerManager List or not
| Layer | ||
| dpi : Number
Indicates the dpi used to calculate resolution and scale upon this layer
| Layer | ||
| extent : Bounds [read-only]
A Bounds object which represents the location bounds of the current extent display on the map. | Layer | ||
| inRange : Boolean [read-only]
Is this layer currently in range, based on its min and max resolutions
| Layer | ||
| isFixed : Boolean
Whether or not the layer is a fixed layer. | Layer | ||
| loadComplete : Boolean [read-only]
Whether or not the layer is loading data
| Layer | ||
| map : Map
Return a reference to the map where belong this layer
| Layer | ||
| maxExtent : Bounds
Maximum extent for this layer. | Layer | ||
| maxResolution : Resolution
Maximal valid resolution for this layer
| Layer | ||
| metaData : Object
Allows to add custom metadata about the layer
| Layer | ||
| minResolution : Resolution
Minimal valid resolution for this layer
| Layer | ||
| name : String [override]
The layer Name (appears in LayerManager for example)
| Layer | ||
| numZoomLevels : Number [read-only]
Number of zoom levels (resolutions array length)
| Layer | ||
| originators : Vector.<DataOriginator>
The list of originators for the layer. | Layer | ||
| projection : ProjProjection
The projection of the map. | Layer | ||
| proxy : String
Proxy (usually a PHP, Python, or Java script) used to request remote servers like
WFS servers in order to allow crossdomain requests. | Layer | ||
| resolutions : Array
A list of map resolutions (map units per pixel) in descending
order. | Layer | ||
| security : ISecurity
Security manager associated to this layer
| Layer | ||
| selected : Boolean | Layer | ||
| url : String
The url use for the layer request if necessary. | Layer | ||
| visible : Boolean [override] [write-only]
Define if this layer is visible (displayed) or not
| Layer | ||
| zindex : int
Current layer position in the display list
| Layer | ||
| Property | Defined By | ||
|---|---|---|---|
| _autoResolution : Boolean = true | Layer | ||
| _centerChanged : Boolean = false | Layer | ||
| loading : Boolean [write-only]
Used to set loading status of layer
| Layer | ||
| _mapReload : Boolean = false | Layer | ||
| _projection : ProjProjection = null | Layer | ||
| _projectionChanged : Boolean = false | Layer | ||
| _resolutionChanged : Boolean = false | Layer | ||
| Method | Defined By | ||
|---|---|---|---|
Layer(name:String)
Layer constructor
| Layer | ||
addOriginator(originator:DataOriginator):void
Add a new originator for the layer
| Layer | ||
clear():void
Clear the layer graphics
| Layer | ||
destroy():void
Detroy the map, including removing all event listeners
| Layer | ||
generateResolutions(numZoomLevels:uint, nominalResolution:Number):void
Generate resolutions array for a nominal resolution (higher one) and a number of zoom levels. | Layer | ||
getLayerPxFromMapPx(mapPx:Pixel):Pixel | Layer | ||
getLocationFromMapPx(viewPortPx:Pixel):Location
Return a LonLat which is the passed-in map Pixel, translated into
lon/lat by the layer. | Layer | ||
getMapPxFromLayerPx(layerPx:Pixel):Pixel | Layer | ||
getMapPxFromLocation(lonlat:Location):Pixel
Return a Pixel which is the passed-in LonLat,translated into map pixels. | Layer | ||
getURL(bounds:Bounds):String
Return layer URL
| Layer | ||
hasMultiBBoxes():Boolean
Tells whether this layer defines multiple bounding boxes
| Layer | ||
isAvailableForBounds(bounds:Bounds, resolution:Resolution):Boolean
This method tells if the layer is available for the specified bounds and resolution
| Layer | ||
redraw(fullRedraw:Boolean = false):void
Check if the layer can be drawn according to the map parameters. | Layer | ||
removeEventListenerFromMap():void
Remove map related event listeners
| Layer | ||
reset():void
Reset layer data
| Layer | ||
supportsProjection(compareProj:*):Boolean
This method tells if the layer supports a projection given in parameter according to the availableProjections
set for this layer. | Layer | ||
| Method | Defined By | ||
|---|---|---|---|
draw():void
Reset layer data
| Layer | ||
onEnterFrame(event:Event):void
Bind the redraw of the layers on the flash onEnterFrame
| Layer | ||
onMapCenterChanged(event:MapEvent):void
This function is call when the MapEvent.CENTER_CHANGED
Call the redraw function to check if the layer can be displayed
Override this method if you want a specific behaviour in your layer
when the center is changed
| Layer | ||
| Layer | |||
onMapProjectionChanged(event:MapEvent):void
This function is call when the MapEvent.PROJECTION_CHANGED
Override this method if you want a specific behaviour in your layer
when the projection of the map is changed
| Layer | ||
onMapReload(event:MapEvent):void
This function is call when the MapEvent.RELOAD
Override this method if you want a specific behaviour in your layer
when the map ask for a reload. | Layer | ||
onMapResize(e:MapEvent):void
This function is call when the MapEvent.RESIZE
Call the redraw method to fully actualize the layer
Override this method if you want a specific behaviour in your layer
when the size of the map is changed
| Layer | ||
onMapResolutionChanged(event:MapEvent):void
This function is call when the MapEvent.RESOLUTION_CHANGED
Override this method if you want a specific behaviour in your layer
when the resolution of the map is changed
| Layer | ||
onMaxExtentChanged(e:MapEvent):void
This function is call when the MapEvent.MAX_EXTENT_CHANGED
Call the redraw method to fully actualize the layer
Override this method if you want a specific behaviour in your layer
when the MaxExtent of the map is changed
| Layer | ||
onSecurityInitialized(e:SecurityEvent):void | Layer | ||
| Constant | Defined By | ||
|---|---|---|---|
| DEFAULT_DPI : Number = 92 [static] | Layer | ||
| DEFAULT_NOMINAL_RESOLUTION : Resolution [static] | Layer | ||
| DEFAULT_NUM_ZOOM_LEVELS : uint = 18 [static] | Layer | ||
| DEFAULT_PROJECTION : ProjProjection [static] | Layer | ||
| RESOLUTION_TOLERANCE : Number = 0.000001 [static] | Layer | ||
| _autoResolution | property |
protected var _autoResolution:Boolean = true| _centerChanged | property |
protected var _centerChanged:Boolean = false| _mapReload | property |
protected var _mapReload:Boolean = false| _projection | property |
protected var _projection:ProjProjection = null| _projectionChanged | property |
protected var _projectionChanged:Boolean = false| _resolutionChanged | property |
protected var _resolutionChanged:Boolean = false| aggregate | property |
aggregate:AggregateThe aggregate which contains this layer, null most of the time.
public function get aggregate():Aggregate public function set aggregate(value:Aggregate):void| alpha | property |
alpha:Number [write-only] [override] opacity of the layer (between 0 and 1)
public function set alpha(value:Number):void| available | property |
available:Boolean [read-only] The boolean that say if the layer is available or not (according to map) This is a readonly parameter. Override this method and check what you need to check and return if your layer is available or not.
public function get available():Boolean| availableProjections | property |
availableProjections:Vector.<String>Define the layer available projections by its SRS codes.
public function get availableProjections():Vector.<String> public function set availableProjections(value:Vector.<String>):void| constraints | property |
constraints:Vector.<Constraint>A list of constraints for the layer
public function get constraints():Vector.<Constraint> public function set constraints(value:Vector.<Constraint>):void| DEFAULT_MAXEXTENT | property |
DEFAULT_MAXEXTENT:Bounds [read-only] public static function get DEFAULT_MAXEXTENT():Bounds| displayed | property |
displayed:Boolean [read-only] Is this layer currently displayed ?
public function get displayed():Boolean| displayInLayerManager | property |
displayInLayerManager:BooleanIndicates if the layer should be displayed in the LayerManager List or not
The default value is true.
public function get displayInLayerManager():Boolean public function set displayInLayerManager(value:Boolean):void| dpi | property |
dpi:NumberIndicates the dpi used to calculate resolution and scale upon this layer
public function get dpi():Number public function set dpi(value:Number):void| extent | property |
extent:Bounds [read-only] A Bounds object which represents the location bounds of the current extent display on the map.
public function get extent():Bounds| inRange | property |
inRange:Boolean [read-only] Is this layer currently in range, based on its min and max resolutions
public function get inRange():Boolean| isFixed | property |
isFixed:BooleanWhether or not the layer is a fixed layer. Fixed layers cannot be controlled by users
public function get isFixed():Boolean public function set isFixed(value:Boolean):void| loadComplete | property |
loadComplete:Boolean [read-only] Whether or not the layer is loading data
public function get loadComplete():Boolean| loading | property |
loading:Boolean [write-only] Used to set loading status of layer
protected function set loading(value:Boolean):void| map | property |
map:MapReturn a reference to the map where belong this layer
public function get map():Map public function set map(value:Map):void| maxExtent | property |
maxExtent:BoundsMaximum extent for this layer. No data outside the extent will be displayed
public function get maxExtent():Bounds public function set maxExtent(value:Bounds):void| maxResolution | property |
maxResolution:ResolutionMaximal valid resolution for this layer
public function get maxResolution():Resolution public function set maxResolution(value:Resolution):void| metaData | property |
metaData:ObjectAllows to add custom metadata about the layer
public function get metaData():Object public function set metaData(value:Object):void| minResolution | property |
minResolution:ResolutionMinimal valid resolution for this layer
public function get minResolution():Resolution public function set minResolution(value:Resolution):void| name | property |
name:String[override] The layer Name (appears in LayerManager for example)
This property can be used as the source for data binding.
public function get name():String public function set name(value:String):void| numZoomLevels | property |
numZoomLevels:Number [read-only] Number of zoom levels (resolutions array length)
public function get numZoomLevels():Number| originators | property |
originators:Vector.<DataOriginator>The list of originators for the layer.
public function get originators():Vector.<DataOriginator> public function set originators(value:Vector.<DataOriginator>):void| projection | property |
projection:ProjProjectionThe projection of the map. This is the display projection of the map If a layer is not in the same projection as the projection of the map he will not be displayed.
The default value is Geometry.DEFAULT_SRS_CODE.
public function get projection():ProjProjection public function set projection(value:ProjProjection):void| proxy | property |
proxy:StringProxy (usually a PHP, Python, or Java script) used to request remote servers like WFS servers in order to allow crossdomain requests. Remote servers can be used without proxy script by using crossdomain.xml file like http://openscales.org/crossdomain.xml There is 3 cases : - proxy is explicitly defined - proxy is explicitly defined to "" => no proxy will be used - proxy is null => use the proxy of the map
public function get proxy():String public function set proxy(value:String):void| resolutions | property |
resolutions:ArrayA list of map resolutions (map units per pixel) in descending order. If this is not set in the layer constructor, it will be set based on other resolution related properties (maxExtent, maxResolution, etc.).
public function get resolutions():Array public function set resolutions(value:Array):void| security | property |
security:ISecuritySecurity manager associated to this layer
public function get security():ISecurity public function set security(value:ISecurity):void| selected | property |
selected:Boolean public function get selected():Boolean public function set selected(value:Boolean):void| url | property |
url:StringThe url use for the layer request if necessary.
public function get url():String public function set url(value:String):void| visible | property |
visible:Boolean [write-only] [override] Define if this layer is visible (displayed) or not
public function set visible(value:Boolean):void| zindex | property |
zindex:intCurrent layer position in the display list
public function get zindex():int public function set zindex(value:int):void| Layer | () | Constructor |
public function Layer(name:String)Layer constructor
Parametersname:String |
| addOriginator | () | method |
public function addOriginator(originator:DataOriginator):voidAdd a new originator for the layer
Parameters
originator:DataOriginator — Informations of this new originator (with or without constraints)
If no constraint is defined, one default constraint is made with the current extent, minResolution and maxResolution of the layer
|
| clear | () | method |
public function clear():voidClear the layer graphics
| destroy | () | method |
public function destroy():voidDetroy the map, including removing all event listeners
| draw | () | method |
protected function draw():voidReset layer data
| generateResolutions | () | method |
public function generateResolutions(numZoomLevels:uint, nominalResolution:Number):voidGenerate resolutions array for a nominal resolution (higher one) and a number of zoom levels. The array is generated with the following principle : resolutions[i] = resolutions[i-1] / 2
Parameters
numZoomLevels:uint (default = NaN) | |
nominalResolution:Number (default = NaN) |
| getLayerPxFromMapPx | () | method |
public function getLayerPxFromMapPx(mapPx:Pixel):PixelParameters
mapPx:Pixel |
Pixel |
| getLocationFromMapPx | () | method |
public function getLocationFromMapPx(viewPortPx:Pixel):LocationReturn a LonLat which is the passed-in map Pixel, translated into lon/lat by the layer.
Parameters
viewPortPx:Pixel |
Location |
| getMapPxFromLayerPx | () | method |
public function getMapPxFromLayerPx(layerPx:Pixel):PixelParameters
layerPx:Pixel |
Pixel |
| getMapPxFromLocation | () | method |
public function getMapPxFromLocation(lonlat:Location):PixelReturn a Pixel which is the passed-in LonLat,translated into map pixels.
Parameters
lonlat:Location |
Pixel |
| getURL | () | method |
public function getURL(bounds:Bounds):StringReturn layer URL
Parameters
bounds:Bounds |
String |
| hasMultiBBoxes | () | method |
public function hasMultiBBoxes():BooleanTells whether this layer defines multiple bounding boxes
ReturnsBoolean — Boolean True if the layer has multiple bboxes, false otherwise
|
| isAvailableForBounds | () | method |
public function isAvailableForBounds(bounds:Bounds, resolution:Resolution):BooleanThis method tells if the layer is available for the specified bounds and resolution
Parameters
bounds:Bounds — Bounds to intersect the layers bboxes with
| |
resolution:Resolution — Resolution to intersect the layer max et min extent with
|
Boolean |
| onEnterFrame | () | method |
protected function onEnterFrame(event:Event):voidBind the redraw of the layers on the flash onEnterFrame
Parameters
event:Event |
| onMapCenterChanged | () | method |
protected function onMapCenterChanged(event:MapEvent):voidThis function is call when the MapEvent.CENTER_CHANGED Call the redraw function to check if the layer can be displayed Override this method if you want a specific behaviour in your layer when the center is changed
Parameters
event:MapEvent |
| onMapMove | () | method |
| onMapProjectionChanged | () | method |
protected function onMapProjectionChanged(event:MapEvent):voidThis function is call when the MapEvent.PROJECTION_CHANGED Override this method if you want a specific behaviour in your layer when the projection of the map is changed
Parameters
event:MapEvent |
| onMapReload | () | method |
protected function onMapReload(event:MapEvent):voidThis function is call when the MapEvent.RELOAD Override this method if you want a specific behaviour in your layer when the map ask for a reload.
Parameters
event:MapEvent |
| onMapResize | () | method |
protected function onMapResize(e:MapEvent):voidThis function is call when the MapEvent.RESIZE Call the redraw method to fully actualize the layer Override this method if you want a specific behaviour in your layer when the size of the map is changed
Parameters
e:MapEvent |
| onMapResolutionChanged | () | method |
protected function onMapResolutionChanged(event:MapEvent):voidThis function is call when the MapEvent.RESOLUTION_CHANGED Override this method if you want a specific behaviour in your layer when the resolution of the map is changed
Parameters
event:MapEvent |
| onMaxExtentChanged | () | method |
protected function onMaxExtentChanged(e:MapEvent):voidThis function is call when the MapEvent.MAX_EXTENT_CHANGED Call the redraw method to fully actualize the layer Override this method if you want a specific behaviour in your layer when the MaxExtent of the map is changed
Parameters
e:MapEvent |
| onSecurityInitialized | () | method |
| redraw | () | method |
public function redraw(fullRedraw:Boolean = false):voidCheck if the layer can be drawn according to the map parameters. If the layer can be drawn it will draw itself. It will set the available parameter to expose if the layer is drawn or not.
Parameters
fullRedraw:Boolean (default = false) |
| removeEventListenerFromMap | () | method |
public function removeEventListenerFromMap():voidRemove map related event listeners
| reset | () | method |
public function reset():voidReset layer data
| supportsProjection | () | method |
public function supportsProjection(compareProj:*):BooleanThis method tells if the layer supports a projection given in parameter according to the availableProjections set for this layer.
Parameters
compareProj:* |
Boolean |
| DEFAULT_DPI | Constant |
public static const DEFAULT_DPI:Number = 92| DEFAULT_NOMINAL_RESOLUTION | Constant |
public static const DEFAULT_NOMINAL_RESOLUTION:Resolution| DEFAULT_NUM_ZOOM_LEVELS | Constant |
public static const DEFAULT_NUM_ZOOM_LEVELS:uint = 18| DEFAULT_PROJECTION | Constant |
public static const DEFAULT_PROJECTION:ProjProjection| RESOLUTION_TOLERANCE | Constant |
public static const RESOLUTION_TOLERANCE:Number = 0.000001