| Package | com.esri.ags |
| Class | public class Map |
| Inheritance | Map mx.core.UIComponent |
Map navigation using mouse:
Default MXML Propertylayers
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 of the map. | Map | ||
| infoWindowContent : UIComponent
The info window content. | Map | ||
| infoWindowRenderersEnabled : Boolean
Set to false to prevent any info window renderers from being opened. | Map | ||
| initialExtent : Extent
Initial extent of the map. | 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 | ||
| multiTouchEnabled : Boolean
Enables multi-touch gestures. | Map | ||
| navigationClass : Class
A reference to the class to use for the navigation component. | 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 | ||
| panEasingFactor : Number
Valid values are 0 < value <= 1. | 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 | ||
| staticLayer : Group [read-only]
StaticLayer is useful for adding legends, logos and other items that should not be moved when the map is panned or zoomed. | Map | ||
| timeExtent : TimeExtent
The time extent of the map. | Map | ||
| timeSlider : ITimeSlider
The time slider that's used for this map's time extent. | Map | ||
| units : String
The units of the Map. | Map | ||
| wrapAround180 : Boolean
Allows for a map where the worlds repeats itself as you pan west or east. | 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 | ||
Zoom the map by a factor used to expand the current extent. | Map | ||
zoomIn():void
Make the map zoom in. | Map | ||
zoomOut():void
Make the map zoom out. | Map | ||
zoomToInitialExtent():void
Make the map zoom to the defined initial extent. | 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 user presses down the left mouse button. | Map | |||
| Fires when the pan is complete. | Map | |||
| Fires when a user commences panning. | Map | |||
| Fires during the pan process. | Map | |||
| Fires when the time extent of the map has changed. | Map | |||
| Fires when the zoom is complete. | Map | |||
| Fires when a user commences zooming. | Map | |||
| Fires during the zoom process. | Map | |||
| clickRecenterEnabled | property |
clickRecenterEnabled:BooleanEnables recenter by click - press Shift and click the map to recenter on the clicked location.
The default value is true.
public function get clickRecenterEnabled():Boolean public function set clickRecenterEnabled(value:Boolean):void| crosshairVisible | property |
crosshairVisible:BooleanShows a crosshair at the center of the map.
The default value is false.
public function get crosshairVisible():Boolean public function set crosshairVisible(value:Boolean):void| doubleClickZoomEnabled | property |
doubleClickZoomEnabled:BooleanEnables double-click zoom - double-click the map to zoom in and recenter it at the clicked location.
The default value is true.
public function get doubleClickZoomEnabled():Boolean public function set doubleClickZoomEnabled(value:Boolean):void| extent | property |
extent:ExtentExtent 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.
public function get extent():Extent public function set extent(value:Extent):voidSee 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 of the map. Note that the map can only have one info window. You can hide it, show it, change its content or location.
public function get infoWindow():InfoWindowSee also
| infoWindowContent | property |
infoWindowContent:UIComponent
The info window content.
The info window content owner is this Map instance.
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>| infoWindowRenderersEnabled | property |
infoWindowRenderersEnabled:Boolean| Since : | ArcGIS API for Flex 2.4 |
Set to false to prevent any info window renderers from being opened.
The default value is true.
public function get infoWindowRenderersEnabled():Boolean public function set infoWindowRenderersEnabled(value:Boolean):voidSee also
| initialExtent | property |
initialExtent:Extent| Since : | ArcGIS API for Flex 2.3 |
Initial extent of the map. If this property is not not set, then it will be set to the first extent property or the extent of the first layer.
public function get initialExtent():Extent public function set initialExtent(value:Extent):voidSee also
<esri:Extent id="myExtent" xmin="15" ymin="54" xmax="40" ymax="71" spatialReference="{new SpatialReference(4326)}"/>
<esri:Map initialExtent="{myExtent}"/>| keyboardNavigationEnabled | property |
keyboardNavigationEnabled:BooleanEnables panning and zooming via the keyboard.
The default value is true.
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.
public function get layerIds():Array| layers | property |
layers:Object
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.
public function get layers():Object public function set layers(value:Object):voidSee also
| level | property |
level:NumberThe 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. Returns -1 if no layer has been loaded or if map has no lods.
This property can be used as the source for data binding.
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.
public function get loaded():Boolean| lods | property |
lods:ArrayArray 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.
public function get lods():Array public function set lods(value:Array):voidSee 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:BooleanLogo visibility.
The default value is true.
public function get logoVisible():Boolean public function set logoVisible(value:Boolean):void| mapNavigationEnabled | property |
mapNavigationEnabled:BooleanEnables all map navigation - using mouse as well as keyboard interaction.
Map navigation using mouse:
The default value is true.
public function get mapNavigationEnabled():Boolean public function set mapNavigationEnabled(value:Boolean):void| multiTouchEnabled | property |
multiTouchEnabled:Boolean| Since : | ArcGIS API for Flex 2.3 |
Enables multi-touch gestures.
The default value is true.
public function get multiTouchEnabled():Boolean public function set multiTouchEnabled(value:Boolean):void| navigationClass | property |
navigationClass:ClassA reference to the class to use for the navigation component.
The default value is com.esri.ags.components.Navigation.
public function get navigationClass():Class public function set navigationClass(value:Class):voidSee also
| openHandCursorVisible | property |
openHandCursorVisible:BooleanWhen set to false, the open hand cursor is not shown over the map.
The default value is true.
public function get openHandCursorVisible():Boolean public function set openHandCursorVisible(value:Boolean):void| panArrowsVisible | property |
panArrowsVisible:BooleanDisplays eight pan arrows around the edge of the map.
The default value is false.
public function get panArrowsVisible():Boolean public function set panArrowsVisible(value:Boolean):void| panDuration | property |
panDuration:NumberThe 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 milliseonds.
public function get panDuration():Number public function set panDuration(value:Number):void| panEasingFactor | property |
panEasingFactor:NumberValid values are 0 < value <= 1. A value of 1 turns off the easing.
The default value is 0.2.
This property can be used as the source for data binding.
public function get panEasingFactor():Number public function set panEasingFactor(value:Number):void| panEnabled | property |
panEnabled:BooleanEnables mouse panning.
The default value is true.
public function get panEnabled():Boolean public function set panEnabled(value:Boolean):void| rubberbandZoomEnabled | property |
rubberbandZoomEnabled:BooleanEnables rubberband zoom - press Shift, click, then drag to draw a bounding box zoom area.
The default value is true.
public function get rubberbandZoomEnabled():Boolean public function set rubberbandZoomEnabled(value:Boolean):voidSee also
| scale | property |
scale:NumberThe map scale. This is calculated based on the units value, so make sure the units value is set correctly. Returns 0 if no layer has been loaded or it the map units is set to an invalid value.
This property can be used as the source for data binding.
public function get scale():Number public function set scale(value:Number):voidSee also
| scaleBarClass | property |
scaleBarClass:ClassA reference to the class to use for the scale bar.
The default value is com.esri.ags.components.ScaleBar.
public function get scaleBarClass():Class public function set scaleBarClass(value:Class):voidSee also
| scaleBarVisible | property |
scaleBarVisible:BooleanDisplays the scale bar on the map.
The default value is true.
public function get scaleBarVisible():Boolean public function set scaleBarVisible(value:Boolean):voidSee also
| scrollWheelZoomEnabled | property |
scrollWheelZoomEnabled:BooleanEnables zooming with the mouse scroll wheel.
The default value is true.
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.
public function get spatialReference():SpatialReference| staticLayer | property |
staticLayer:Group [read-only] StaticLayer is useful for adding legends, logos and other items that should not be moved when the map is panned or zoomed.
public function get staticLayer():Group| timeExtent | property |
timeExtent:TimeExtentThe time extent of the map. Conceptually similar to a spatial extent it will limit the data being shown. The time extent is defined by start and end time. Setting the time extent on the map will make all time-aware layers limit their time-aware data to the time extent of the map.
This property can be used as the source for data binding.
public function get timeExtent():TimeExtent public function set timeExtent(value:TimeExtent):void| timeSlider | property |
timeSlider:ITimeSliderThe time slider that's used for this map's time extent.
public function get timeSlider():ITimeSlider public function set timeSlider(value:ITimeSlider):void| units | property |
units:StringThe 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.
public function get units():String public function set units(value:String):voidSee also
| wrapAround180 | property |
wrapAround180:Boolean| Since : | ArcGIS API for Flex 2.3 |
Allows for a map where the worlds repeats itself as you pan west or east.
The default value is false.
public function get wrapAround180():Boolean public function set wrapAround180(value:Boolean):void| zoomDuration | property |
zoomDuration:NumberThe 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 milliseonds.
public function get zoomDuration():Number public function set zoomDuration(value:Number):void| zoomSliderVisible | property |
zoomSliderVisible:BooleanDisplays 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.
public function get zoomSliderVisible():Boolean public function set zoomSliderVisible(value:Boolean):voidSee 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.
Parameters
layer: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.
Parameters
mapPoint: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.
Parameters
layerId: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).
Parameters
layerId: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.
Parameters
screenPoint: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.
Parameters
stageX: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.
Parameters
mapPoint:MapPoint — The map point to convert.
|
Point — Point in screen coordinates.
|
| zoom | () | method |
public function zoom(factor:Number, focusPoint:MapPoint = null):void| Since : | ArcGIS API for Flex 2.3 |
Zoom the map by a factor used to expand the current extent. For example, a factor of 2.0 will create an extent that is 100% larger than before and a factor of 0.5 will create an extent that is 50% smaller than before.
Parameters
factor:Number — The extent multiplier value.
| |
focusPoint:MapPoint (default = null) — The map point that should not move in relation to the screen.
|
| zoomIn | () | method |
public function zoomIn():voidMake the map zoom in.
| zoomOut | () | method |
public function zoomOut():voidMake the map zoom out.
| zoomToInitialExtent | () | method |
public function zoomToInitialExtent():void| Since : | ArcGIS API for Flex 2.3 |
Make the map zoom to the defined initial extent.
See also
| extentChange | Event |
com.esri.ags.events.ExtentEventcom.esri.ags.events.ExtentEvent.EXTENT_CHANGEFires when the extent of the map has changed.
Defines the value of thetype property of an extentChange event object.
| layerAdd | Event |
com.esri.ags.events.MapEventcom.esri.ags.events.MapEvent.LAYER_ADDFires when a layer is added.
Defines the value of thetype property of a layerAdd event object.
| layerRemove | Event |
com.esri.ags.events.MapEventcom.esri.ags.events.MapEvent.LAYER_REMOVEFires when a layer is removed.
Defines the value of thetype property of a layerRemove event object.
| layerRemoveAll | Event |
com.esri.ags.events.MapEventcom.esri.ags.events.MapEvent.LAYER_REMOVE_ALLFires when all layers are removed.
Defines the value of thetype property of a layerRemoveAll event object.
| layerReorder | Event |
com.esri.ags.events.MapEventcom.esri.ags.events.MapEvent.LAYER_REORDERFires when the map layer order has been changed.
Defines the value of thetype property of a layerReorder event object.
| load | Event |
com.esri.ags.events.MapEventcom.esri.ags.events.MapEvent.LOADFires when the first layer has been successfully added to the map.
Defines the value of thetype property of a load event object.
| mapClick | Event |
com.esri.ags.events.MapMouseEventcom.esri.ags.events.MapMouseEvent.MAP_CLICKFires 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 thetype property of a mapClick event object.
| mapMouseDown | Event |
com.esri.ags.events.MapMouseEventcom.esri.ags.events.MapMouseEvent.MAP_MOUSE_DOWNFires when user presses down the left mouse button.
Note: the mapMouseDown event was added in version 2.1 of the ArcGIS API for Flex.
Defines the value of thetype property of a mapMouseDown event object.
| panEnd | Event |
com.esri.ags.events.PanEventcom.esri.ags.events.PanEvent.PAN_ENDFires when the pan is complete.
Defines the value of thetype property of a panEnd event object.
| panStart | Event |
com.esri.ags.events.PanEventcom.esri.ags.events.PanEvent.PAN_STARTFires when a user commences panning.
Defines the value of thetype property of a panStart event object.
| panUpdate | Event |
com.esri.ags.events.PanEventcom.esri.ags.events.PanEvent.PAN_UPDATEFires during the pan process.
Defines the value of thetype property of a panUpdate event object.
| timeExtentChange | Event |
com.esri.ags.events.TimeExtentEventcom.esri.ags.events.TimeExtentEvent.TIME_EXTENT_CHANGEFires when the time extent of the map has changed.
Defines the value of thetype property of an timeExtentChange event object.
| zoomEnd | Event |
com.esri.ags.events.ZoomEventcom.esri.ags.events.ZoomEvent.ZOOM_ENDFires when the zoom is complete.
Defines the value of thetype property of a zoomEnd event object.
| zoomStart | Event |
com.esri.ags.events.ZoomEventcom.esri.ags.events.ZoomEvent.ZOOM_STARTFires when a user commences zooming.
Defines the value of thetype property of a zoomStart event object.
| zoomUpdate | Event |
com.esri.ags.events.ZoomEventcom.esri.ags.events.ZoomEvent.ZOOM_UPDATEFires during the zoom process.
Defines the value of thetype property of a zoomUpdate event object.
<esri:Map>
<esri:ArcGISTiledMapServiceLayer
url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:GraphicsLayer>
<esri:Graphic toolTip="Kilimanjaro - 5,895 metres (19,341 ft)">
<esri:geometry>
<esri:MapPoint x="4144313" y="-346039"/>
</esri:geometry>
</esri:Graphic>
</esri:GraphicsLayer>
<esri:extent>
<esri:Extent xmin="-1892000" ymin="-4163000" xmax="5677294" ymax="4579425"/>
</esri:extent>
</esri:Map>