Packagecom.esri.ags.layers
Classpublic class OpenStreetMapLayer
InheritanceOpenStreetMapLayer Inheritance TiledMapServiceLayer Inheritance Layer Inheritance mx.core.UIComponent

Since : ArcGIS API for Flex 2.1

Allows you to use basemaps from OpenStreetMap. Set the tileservers property to change which OpenStreetMap tiles you want to use.

See also

http://www.openstreetmap.org/copyright
http://wiki.openstreetmap.org/wiki/Main_Page
Live sample - OpenStreetMap


Public Properties
 PropertyDefined By
 InheriteddisplayLevels : Array
Levels to display in layer, based on LOD.level.
TiledMapServiceLayer
 InheritedfadeInFrameCount : uint
The number of frames it will take for the tiles to fade in.
TiledMapServiceLayer
 InheritedfullExtent : Extent
[read-only] The full extent of the layer.
TiledMapServiceLayer
 InheritedinitialExtent : Extent
[read-only] Initial extent of the layer.
Layer
 InheritedisInScaleRange : Boolean
[read-only] Returns true if the current scale of the map is between the maximum and minimum scale of the layer [added in version 1.3].
Layer
 Inheritedloaded : Boolean
[read-only] When the layer is loaded, the value becomes "true" and layer properties can be accessed.
Layer
 InheritedloadFault : Fault
[read-only] A reference to the fault that is dispatched when the layer throws a loadError event.
Layer
 Inheritedmap : Map
[read-only] A reference to the Map this layer is in.
Layer
 InheritedmaxScale : Number
The maximum scale of the layer [added in version 1.3].
Layer
 InheritedminScale : Number
The minimum scale of the layer [added in version 1.3].
Layer
  spatialReference : SpatialReference
[override] [read-only] Returns a SpatialReference with a wkid value of 102100.
OpenStreetMapLayer
 InheritedtileInfo : TileInfo
[read-only] Contains information about the tiling scheme.
TiledMapServiceLayer
  tileServers : Array
List of URL endpoints to load from.
OpenStreetMapLayer
  units : String
[override] [read-only] Returns Units.METERS
OpenStreetMapLayer
Public Methods
 MethodDefined By
 Inherited
refresh():void
Causes the layer to redraw or reload its content.
Layer
Protected Methods
 MethodDefined By
 Inherited
Adds listeners for ExtentEvent.EXTENT_CHANGE, ZoomEvent.ZOOM_START, ZoomEvent.ZOOM_UPDATE and ZoomEvent.ZOOM_END.
Layer
 Inherited
When an EXTENT_CHANGE event occurs, this calls invalidateLayer();
Layer
 Inherited
getTileURL(level:Number, row:Number, col:Number):URLRequest
Subclasses must override this method to cause tiles to be loaded from their own endpoints.
TiledMapServiceLayer
 Inherited
hideHandler(event:FlexEvent):void
When the layer is hidden (visible is set to false), this calls removeMapListeners().
Layer
 Inherited
Subclasses should call this whenever they would like to have updateLayer() called on them.
Layer
 Inherited
Removes all the layers children.
Layer
 Inherited
Removes the four event listeners added by addMapListeners();
Layer
 Inherited
setLoaded(value:Boolean):void
Subclasses must call this when they've loaded all their properties and are ready to load their content.
Layer
 Inherited
showHandler(event:FlexEvent):void
When the layer is shown (visible is set to true), this calls addMapListeners() and invalidateLayer().
Layer
 Inherited
toScreenX(mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Layer
 Inherited
toScreenY(mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Layer
 Inherited
Subclasses must override this method.
Layer
 Inherited
Finishes the zoom animation.
Layer
 Inherited
Prepares the zoom animation by taking a bitmap of the layer.
Layer
 Inherited
Redraws the bitmap of the layer.
Layer
Events
 Event Summary Defined By
 InheritedFires if the value of isInScaleRange changes.Layer
 InheritedFires after layer properties for the layer are successfully populated.Layer
 InheritedFires if the layer is unable to load.Layer
 InheritedFires when the layer has finished updating its content.Layer
 InheritedFires when the layer begins to update its content.Layer
Property Detail
spatialReferenceproperty
spatialReference:SpatialReference  [read-only] [override]

Returns a SpatialReference with a wkid value of 102100.


Implementation
    public function get spatialReference():SpatialReference
tileServersproperty 
tileServers:Array

List of URL endpoints to load from. Default is "http://a.tile.openstreetmap.org/", "http://b.tile.openstreetmap.org/" and "http://c.tile.openstreetmap.org/".


Implementation
    public function get tileServers():Array
    public function set tileServers(value:Array):void

Example
Using Osmarender tile servers
     <esri:OpenStreetMapLayer>
       <esri:tileServers>
           <fx:String>http://a.tah.openstreetmap.org/Tiles/tile/</fx:String>
           <fx:String>http://b.tah.openstreetmap.org/Tiles/tile/</fx:String>
           <fx:String>http://c.tah.openstreetmap.org/Tiles/tile/</fx:String>
       </esri:tileServers>
     </esri:OpenStreetMapLayer>
unitsproperty 
units:String  [read-only] [override]

Returns Units.METERS


Implementation
    public function get units():String