| Package | com.esri.aws.awx.map |
| Class | public class Map |
| Inheritance | Map mx.containers.Canvas |
| Implements | com.esri.aws.osgi.framework.IBundleActivator, IMap |
Map is the main mapping component of the ArcWeb Explorer v4 API.
The Map is composed of layers, which can either be overlays, such as markers or lines and basemap layers.
Basemap layers can be placed in the basemaps property, then accessed by setting the mapType property.
By default, the Map comes with six default basemaps (street, satellite, hybrid, tiled streets, topographic and shaded relief) and three default overlay layers (markers, polygons and polylines).
These defaults can be overridden by setting the createDefaultLayers to false or by setting the basemaps with your own basemaps.
User interaction with the map can be customized using the keyboardHandler and mouseHandler properties.
Default MXML Propertylayers
See also
| Property | Defined by | ||
|---|---|---|---|
| basemaps : IGroupLayer
The basemaps property can be used to define a collection of basemaps that can be easily manipulated by the mapType property.
| Map | ||
| center : GeoPoint
The geographic center of the map.
| Map | ||
| centerGeoX : Number
The map center longitude.
| Map | ||
| centerGeoY : Number
The map center latitude.
| Map | ||
| createDefaultLayers : Boolean
If true, default basemaps and overlay layers will be created at startup.
| Map | ||
| editable : Boolean [read-only]
If true, the group layer is editable so all of the manipulation methods with throw an error.
| Map | ||
| extent : Extent
The bounding box (minX, minY, maxX, maxY) of the current map.
| Map | ||
| keyboardHandler : IKeyboardHandler
The keyboard handler that should handle all keyboard interactions with the map.
| Map | ||
| layers : Array
The array of layers.
| Map | ||
| map : IMap
[read-only]
The reference to the parent map container.
| Map | ||
| mapHeight : Number
The map height in pixels.
| Map | ||
| mapRotation : Number
The rotation of the map.
| Map | ||
| mapType : String The default valid values in MXML (assuming you haven't redefined the basemaps) are In ActionScript, you use the following constants to set this property:
| Map | ||
| mapWidth : Number
The map width in pixels.
| Map | ||
| markerLayer : OverlayLayer
[read-only]
The marker layer.
| Map | ||
| maxScale : Number
The maximum allowed scale.
| Map | ||
| minScale : Number
The minimum allowed scale.
| Map | ||
| mouseHandler : IMouseHandler
The mouse handler that should handle all mouse interactions with the map.
| Map | ||
| numLayers : int [read-only]
The number of layers.
| Map | ||
| polygonLayer : OverlayLayer
[read-only]
The polygon layer.
| Map | ||
| polylineLayer : OverlayLayer
[read-only]
The polyline layer.
| Map | ||
| projectionID : int
The current projectionID of the map.
| Map | ||
| rotatedHeight : Number
The rotated map height in pixels.
| Map | ||
| rotatedWidth : Number
The rotated map width in pixels.
| Map | ||
| scale : Number
The current scale of the map.
| Map | ||
| showCrosshair : Boolean
If true, shows the crosshair at the center of the map.
| Map | ||
| showLogo : Boolean
If true, shows the ESRI logo at the corner of the map.
| Map | ||
| showScaleBar : Boolean
If true, shows the scale bar at the corner of the map.
| Map | ||
| staticLayer : IStaticLayer
[read-only]
The main Static Layer (an IStaticLayer) onto which Static objects can be placed.
| Map | ||
| supportedProjections : Array [write-only]
The array of supported projections for the groupLayer(s) in this map.
| Map | ||
| Method | Defined by | ||
|---|---|---|---|
|
Map()
Creates a new Map.
| Map | ||
|
Adds a layer to the group layer.
| Map | ||
|
convertExtentToScale(extent:Extent):Number
Returns a scale to ensure that an entire extent is visible.
| Map | ||
|
convertGeoPointToPoint(geoPoint:GeoPoint):Point
Converts decimal degree values to pixel.
| Map | ||
|
Converts pixel values to decimal degrees.
| Map | ||
|
Gets a layer based on its identifier.
| Map | ||
|
Moves the first layer above the the second layer in the z-order.
| Map | ||
|
Moves the first layer below the the second layer in the z-order.
| Map | ||
|
moveLayerToBottom(layerID:String):void
Moves the layer to the bottom of the z-order.
| Map | ||
|
moveLayerToTop(layerID:String):void
Moves the layer to the top of the z-order.
| Map | ||
|
removeAllLayers():void
Removes all layers.
| Map | ||
|
removeLayer(layerID:String):void
Removes a layer.
| Map | ||
|
showWorld():void
Adjusts the map extent to show the whole world.
| Map | ||
|
Swaps the z-order of two layers.
| Map | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Dispatched after a child has been added to a container. | Map | |||
| Dispatched before a child of a container is removed. | Map | |||
A layer has been moved within a GroupLayer. | Map | |||
| Used to detect when the map model has been changed. | Map | |||
| Used to detect when the mapType has been changed. | Map | |||
| The map is starting to pan. | Map | |||
| The map is finished panning. | Map | |||
| Constant | Defined by | ||
|---|---|---|---|
| AERIAL : String = "aerial" [static]
Satellite map type.
| Map | ||
| HYBRID : String = "hybrid" [static]
Hybrid map type.
| Map | ||
| NONE : String = "none" [static]
No map type.
| Map | ||
| SHADED_RELIEF : String = "shadedRelief" [static]
Satellite map type.
| Map | ||
| STREETS : String = "streets" [static]
Street map type.
| Map | ||
| STREET_TILES : String = "streetTiles" [static]
StreetTiles map type.
| Map | ||
| TOPOGRAPHIC : String = "topographic" [static]
Topographic map type.
| Map | ||
| basemaps | property |
basemaps:IGroupLayer [read-write]The basemaps property can be used to define a collection of basemaps that can be easily manipulated by the mapType property.
Note that basemaps implements IGroupLayer so all of its properties and methods are available to basemaps (even though intellisense might not list them).
Implementation public function get basemaps():IGroupLayer
public function set basemaps(value:IGroupLayer):void
See also
| center | property |
public var center:GeoPointThe geographic center of the map.
This property can be used as the source for data binding.
| centerGeoX | property |
public var centerGeoX:NumberThe map center longitude.
The default value is 0.0.
This property can be used as the source for data binding.
| centerGeoY | property |
public var centerGeoY:NumberThe map center latitude.
The default value is 0.0.
This property can be used as the source for data binding.
| createDefaultLayers | property |
createDefaultLayers:Boolean [read-write]If true, default basemaps and overlay layers will be created at startup. If basemaps is defined, only the default overlay layers will be created. The default overlay layers are one polygon layer, one polyline layer, and one marker layer.
The default value is true.
public function get createDefaultLayers():Boolean
public function set createDefaultLayers(value:Boolean):void
| editable | property |
editable:Boolean [read-only]If true, the group layer is editable so all of the manipulation methods with throw an error.
The default value is true.
public function get editable():Boolean
| extent | property |
public var extent:ExtentThe bounding box (minX, minY, maxX, maxY) of the current map.
This property can be used as the source for data binding.
| keyboardHandler | property |
keyboardHandler:IKeyboardHandler [read-write]The keyboard handler that should handle all keyboard interactions with the map.
Implementation public function get keyboardHandler():IKeyboardHandler
public function set keyboardHandler(value:IKeyboardHandler):void
| layers | property |
layers:Array [read-write]The array of layers.
Implementation public function get layers():Array
public function set layers(value:Array):void
| map | property |
map:IMap [read-only]The reference to the parent map container.
Implementation public function get map():IMap
| mapHeight | property |
mapHeight:Number [read-write]The map height in pixels.
Implementation public function get mapHeight():Number
public function set mapHeight(value:Number):void
| mapRotation | property |
public var mapRotation:NumberThe rotation of the map.
The default value is 0.0.
This property can be used as the source for data binding.
| mapType | property |
public var mapType:String
The default valid values in MXML (assuming you haven't redefined the basemaps) are streets, aerial, hybrid, streetTiles, shadedRelief, topographic, none.
In ActionScript, you use the following constants to set this property:
Map.STREETS, Map.AERIAL, Map.HYBRID, Map.STREET_TILES, Map.SHADED_RELIEF, Map.TOPOGRAPHIC, Map.NONE
The name of the map type.
This property can be used as the source for data binding.
| mapWidth | property |
mapWidth:Number [read-write]The map width in pixels.
Implementation public function get mapWidth():Number
public function set mapWidth(value:Number):void
| markerLayer | property |
markerLayer:OverlayLayer [read-only]The marker layer.
Implementation public function get markerLayer():OverlayLayer
| maxScale | property |
maxScale:Number [read-write]The maximum allowed scale. Only used if greater than 1.0.
The default value is 0.0.
public function get maxScale():Number
public function set maxScale(value:Number):void
| minScale | property |
minScale:Number [read-write]The minimum allowed scale. Can not be lower than 1.0.
The default value is 1.0.
public function get minScale():Number
public function set minScale(value:Number):void
| mouseHandler | property |
mouseHandler:IMouseHandler [read-write]The mouse handler that should handle all mouse interactions with the map.
Implementation public function get mouseHandler():IMouseHandler
public function set mouseHandler(value:IMouseHandler):void
| numLayers | property |
numLayers:int [read-only]The number of layers.
Implementation public function get numLayers():int
| polygonLayer | property |
polygonLayer:OverlayLayer [read-only]The polygon layer.
Implementation public function get polygonLayer():OverlayLayer
| polylineLayer | property |
polylineLayer:OverlayLayer [read-only]The polyline layer.
Implementation public function get polylineLayer():OverlayLayer
| privateStaticLayer | property |
privateStaticLayer:IStaticLayer [read-only]Implementation
awx_internal function get privateStaticLayer():IStaticLayer
| projectionID | property |
public var projectionID:intThe current projectionID of the map.
The default value is -1 .
This property can be used as the source for data binding.
| rotatedHeight | property |
rotatedHeight:Number [read-write]The rotated map height in pixels.
This property can be used as the source for data binding.
Implementation public function get rotatedHeight():Number
public function set rotatedHeight(value:Number):void
| rotatedWidth | property |
rotatedWidth:Number [read-write]The rotated map width in pixels.
This property can be used as the source for data binding.
Implementation public function get rotatedWidth():Number
public function set rotatedWidth(value:Number):void
| scale | property |
public var scale:NumberThe current scale of the map.
The default value is NaN.
This property can be used as the source for data binding.
| showCrosshair | property |
public var showCrosshair:BooleanIf true, shows the crosshair at the center of the map.
The default value is true.
This property can be used as the source for data binding.
| showLogo | property |
public var showLogo:BooleanIf true, shows the ESRI logo at the corner of the map.
The default value is true.
This property can be used as the source for data binding.
| showScaleBar | property |
public var showScaleBar:BooleanIf true, shows the scale bar at the corner of the map.
The default value is true.
This property can be used as the source for data binding.
| staticLayer | property |
staticLayer:IStaticLayer [read-only]The main Static Layer (an IStaticLayer) onto which Static objects can be placed.
Implementation public function get staticLayer():IStaticLayer
| supportedProjections | property |
supportedProjections:Array [write-only]The array of supported projections for the groupLayer(s) in this map. Note that different group layers support different projections. This function returns the common set of projections for the current map.
This property can be used as the source for data binding.
Implementation public function set supportedProjections(value:Array):void
| Map | () | constructor |
public function Map()Creates a new Map. The map model is initialized with the following values:
| addLayer | () | method |
public function addLayer(layer:ILayer):voidAdds a layer to the group layer.
Parameterslayer:ILayer — the layer to add.
|
| convertExtentToScale | () | method |
public function convertExtentToScale(extent:Extent):NumberReturns a scale to ensure that an entire extent is visible.
Parametersextent:Extent — the extent to get a scale for.
|
Number — The scale factor.
|
| convertGeoPointToPoint | () | method |
public function convertGeoPointToPoint(geoPoint:GeoPoint):PointConverts decimal degree values to pixel.
ParametersgeoPoint:GeoPoint — the lat/lon values to convert.
|
Point — pixel values of provided lat/lon.
|
| convertPointToGeoPoint | () | method |
public function convertPointToGeoPoint(point:Point):GeoPointConverts pixel values to decimal degrees.
Parameterspoint:Point — the pixel point to convert.
|
GeoPoint —
lat/lon values of provided pixel point.
|
| getLayer | () | method |
public function getLayer(layerID:String):ILayerGets a layer based on its identifier.
ParameterslayerID:String — the layer identifier.
|
ILayer |
| moveLayerAbove | () | method |
public function moveLayerAbove(layer1ID:String, layer2ID:String):voidMoves the first layer above the the second layer in the z-order.
Parameterslayer1ID:String — the layer to move.
|
|
layer2ID:String — the layer to be moved above.
|
| moveLayerBelow | () | method |
public function moveLayerBelow(layer1ID:String, layer2ID:String):voidMoves the first layer below the the second layer in the z-order.
Parameterslayer1ID:String — the layer to move.
|
|
layer2ID:String — the layer to be moved below.
|
| moveLayerToBottom | () | method |
public function moveLayerToBottom(layerID:String):voidMoves the layer to the bottom of the z-order.
ParameterslayerID:String — the layer to move.
|
| moveLayerToTop | () | method |
public function moveLayerToTop(layerID:String):voidMoves the layer to the top of the z-order.
ParameterslayerID:String — the layer to move.
|
| removeAllLayers | () | method |
public function removeAllLayers():voidRemoves all layers.
| removeLayer | () | method |
public function removeLayer(layerID:String):voidRemoves a layer.
ParameterslayerID:String — the layer to remove.
|
| showWorld | () | method |
public function showWorld():voidAdjusts the map extent to show the whole world.
| swapLayers | () | method |
public function swapLayers(layer1ID:String, layer2ID:String):voidSwaps the z-order of two layers.
Parameterslayer1ID:String — the first layer to swap.
|
|
layer2ID:String — the second layer to swap.
|
| childAdd | event |
mx.events.ChildExistenceChangedEvent
Dispatched after a child has been added to a container.
The childAdd event is dispatched when the addChild()
or addChildAt() method is called.
When a container is first created, the addChild()
method is automatically called for each child component declared
in the MXML file.
The addChildAt() method is automatically called
whenever a Repeater object adds or removes child objects.
The application developer may also manually call these
methods to add new children.
At the time when this event is sent, the child object has been
initialized, but its width and height have not yet been calculated,
and the child has not been drawn on the screen.
If you want to be notified when the child has been fully initialized
and rendered, then register as a listener for the child's
creationComplete event.
| childRemove | event |
mx.events.ChildExistenceChangedEvent
Dispatched before a child of a container is removed.
This event is delivered when any of the following methods are called:
removeChild(), removeChildAt(),
or removeAllChildren().
| groupLayerChange | event |
com.esri.aws.awx.events.GroupLayerEvent
com.esri.aws.awx.events.GroupLayerEvent.GROUPLAYER_CHANGE
A layer has been moved within a GroupLayer.
| mapChange | event |
com.esri.aws.awx.events.MapChangeEvent
com.esri.aws.awx.events.MapChangeEvent.MAP_CHANGE
Used to detect when the map model has been changed.
| mapTypeChange | event |
com.esri.aws.awx.events.MapTypeChangeEvent
com.esri.aws.awx.events.MapTypeChangeEvent.MAP_TYPE_CHANGE
Used to detect when the mapType has been changed.
| panStart | event |
com.esri.aws.awx.events.PanEvent
com.esri.aws.awx.events.PanEvent.PAN_START
The map is starting to pan.
| panStop | event |
com.esri.aws.awx.events.PanEvent
com.esri.aws.awx.events.PanEvent.PAN_STOP
The map is finished panning.
| AERIAL | constant |
public static const AERIAL:String = "aerial"Satellite map type.
| HYBRID | constant |
public static const HYBRID:String = "hybrid"Hybrid map type.
| NONE | constant |
public static const NONE:String = "none"No map type. Overwrites the default pre-populated map type.
| SHADED_RELIEF | constant |
public static const SHADED_RELIEF:String = "shadedRelief"Satellite map type.
| STREETS | constant |
public static const STREETS:String = "streets"Street map type.
| STREET_TILES | constant |
public static const STREET_TILES:String = "streetTiles"StreetTiles map type.
| TOPOGRAPHIC | constant |
public static const TOPOGRAPHIC:String = "topographic"Topographic map type.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx"
layout="absolute">
<awx:Framework apiKey="[Your API Key here]"/>
<awx:Map mapType="streets">
<awx:basemaps>
<awx:VectorGroupLayer id="streets"/>
</awx:basemaps>
</awx:Map>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<!-- Open map at specific location and scale-->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx">
<awx:Framework apiKey="[Your API Key here]"/>
<awx:Map id="m_map" height="100%" width="100%" centerGeoY="33" centerGeoX="-117" scale="20000000"/>
</mx:Application>
<?xml version="1.0" encoding="utf-8"?>
<!-- 'Raster Tiles' sample for ArcWeb Services Flex API -->
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:awx="http://www.arcwebservices.com/2007/awx">
<awx:Framework apiKey="[Your API Key here]"/>
<awx:Map mapType="physicalTiles" id="m_map" height="100%" width="70%" centerGeoY="33" centerGeoX="-117" scale="20000000">
<awx:basemaps>
<awx:RasterTileLayer id="physicalTiles" dataSource="ArcWeb:ESRI.Physical_Tiles.World"/>
</awx:basemaps>
</awx:Map>
</mx:Application>