| Package | com.esri.ags |
| Class | public class Map |
| Inheritance | Map mx.containers.Canvas |
Default MXML Propertylayers
<esri:Map>
<esri:ArcGISTiledMapServiceLayer
url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />
<esri:GraphicsLayer>
<esri:Graphic toolTip="Kilimanjaro - 5,895 metres (19,341 ft)">
<esri:geometry>
<esri:MapPoint x="37.229" y="-3.107"/>
</esri:geometry>
</esri:Graphic>
</esri:GraphicsLayer>
<esri:extent>
<esri:Extent xmin="-17" ymin="-35" xmax="51" ymax="38"/>
</esri:extent>
</esri:Map>See also
| Property | Defined by | ||
|---|---|---|---|
| clickRecenterEnabled : Boolean
Enables recenter by click - press Shift and click the map to recenter on the clicked location.
| Map | ||
| crosshairVisible : Boolean
Shows a crosshair at the center of the map.
| Map | ||
| doubleClickZoomEnabled : Boolean
Enables double-click zoom - double-click the map to zoom in and recenter it at the clicked location.
| Map | ||
| extent : Extent
Extent of the map.
| Map | ||
| infoWindow : InfoWindow
[read-only]
The info window.
| Map | ||
| infoWindowContent : UIComponent
The info window content [added in version 1.3].
| Map | ||
| keyboardNavigationEnabled : Boolean
Enables panning and zooming via the keyboard.
| Map | ||
| layerIds : Array [read-only]
Array of current layers (IDs) in the map.
| Map | ||
| layers : Object
Set of layers to be viewed.
| Map | ||
| level : Number
The level of detail ID for the map.
| Map | ||
| loaded : Boolean [read-only]
After the first layer is loaded, the value is set to
true. | Map | ||
| lods : Array
Array of LOD's defining the map's levels.
| Map | ||
| logoVisible : Boolean
Logo visibility.
| Map | ||
| mapNavigationEnabled : Boolean
Enables all map navigation - using mouse as well as keyboard interaction.
| Map | ||
| navigationClass : Class
A reference to the class to use for the navigation control.
| Map | ||
| openHandCursorVisible : Boolean
When set to false, the open hand cursor is not shown over the map.
| Map | ||
| panArrowsVisible : Boolean
Displays eight pan arrows around the edge of the map.
| Map | ||
| panDuration : Number
The length of time in milliseconds that the map will take to pan from one extent to another [added in version 1.3].
| Map | ||
| panEnabled : Boolean
Enables mouse panning.
| Map | ||
| rubberbandZoomEnabled : Boolean
Enables rubberband zoom - press Shift, click, then drag to draw a bounding box zoom area.
| Map | ||
| scale : Number
The map scale.
| Map | ||
| scaleBarClass : Class
A reference to the class to use for the scale bar.
| Map | ||
| scaleBarVisible : Boolean
Displays the scale bar on the map.
| Map | ||
| scrollWheelZoomEnabled : Boolean
Enables zooming with the mouse scroll wheel.
| Map | ||
| spatialReference : SpatialReference
[read-only]
The spatial reference of the map.
| Map | ||
| units : String
The units of the Map.
| Map | ||
| zoomDuration : Number
The length of time in milliseconds that the map will take to zoom from one extent to another [added in version 1.3].
| Map | ||
| zoomSliderVisible : Boolean
Displays the zoom slider of the map.
| Map | ||
| Method | Defined by | ||
|---|---|---|---|
|
Map()
Creates a new Map.
| Map | ||
|
Adds a layer to the map.
| Map | ||
|
Recenters the map at the specified location.
| Map | ||
|
Returns an individual layer of a map.
| Map | ||
|
panDown():void
Pans the map south.
| Map | ||
|
panLeft():void
Pans the map west.
| Map | ||
|
panLowerLeft():void
Pans the map southwest.
| Map | ||
|
panLowerRight():void
Pans the map southeast.
| Map | ||
|
panRight():void
Pans the map east.
| Map | ||
|
panUp():void
Pans the map north.
| Map | ||
|
panUpperLeft():void
Pans the map northwest.
| Map | ||
|
panUpperRight():void
Pans the map northeast.
| Map | ||
|
removeAllLayers():void
Removes all layers.
| Map | ||
|
removeLayer(layer:Layer):void
Removes the specified layer.
| Map | ||
|
reorderLayer(layerId:String, index:int):void
Changes the layer order in the map.
| Map | ||
|
Converts a screen point to a map point.
| Map | ||
|
toMapFromStage(stageX:Number, stageY:Number):MapPoint
Converts the global stage coordinates to a map point.
| Map | ||
|
Converts a map point to a screen point.
| Map | ||
|
zoomIn():void
Make the map zoom in.
| Map | ||
|
zoomOut():void
Make the map zoom out.
| Map | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Fires when the extent of the map has changed. | Map | |||
| Fires when a layer is added. | Map | |||
| Fires when a layer is removed. | Map | |||
| Fires when all layers are removed. | Map | |||
| Fires when the map layer order has been changed. | Map | |||
| Fires when the first layer has been successfully added to the map. | Map | |||
| Fires when user clicks on the map. | Map | |||
| Fires when the pan is complete. | Map | |||
| Fires when a user commences panning. | Map | |||
| Fires during the pan process. | Map | |||
| Fires when the zoom is complete. | Map | |||
| Fires when a user commences zooming. | Map | |||
| Fires during the zoom process. | Map | |||
| clickRecenterEnabled | property |
clickRecenterEnabled:Boolean [read-write]Enables recenter by click - press Shift and click the map to recenter on the clicked location.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get clickRecenterEnabled():Boolean
public function set clickRecenterEnabled(value:Boolean):void
| crosshairVisible | property |
crosshairVisible:Boolean [read-write]Shows a crosshair at the center of the map.
The default value is false.
This property can be used as the source for data binding.
Implementation public function get crosshairVisible():Boolean
public function set crosshairVisible(value:Boolean):void
| doubleClickZoomEnabled | property |
doubleClickZoomEnabled:Boolean [read-write]Enables double-click zoom - double-click the map to zoom in and recenter it at the clicked location.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get doubleClickZoomEnabled():Boolean
public function set doubleClickZoomEnabled(value:Boolean):void
| extent | property |
extent:Extent [read-write]Extent of the map. This is determined from an initial map extent (if it exists) or from the initial extent of the first layer added to the map.
This property can be used as the source for data binding.
Implementation public function get extent():Extent
public function set extent(value:Extent):void
See also
<esri:Extent id="myExtent" xmin="15" ymin="54" xmax="40" ymax="71" spatialReference="{new SpatialReference(4326)}"/>
<esri:Map extent="{myExtent}"/>| infoWindow | property |
infoWindow:InfoWindow [read-only]The info window.
This property can be used as the source for data binding.
Implementation public function get infoWindow():InfoWindow
See also
| infoWindowContent | property |
infoWindowContent:UIComponent [read-write]The info window content [added in version 1.3]. Using this property, the content structure of the info window can be specified in mxml.
This property can be used as the source for data binding.
Implementation public function get infoWindowContent():UIComponent
public function set infoWindowContent(value:UIComponent):void
<esri:Map> <esri:infoWindowContent> <mx:VBox label="Title"> <mx:Label id="myLabel"/> </mx:VBox> </esri:infoWindowContent> </esri:Map>
| keyboardNavigationEnabled | property |
keyboardNavigationEnabled:Boolean [read-write]Enables panning and zooming via the keyboard.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get keyboardNavigationEnabled():Boolean
public function set keyboardNavigationEnabled(value:Boolean):void
| layerIds | property |
layerIds:Array [read-only]Array of current layers (IDs) in the map.
This property can be used as the source for data binding.
Implementation public function get layerIds():Array
| layers | property |
layers:Object [read-write]
Set of layers to be viewed.
This property lets you use either an Array, an ArrayCollection, or a single Layer.
If you set the layers property to an Array, it will be converted to an ArrayCollection.
If you set the property to an ArrayCollection, it will be used directly.
If you set the property to a single Layer, it will be wrapped in a new ArrayCollection.
Note: the layers property was added in version 1.1 of the ArcGIS API for Flex.
The default value is an empty ArrayCollection.
This property can be used as the source for data binding.
Implementation public function get layers():Object
public function set layers(value:Object):void
See also
| level | property |
level:Number [read-write]The level of detail ID for the map. When updated, zooms to the new level based on the current map centerpoint. Valid only when the map has lods.
This property can be used as the source for data binding.
Implementation public function get level():Number
public function set level(value:Number):void
| loaded | property |
loaded:Boolean [read-only]
After the first layer is loaded, the value is set to true.
The load event is also fired.
This property can be used as the source for data binding.
Implementation public function get loaded():Boolean
| lods | property |
lods:Array [read-write]Array of LOD's defining the map's levels. This array will be null unless the base layer was a tiled layer or the lods property has been set.
This property can be used as the source for data binding.
Implementation public function get lods():Array
public function set lods(value:Array):void
See also
myMap.lods = myTiledLayer.tileInfo.lods;
var lods:Array = myMap.lods; lods.push( new LOD( NaN, 0.00000713838288433451000000, 3000) ); lods.push( new LOD( NaN, 0.00000356919144216726000000, 1500) ); myMap.lods = lods;
| logoVisible | property |
logoVisible:Boolean [read-write]Logo visibility. Turning off the logo is only possible if you connect to your own ArcGIS Server (not counting ArcGIS Online).
The default value is true.
This property can be used as the source for data binding.
Implementation public function get logoVisible():Boolean
public function set logoVisible(value:Boolean):void
| mapNavigationEnabled | property |
mapNavigationEnabled:Boolean [read-write]
Enables all map navigation - using mouse as well as keyboard interaction.
Map navigation using mouse:
The default value is true.
This property can be used as the source for data binding.
Implementation public function get mapNavigationEnabled():Boolean
public function set mapNavigationEnabled(value:Boolean):void
| navigationClass | property |
navigationClass:Class [read-write]A reference to the class to use for the navigation control.
The default value is com.esri.ags.controls.Navigation.
This property can be used as the source for data binding.
Implementation public function get navigationClass():Class
public function set navigationClass(value:Class):void
See also
| openHandCursorVisible | property |
openHandCursorVisible:Boolean [read-write]When set to false, the open hand cursor is not shown over the map.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get openHandCursorVisible():Boolean
public function set openHandCursorVisible(value:Boolean):void
| panArrowsVisible | property |
panArrowsVisible:Boolean [read-write]Displays eight pan arrows around the edge of the map.
The default value is false.
This property can be used as the source for data binding.
Implementation public function get panArrowsVisible():Boolean
public function set panArrowsVisible(value:Boolean):void
| panDuration | property |
panDuration:Number [read-write]The length of time in milliseconds that the map will take to pan from one extent to another [added in version 1.3]. The minimum allowed value is 1.
The default value is 300 milliseconds.
This property can be used as the source for data binding.
Implementation public function get panDuration():Number
public function set panDuration(value:Number):void
| panEnabled | property |
panEnabled:Boolean [read-write]Enables mouse panning.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get panEnabled():Boolean
public function set panEnabled(value:Boolean):void
| rubberbandZoomEnabled | property |
rubberbandZoomEnabled:Boolean [read-write]Enables rubberband zoom - press Shift, click, then drag to draw a bounding box zoom area.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get rubberbandZoomEnabled():Boolean
public function set rubberbandZoomEnabled(value:Boolean):void
See also
| scale | property |
scale:Number [read-write]The map scale. This is calculated based on the units value, so make sure the units value is set correctly.
This property can be used as the source for data binding.
Implementation public function get scale():Number
public function set scale(value:Number):void
See also
| scaleBarClass | property |
scaleBarClass:Class [read-write]A reference to the class to use for the scale bar.
The default value is com.esri.ags.controls.ScaleBar.
This property can be used as the source for data binding.
Implementation public function get scaleBarClass():Class
public function set scaleBarClass(value:Class):void
See also
| scaleBarVisible | property |
scaleBarVisible:Boolean [read-write]Displays the scale bar on the map.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get scaleBarVisible():Boolean
public function set scaleBarVisible(value:Boolean):void
See also
| scrollWheelZoomEnabled | property |
scrollWheelZoomEnabled:Boolean [read-write]Enables zooming with the mouse scroll wheel.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get scrollWheelZoomEnabled():Boolean
public function set scrollWheelZoomEnabled(value:Boolean):void
| spatialReference | property |
spatialReference:SpatialReference [read-only]The spatial reference of the map. This is determined from an initial map extent with a spatial reference (if it exists) or from the spatial reference of the first layer added to the map.
This property can be used as the source for data binding.
Implementation public function get spatialReference():SpatialReference
| units | property |
units:String [read-write]The units of the Map. These units are used for calculating the map scale. The default value is the units of the first layer added to the map.
This property can be used as the source for data binding.
Implementation public function get units():String
public function set units(value:String):void
See also
| zoomDuration | property |
zoomDuration:Number [read-write]The length of time in milliseconds that the map will take to zoom from one extent to another [added in version 1.3]. The minimum allowed value is 1.
The default value is 300 milliseconds.
This property can be used as the source for data binding.
Implementation public function get zoomDuration():Number
public function set zoomDuration(value:Number):void
| zoomSliderVisible | property |
zoomSliderVisible:Boolean [read-write]Displays the zoom slider of the map. If the Map has lods, the zoom slider will contain the actual scale levels of the lods. If the map doesn't have lods, the zoom slider will only have the zoom in and zoom out icons. The zoom slider can be styled using CSS for Navigation.
The default value is true.
This property can be used as the source for data binding.
Implementation public function get zoomSliderVisible():Boolean
public function set zoomSliderVisible(value:Boolean):void
See also
| Map | () | constructor |
public function Map()Creates a new Map.
| addLayer | () | method |
public function addLayer(layer:Layer, index:int = -1):StringAdds a layer to the map. If an ID was not defined, a unique name will be created and assigned to the layer. The unique name is created using NameUtil.createUniqueName, which will combine the unqualified class name with an incrementing counter to create something like "Layer2".
Note: the second property, index, was added in version 1.1 of the ArcGIS API for Flex.
Parameterslayer:Layer — The layer to add.
|
|
index:int (default = -1) — The location for placing the layer. If index is less than 0 or greater than the total number of layers,
the layer will be placed on the top.
|
String — The ID of the layer.
|
See also
var myGraphicsLayer:GraphicsLayer = new GraphicsLayer(); myMap.addLayer(myGraphicsLayer);
| centerAt | () | method |
public function centerAt(mapPoint:MapPoint):voidRecenters the map at the specified location.
ParametersmapPoint:MapPoint — The point to center at.
|
See also
myMap.centerAt( addressCandidate.location );| getLayer | () | method |
public function getLayer(layerId:String):LayerReturns an individual layer of a map.
ParameterslayerId:String — The layer identifier.
|
Layer —
The layer associated with ID. If not found, null is returned.
|
| panDown | () | method |
public function panDown():voidPans the map south.
| panLeft | () | method |
public function panLeft():voidPans the map west.
| panLowerLeft | () | method |
public function panLowerLeft():voidPans the map southwest.
| panLowerRight | () | method |
public function panLowerRight():voidPans the map southeast.
| panRight | () | method |
public function panRight():voidPans the map east.
| panUp | () | method |
public function panUp():voidPans the map north.
| panUpperLeft | () | method |
public function panUpperLeft():voidPans the map northwest.
| panUpperRight | () | method |
public function panUpperRight():voidPans the map northeast.
| removeAllLayers | () | method |
public function removeAllLayers():voidRemoves all layers.
| removeLayer | () | method |
| reorderLayer | () | method |
public function reorderLayer(layerId:String, index:int):voidChanges the layer order in the map. Note that the first layer added is always the base layer, even if the order is changed later (or the first layer removed).
ParameterslayerId:String — The ID of the layer to be moved. This ID is assigned in Layer.id.
|
|
index:int — Refers to the location for placing the layer. The bottommost layer has an index of 0.
|
myMap.reorderLayer("myGraphicsLayer", 0);
myMap.reorderLayer("myTiledLayer", myMap.layers.length);| toMap | () | method |
public function toMap(screenPoint:Point):MapPointConverts a screen point to a map point. See toMapFromStage() for how to easily convert the coordinates of an event click to map coordinates.
ParametersscreenPoint:Point — The screen point.
|
MapPoint —
MapPoint in map coordinates.
|
See also
var mapLocalPixelPoint:Point = map.globalToLocal( new Point(event.stageX, event.stageY) ); var mapPoint:MapPoint = map.toMap( mapLocalPixelPoint );
| toMapFromStage | () | method |
public function toMapFromStage(stageX:Number, stageY:Number):MapPointConverts the global stage coordinates to a map point.
ParametersstageX:Number — The horizontal coordinate in global stage coordinates.
|
|
stageY:Number — The vertical coordinate in global stage coordinates.
|
MapPoint —
MapPoint in map coordinates.
|
var mapPoint:MapPoint = map.toMapFromStage( event.stageX, event.stageY );
| toScreen | () | method |
public function toScreen(mapPoint:MapPoint):PointConverts a map point to a screen point.
ParametersmapPoint:MapPoint — The map point to convert.
|
Point — Point in screen coordinates.
|
| zoomIn | () | method |
public function zoomIn():voidMake the map zoom in.
| zoomOut | () | method |
public function zoomOut():voidMake the map zoom out.
| extentChange | event |
com.esri.ags.events.ExtentEvent
com.esri.ags.events.ExtentEvent.EXTENT_CHANGE
Fires when the extent of the map has changed.
Defines the value of the type property of an extentChange event object.
| layerAdd | event |
com.esri.ags.events.MapEvent
com.esri.ags.events.MapEvent.LAYER_ADD
Fires when a layer is added.
Defines the value of the type property of a layerAdd event object.
| layerRemove | event |
com.esri.ags.events.MapEvent
com.esri.ags.events.MapEvent.LAYER_REMOVE
Fires when a layer is removed.
Defines the value of the type property of a layerRemove event object.
| layerRemoveAll | event |
com.esri.ags.events.MapEvent
com.esri.ags.events.MapEvent.LAYER_REMOVE_ALL
Fires when all layers are removed.
Defines the value of the type property of a layerRemoveAll event object.
| layerReorder | event |
com.esri.ags.events.MapEvent
com.esri.ags.events.MapEvent.LAYER_REORDER
Fires when the map layer order has been changed.
Defines the value of the type property of a layerReorder event object.
| load | event |
com.esri.ags.events.MapEvent
com.esri.ags.events.MapEvent.LOAD
Fires when the first layer has been successfully added to the map.
Defines the value of the type property of a load event object.
| mapClick | event |
com.esri.ags.events.MapMouseEvent
com.esri.ags.events.MapMouseEvent.MAP_CLICK
Fires when user clicks on the map. Unlike the flash click event, this won't fire if the user pans the map.
Note: the mapClick event was added in version 1.1 of the ArcGIS API for Flex.
Defines the value of the type property of a mapClick event object.
| panEnd | event |
com.esri.ags.events.PanEvent
com.esri.ags.events.PanEvent.PAN_END
Fires when the pan is complete.
Defines the value of the type property of a panEnd event object.
| panStart | event |
com.esri.ags.events.PanEvent
com.esri.ags.events.PanEvent.PAN_START
Fires when a user commences panning.
Defines the value of the type property of a panStart event object.
| panUpdate | event |
com.esri.ags.events.PanEvent
com.esri.ags.events.PanEvent.PAN_UPDATE
Fires during the pan process.
Defines the value of the type property of a panUpdate event object.
| zoomEnd | event |
com.esri.ags.events.ZoomEvent
com.esri.ags.events.ZoomEvent.ZOOM_END
Fires when the zoom is complete.
Defines the value of the type property of a zoomEnd event object.
| zoomStart | event |
com.esri.ags.events.ZoomEvent
com.esri.ags.events.ZoomEvent.ZOOM_START
Fires when a user commences zooming.
Defines the value of the type property of a zoomStart event object.
| zoomUpdate | event |
com.esri.ags.events.ZoomEvent
com.esri.ags.events.ZoomEvent.ZOOM_UPDATE
Fires during the zoom process.
Defines the value of the type property of a zoomUpdate event object.