Description
The esri.Map class creates a container and required DOM structure for adding
layers,
graphics, an
info window, and other navigation controls.
Typically, a map is added to a page using a DIV. The map's width and height are initialized to those of the DIV container.
The Map.onLoad event is fired after the first layer has been added to the map. At this point, the map is fully functional. A Map.onLoad handler function should be used to add content and change map behaviors.
For an introduction on using the Map class, see
Adding a map.
Class hierarchy
esri.Map
Constructor
| esri.Map(divId, options?) |
Creates a new map inside of the given HTML container, which is often a DIV element. The size of the map is the size of the container. The Map constructor can also include optional parameters. The optional parameters can be included in any order. |
Properties
| extent |
Extent
|
The current extent of the map in map units. This property is read-only. |
| graphics |
GraphicsLayer
|
Add and remove graphics from the GraphicsLayer. |
| graphicsLayerIds |
String[]
|
An array of the current GraphicsLayers in the map. |
| height |
Number
|
Current height of the map in screen pixels. |
| id |
String
|
Reference to HTML DIV or other element where the map is placed on the page. This property is set in the Map constructor. |
| infoWindow |
InfoWindow
|
Displays the InfoWindow on a map. |
| isClickRecenter |
Boolean
|
When true, the key sequence of shift then click to recenter the map is enabled. |
| isDoubleClickZoom |
Boolean
|
When true, double click zoom is enabled. This allows a user to zoom and recenter the map by double clicking the mouse. |
| isKeyboardNavigation |
Boolean
|
When true, keyboard navigation is enabled. This allows users to pan the keyboard using the arrow keys and to zoom using the + and - keys. |
| isPan |
Boolean
|
When true, map panning is enabled using the mouse. |
| isPanArrows |
Boolean
|
When true, pan arrows are displayed around the edge of the map. |
| isRubberBandZoom |
Boolean
|
When true, rubberband zoom is enabled. This allows users to draw a bounding box zoom area using the mouse. |
| isScrollWheelZoom |
Boolean
|
When true, the mouse scroll wheel zoom is enabled. |
| isShiftDoubleClickZoom |
Boolean
|
When true, shift double click zoom is enabled. This allows a user to zoom and recenter the map by shift + double clicking the mouse. |
| isZoomSlider |
Boolean
|
When true, the zoom slider is displayed on the map. |
| layerIds |
String[]
|
Array of current TiledMapServiceLayers and DynamicMapServiceLayers added to the map. |
| loaded |
Boolean
|
After the first layer is loaded, the value is set to true. |
| position |
Point
|
This point geometry in screen coordinates represent the top-left corner of the map container. This coordinate also acts as the origin for all screen coordinates returned by Map and GraphicsLayer events. |
| spatialReference |
SpatialReference
|
The spatial reference of the map. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references. |
| width |
Number
|
Current width of the map in screen pixels. |
Methods
Map actions:
|
addLayer(layer, index?) |
Layer
|
Adds an ESRI Layer to the map.
The return object of Layer was added at v1.4. |
|
getInfoWindowAnchor(screenCoords) |
String
|
Sets an InfoWindow's anchor when calling InfoWindow.show. |
|
getLayer(id) |
Layer
|
Returns an individual layer of a map. |
| getLevel() |
Number
|
Gets the current level of detail ID for the map. Valid only with an ArcGISTiledMapService layer. |
| removeAllLayers() |
none
|
Removes all layers from the map.
The map's extent, spatial reference, and tiling scheme if defined do not change when the layers are removed. When the next layer is added to the map, this layer is displayed at the same extent and spatial reference. |
|
removeLayer(layer) |
none
|
Removes the specified layer from the map. |
|
reorderLayer(layer, index) |
none
|
Changes the layer order in the map. |
| reposition() |
none
|
Repositions the map DIV on the page. This method should be used after the map DIV has been repostioned. |
| resize() |
none
|
Resizes the map DIV. This method should be used after the map DIV has been resized. |
|
setExtent(extent, fit?) |
none
|
Sets the extent of the map. The extent must be in the same spatial reference as the map. |
|
setLevel(level) |
none
|
Sets the map to the specified level ID. Zooms to the new level based on the current map center point. Valid only with an ArcGISTiledMapService layer. |
|
setMapCursor(cursor) |
none
|
Sets the default cursor for the map. This cursor is shown whenever the mouse is pointed over the map, except when panning by dragging the map or using SHIFT+Drag to zoom. If not set, the map uses the platform-dependent default cursor, usually an arrow. |
|
toMap(screenPoint) |
Point
|
Converts a single screen point or an array of screen points to map coordinates. |
|
toScreen(mapPoint) |
Point
|
Converts a single map point or an array of map points to screen coordinates. |
Map navigation:
Events
| onClick(event)
|
Fires when a user single clicks on the map using the mouse and the mouse pointer is within the map region of the HTML page. |
| onDblClick(event)
|
Fires when a user double clicks on the map using the mouse and the mouse pointer is within the map region of the HTML page. |
| onExtentChange(extent, delta, levelChange, lod)
|
Fires when the extent of the map has changed. |
| onKeyDown(keyEvent)
|
Fires when a keyboard key is pressed. |
| onKeyUp(keyEvent)
|
Fires when a keyboard key is released. |
| onLayerAdd(layer)
|
Fires any time a layer is added to the map. |
| onLayerRemove(layer)
|
Fires after the layer has been removed. |
| onLayerReorder(layer, index)
|
Fires when the map layer order has been changed. |
| onLayersRemoved()
|
Fires after all the layers have been removed. |
| onLayersReordered(layerIds)
|
Fires when all the layers have been reordered. |
| onLoad(map)
|
Fires when the first or base layer has been successfully added to the map. |
| onMouseDown(event)
|
Fires when a mouse button is pressed down and the mouse cursor is in the map region of the HTML page. |
| onMouseDrag(event)
|
Fires while the mouse is being dragged until the mouse button is released. |
| onMouseDragEnd(event)
|
Fires when a mouse button is released and the user stops dragging the mouse. |
| onMouseDragStart(event)
|
Fires when a mouse button is pressed down and the user starts to drag the mouse. |
| onMouseMove(event)
|
Fires any time the mouse pointer moves over the map region. A common use for this event is to show the current x,y coordinate of the map as the user moves the mouse pointer. |
| onMouseOut(event)
|
Fires when the mouse moves out of the map region of the HTML page. |
| onMouseOver(event)
|
Fires when the mouse moves into the map region of the HTML page. |
| onMouseUp(event)
|
Fires when the mouse button is released and the mouse pointer is within the map region of the HTML page. |
| onMouseWheel(event)
|
Fires when the mouse wheel is scrolled. |
| onPan(extent, delta)
|
Fires during the pan process. |
| onPanEnd(extent, endPoint)
|
Fires when the pan is complete. |
| onPanStart(extent, startPoint)
|
Fires when a user commences panning. |
| onReposition(x, y)
|
Fires when the map DIV is repositioned. |
| onResize(extent, height, width)
|
Fires when the Div containing the map has been resized. |
| onUnload(map)
|
Fires when the page is refreshed. |
| onZoom(extent, zoomFactor, anchor)
|
Fires during the zoom process. |
| onZoomEnd(extent, zoomFactor, anchor, level)
|
Fires when the zoom is complete. |
| onZoomStart(extent, zoomFactor, anchor, level)
|
Fires when a user commences zooming. |
Constructor Detail
esri.Map(divId, options?)
Creates a new map inside of the given HTML container, which is often a DIV element. The size of the map is the size of the container. The Map constructor can also include optional parameters. The optional parameters can be included in any order.
Parameters:
|
<String>
divId |
Required |
Container ID for referencing map. This value is required.
|
|
<Object>
options |
Optional |
Optional parameters. See options list.
|
Options:
|
<Boolean>
displayGraphicsOnPan |
When true, graphics are displayed during panning. When false, the graphics are turned off during pan movement. Setting to false may improve performance in Internet Explorer. The default is true.
|
|
<Extent>
extent |
If provided, the extent and projection of the map is set to the properties of Extent. Once the projection is set, all layers must be able to be drawn in the defined projection. The tiling scheme of an ArcGISTiledMapServiceLayer must match the projection of the map. The projection of the extent is honored as of v1.2 when used in the map constructor.
function init() {
var map = new esri.Map("map", {
extent: new esri.geometry.Extent({xmin:-20098296,ymin:-2804413,xmax:5920428,ymax:15813776,spatialReference:{wkid:54032}})
});
var dynamicMSLayer = new esri.layers.ArcGISDynamicMapServiceLayer
("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer")
map.addLayer(dynamicMSLayer);
}
|
|
<Object>
layer |
Layer used to initialize map. This will be the base layer. The object format is {type, url}.
|
|
<LOD[]>
lods |
If provided, the map is initialized with the specified levels of detail. All ArcGISTiledMapServiceLayers added to the map must have matching resolutions in order to be displayed. (As of v1.2)
var lods = [
{"level" : 0, "resolution" : 0.010986328125, "scale" : 4617149.97766929},
{"level" : 1, "resolution" : 0.0054931640625, "scale" : 2308574.98883465},
{"level" : 2, "resolution" : 0.00274658203125, "scale" : 1154287.49441732},
{"level" : 3, "resolution" : 0.001373291015625, "scale" : 577143.747208662},
{"level" : 4, "resolution" : 0.0006866455078125, "scale" : 288571.873604331}
];
map = new esri.Map("map", {
lods: lods
});
|
|
<Boolean>
nav |
Displays pan buttons on map. When false, the pan arrows never display. The default is false.
|
|
<Boolean>
showInfoWindowOnClick |
The default behavior is to show an InfoWindow if the Graphic has a defined InfoTemplate when the user clicks on the graphic. When true, this default behavior is honored. The default value is true.
|
|
<Boolean>
slider |
Displays a slider on the map. When false, the slider never displays. Default is true.
|
Code snippets:
- In this example, a new map named "mymap" is created and will be placed inside a container named "mapDiv".
var myMap;
function init() {
//create map
myMap = new esri.Map("mapDiv");
...
}
Later in the code, the map container is referenced in the DIV id.
<div id="mapDiv" style="width:600px; height:600px; border:1px solid #000;"></div>
- In this second example, the optional extent parameter is also included in the constructor.
var myMap = new esri.Map("mapDiv", { extent: new esri.geometry.Extent
(-124.71, 31.89, -113.97, 42.63) });
- This example creates a map with no slider or pan arrows.
var myMap = new esri.Map("mapDiv", { slider:false, nav:false });
- In this example, graphics are turned off whenever the map is panned.
var myMap = new esri.Map("mapDiv", { displayGraphicsOnPan:false });
If you want the graphics turned off during a pan only for Internet Explorer, use the following constructor:
var myMap = new esri.Map("mapDiv", { displayGraphicsOnPan:! dojo.isIE });
Properties Detail
Code snippets:
function showExtent() {
var s = "";
s = "XMin: "+ myMap.extent.xmin
+" YMin: " + myMap.extent.ymin
+" XMax: " + myMap.extent.xmax
+" YMax: " + myMap.extent.ymax;
dojo.byId("info").innerHTML = s;
}
Provides access to the Map's GraphicsLayer.
<String[]> graphicsLayerIds
Current height of the map in screen pixels. This property is read-only. The height and width of the map are normally set in the HTML DIV or other HTML element containing the map container.
Code snippets:
function getMapWidthHeight() {
alert("Width = " + myMap.width + "; Height = " + myMap.height);
}
Reference to HTML DIV or other element where the map is placed on the page. This property is set in the Map constructor.
Code snippets:
myMap = new esri.Map("mapDiv");
Displays the InfoWindow on a map.
<Boolean> isClickRecenter
When true, the key sequence of shift then click to recenter the map is enabled. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
function stopClickRecenter() {
myMap.disableClickRecenter();
dojo.byId("stopClickRecenter").value = myMap.isClickRecenter;
}
<Boolean> isDoubleClickZoom
When true, double click zoom is enabled. This allows a user to zoom and recenter the map by double clicking the mouse. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
dojo.byId("theDoubleClickZoom").value = myMap.isDoubleClickZoom;
<Boolean> isKeyboardNavigation
When true, keyboard navigation is enabled. This allows users to pan the keyboard using the arrow keys and to zoom using the + and - keys. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
dojo.byId("keyboardNavigationStatus").value = myMap.isKeyboardNavigation;
When true, map panning is enabled using the mouse. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
dojo.byId("panStatus").value = myMap.isPan;
When true, pan arrows are displayed around the edge of the map. See
Map navigation for more details.
Known values: true | false
Default value: false
<Boolean> isRubberBandZoom
When true, rubberband zoom is enabled. This allows users to draw a bounding box zoom area using the mouse. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
dojo.byId("checkRubberBandZoom").value = myMap.isRubberBandZoom;
<Boolean> isScrollWheelZoom
When true, the mouse scroll wheel zoom is enabled. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
function stopScrollWheelZoom() {
myMap.disableScrollWheelZoom();
dojo.byId("stopScrollWheelZoom").value = myMap.isScrollWheelZoom;
}
<Boolean> isShiftDoubleClickZoom
When true, shift double click zoom is enabled. This allows a user to zoom and recenter the map by shift + double clicking the mouse. See
Map navigation for more details.
(As of v1.2)
Known values: true | false
Default value: true
Code snippets:
dojo.byId("theShiftDoubleClickZoom").value = myMap.isShiftDoubleClickZoom;
When true, the zoom slider is displayed on the map. See
Map navigation for more details.
Known values: true | false
Default value: true
Code snippets:
function getLayerProperties() {
for(var j = 0; j < map.layerIds.length; j++) {
var layer = map.getLayer(map.layerIds[j]);
alert(layer.id + ' ' + layer.opacity + ' ' + layer.visibility);
}
}
After the first layer is loaded, the value is set to true.
Known values: true | false
This point geometry in screen coordinates represent the top-left corner of the map container. This coordinate also acts as the origin for all screen coordinates returned by
Map and
GraphicsLayer events.
(As of v1.3)
Current width of the map in screen pixels. This property is read-only. The height and width of the map are normally set in the HTML DIV or other HTML element containing the map container.
Code snippets:
function getMapWidthHeight() {
alert("Width = " + myMap.width + "; Height = " + myMap.height);
}
Methods Detail
Adds an ESRI Layer to the map.
The return object of Layer was added at v1.4.
Input Parameters:
|
<Layer> layer |
Required |
Layer to be added to the map. |
|
<Number> index |
Optional |
A layer can be added at a
specific index in the map. If no index is specified or the index specified is
greater the current number of layers, the layer is automatically appended to the
list of layers in the map and the index is normalized. (As of v1.3) |
centerAndZoom(mapPoint, levelOrFactor)
Centers and zooms the map. (As of v1.2)
Return value: none
Input Parameters:
|
<Point> mapPoint |
Required |
Centers the map on the specified x,y location. |
|
<Number> levelOrFactor |
Required |
When using an ArcGISTiledMapServiceLayer, the map is zoomed to the level specified. When using a DynamicMapServiceLayer, the map is zoomed in or out by the specified factor. For example, use 0.5 to zoom in twice as far and 2.0 to zoom out twice as far. |
Recenters the map based on map coordinates as the center point.
Return value: none
Input Parameters:
|
<Point> mapPoint |
Required |
Centers the map on the specified x,y location. |
Disallows clicking on a map to recenter it. See
Map navigation for more details.
Return value: none
Code snippets:
function init() {
myMap = new esri.Map("mapDiv");
myMap.disableClickRecenter();
}
Disallows double clicking on a map to zoom in a level and recenter the map. See
Map navigation for more details.
Return value: none
Code snippets:
function init() {
myMap = new esri.Map("mapDiv");
myMap.disableDoubleClickZoom();
}
Disallows all map navigation except the slider and pan arrows. See
Map navigation for more details.
Return value: none
Disallows panning a map using the mouse. See
Map navigation for more details.
Return value: none
Code snippets:
function noPan() {
myMap.disablePan();
}
Disallows zooming in or out on a map using a bounding box. See
Map navigation for more details.
Return value: none
Code snippets:
function noRubberBand() {
myMap.disableRubberBandZoom();
}
Disallows zooming in or out on a map using the mouse scroll wheel. See
Map navigation for more details.
Return value: none
Code snippets:
function stopScrollWheelZoom() {
myMap.disableScrollWheelZoom();
dojo.byId("stopScrollWheelZoom").value = myMap.isScrollWheelZoom;
}
disableShiftDoubleClickZoom()
Disallows shift double clicking on a map to zoom in a level and recenter the map. See
Map navigation for more details.
(As of v1.2)
Return value: none
Code snippets:
function init() {
myMap = new esri.Map("mapDiv");
myMap.disableShiftDoubleClickZoom();
}
disbleKeyboardNavigation()
Disallows panning and zooming using the keyboard. See
Map navigation for more details.
Return value: none
Code snippets:
function init() {
myMap = new esri.Map("mapDiv");
myMap.disableKeyboardNavigation();
}
Permits users to click on a map to recenter it. See
Map navigation for more details.
Return value: none
Code snippets:
function okClickRecenter() {
myMap.enableClickRecenter();
}
Permits users to double click on a map to zoom in a level and recenter the map. See
Map navigation for more details.
Return value: none
Code snippets:
function okDoubleClickZoom() {
myMap.enableDoubleClickZoom();
}
enableKeyboardNavigation()
Permits users to pan and zoom using the keyboard. See
Map navigation for more details.
Return value: none
Code snippets:
function init() {
myMap = new esri.Map("mapDiv");
myMap.enableKeyboardNavigation();
}
Permits users to pan a map using the mouse. See
Map navigation for more details.
Return value: none
Code snippets:
function panAgain() {
myMap.enablePan();
}
Permits users to zoom in or out on a map using a bounding box. See
Map navigation for more details.
Return value: none
Code snippets:
function allowRubberBand() {
myMap.enableRubberBandZoom();
}
Permits users to zoom in or out on a map using the mouse scroll wheel. See
Map navigation for more details.
Return value: none
Code snippets:
function allowScrollWheelZoom() {
myMap.enableScrollWheelZoom();
}
enableShiftDoubleClickZoom()
Permits users to shift double click on a map to zoom in a level and recenter the map. See
Map navigation for more details.
(As of v1.2)
Return value: none
Code snippets:
function okShiftDoubleClickZoom() {
myMap.enableShiftDoubleClickZoom();
}
getInfoWindowAnchor(screenCoords)
Return value: String
Input Parameters:
|
<Point> screenCoords |
Required |
The anchor point in screen units. |
Returns an individual layer of a map.
Input Parameters:
|
<String> id |
Required |
ID assigned to the layer. |
Hides the pan arrows from the map. See
Map navigation for more details.
Return value: none
Hides the zoom slider from the map. See
Map navigation for more details.
Return value: none
Pans the map south.
Return value: none
Code snippets:
function south() {
myMap.panDown();
}
Pans the map west.
Return value: none
Code snippets:
function west() {
myMap.panLeft();
}
Pans the map southwest.
Return value: none
Code snippets:
function southWest() {
myMap.panLowerLeft();
}
Pans the map southeast.
Return value: none
Code snippets:
function southEast() {
myMap.panLowerRight();
}
Pans the map east.
Return value: none
Code snippets:
function east() {
myMap.panRight();
}
Pans the map north.
Return value: none
Code snippets:
function north() {
myMap.panUp();
}
Pans the map northwest.
Return value: none
Code snippets:
function northWest() {
myMap.panUpperLeft();
}
Pans the map northeast.
Return value: none
Code snippets:
function northEast() {
myMap.panUpperRight();
}
Removes all layers from the map.
The map's extent, spatial reference, and tiling scheme if defined do not change when the layers are removed. When the next layer is added to the map, this layer is displayed at the same extent and spatial reference. (As of v1.3)
Return value: none
Removes the specified layer from the map. (As of v1.3)
Return value: none
Input Parameters:
|
<Layer> layer |
Required |
Layer to be removed from the map.
The map's extent, spatial reference, and tiling scheme if defined do not change when the layer is removed. When the next layer is added to the map, this layer is displayed at the same extent and spatial reference. |
reorderLayer(layer, index)
Changes the layer order in the map. Note that the first layer added is always the base layer, even if its order is changed.
Return value: none
Input Parameters:
|
<Layer> layer |
Required |
The layer to be moved. (As of v1.4) Beginning with version 1.4, use this parameter in place of "layerId".
In versions prior to v1.4, use "layerID" in place of "layer".
Type: <String>
Definition: The ID of the layer to be moved. This ID is assigned in Layer.id. |
|
<Number> index |
Required |
Refers to the location for placing the layer. The bottom most layer has an index of 0. |
Repositions the map DIV on the page. This method should be used after the map DIV has been repostioned.
Return value: none
Resizes the map DIV. This method should be used after the map DIV has been resized.
Return value: none
Sets the extent of the map. The extent must be in the same spatial reference as the map.
Return value: none
Input Parameters:
|
<Extent> extent |
Required |
Sets the minx, miny, maxx, and maxy for a map. |
|
<Boolean> fit |
Optional |
When true, for maps that contain tiled map service layers, you are guaranteed to have the input extent shown completely on the map. (As of v1.3) |
Sets the map to the specified level ID. Zooms to the new level based on the current map center point. Valid only with an
ArcGISTiledMapService layer.
Return value: none
Input Parameters:
|
<Number> level |
Required |
The level ID. |
Sets the default cursor for the map. This cursor is shown whenever the mouse is pointed over the map, except when panning by dragging the map or using SHIFT+Drag to zoom. If not set, the map uses the platform-dependent default cursor, usually an arrow. (As of v1.5)
Return value: none
Input Parameters:
|
<String> cursor |
Required |
A standard CSS cursor value. Some common values include "default", "pointer", "crosshair", "text", "help", and "wait". |
Code snippets:
Map.setMapCursor("wait");
Shows the zoom slider on the map. See
Map navigation for more details.
Return value: none
Converts a single screen point or an array of screen points to map coordinates.
Input Parameters:
|
<Point> screenPoint |
Required |
Converts screen coordinates to map coordinates. |
Converts a single map point or an array of map points to screen coordinates.
Input Parameters:
|
<Point> mapPoint |
Required |
Converts map coordinates to screen coordinates. |
Events Detail
Fires when a user single clicks on the map using the mouse and the mouse pointer is within the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when a user double clicks on the map using the mouse and the mouse pointer is within the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
onExtentChange(extent, delta, levelChange, lod)
Fires when the extent of the map has changed.
Arguments:
|
<Extent> extent
|
Gets the extent when after the extent has changed.
|
|
<Point> delta
|
The change in the x and y values from the previous extent. The Point x and y values are in screen units. This point acts as an anchor point, and this part of the map stays within the map region during the zoom process.
|
|
<Boolean> levelChange
|
When using ArcGIS Server tiled map services, the value is "true" when the user zooms to a new level. The value remains "false" during pan operations.
|
|
<LOD> lod
|
When using ArcGIS Server tiled map services, this argument returns characteristics about the level of detail.
|
Fires when a keyboard key is pressed.
Arguments:
|
<Object> keyEvent
|
The keyCode is the Unicode number representing the pressed key. See http://msdn2.microsoft.com/en-us/library/ms536938.aspx.
|
Fires when a keyboard key is released.
Arguments:
|
<Object> keyEvent
|
The keyCode is the Unicode number representing the pressed key.
|
Fires any time a layer is added to the map.
Arguments:
|
<Layer> layer
|
The layer added to the map.
|
Fires after the layer has been removed. (As of v1.3)
Arguments:
|
<Layer> layer
|
The removed layer.
|
onLayerReorder(layer, index)
Fires when the map layer order has been changed.
Arguments:
|
<Layer> layer
|
The reordered layer.
|
|
<Number> index
|
The index of the reordered layer.
|
Fires after all the layers have been removed. (As of v1.3)
onLayersReordered(layerIds)
Fires when all the layers have been reordered. (As of v1.1)
Arguments:
|
<String[]> layerIds
|
Gets the extent during the zoom event.
|
Fires when the first or base layer has been successfully added to the map.
Arguments:
|
<Map> map
|
Specifies the map to load.
|
Fires when a mouse button is pressed down and the mouse cursor is in the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires while the mouse is being dragged until the mouse button is released.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when a mouse button is released and the user stops dragging the mouse.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when a mouse button is pressed down and the user starts to drag the mouse.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires any time the mouse pointer moves over the map region. A common use for this event is to show the current x,y coordinate of the map as the user moves the mouse pointer.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when the mouse moves out of the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when the mouse moves into the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when the mouse button is released and the mouse pointer is within the map region of the HTML page.
Arguments:
|
<Object> event
|
The result can be any JavaScript MouseEvent, or the x and y coordinates of screenPoint or mapPoint.
|
Fires when the mouse wheel is scrolled.
Arguments:
|
<Object> event
|
The returned object contains screenPoint, mapPoint, and Graphic.
|
Fires during the pan process.
Arguments:
|
<Extent> extent
|
The current extent of the map as the map is panning.
|
|
<Point> delta
|
The change in x,y values in screen units as the map is panning.
|
onPanEnd(extent, endPoint)
Fires when the pan is complete.
Arguments:
|
<Extent> extent
|
The current extent of the map as the map is panning.
|
|
<Point> endPoint
|
The ending point in screen units when panning stops.
|
onPanStart(extent, startPoint)
Fires when a user commences panning.
Arguments:
|
<Extent> extent
|
The current extent of the map as the map is panning.
|
|
<Point> startPoint
|
When using a mouse, the starting point in screen units where the mouse was clicked. If the keyboard is used, the starting point is 0,0.
|
Fires when the map DIV is repositioned.
Arguments:
|
<Number> x
|
X-coordinate in screen units.
|
|
<Number> y
|
Y-coordinate in screen units.
|
onResize(extent, height, width)
Fires when the Div containing the map has been resized.
Arguments:
|
<Extent> extent
|
The extent of the map.
|
|
<Number> height
|
The height of the map in pixels.
|
|
<Number> width
|
The width of the map in pixels.
|
Fires when the page is refreshed.
Arguments:
|
<Map> map
|
Specified the map to unload.
|
onZoom(extent, zoomFactor, anchor)
Fires during the zoom process.
Arguments:
|
<Extent> extent
|
Gets the extent during the zoom event.
|
|
<Number> zoomFactor
|
The scale factor represents the amount as a percentage that the map zoomed in or out from the previous extent. A value of 2 means the map was zoomed in twice as far as the previous extent. A value of 0.5 means the map zoomed out twice as far as previously.
|
|
<Point> anchor
|
The location of the mouse pointer. The Point x and y values are in screen units. This point acts as an anchor point, and this part of the map stays within the map region during the zoom process.
|
onZoomEnd(extent, zoomFactor, anchor, level)
Fires when the zoom is complete.
Arguments:
|
<Extent> extent
|
Gets the extent when the zoom event ends.
|
|
<Number> zoomFactor
|
The scale factor represents the amount as a percentage that the map zoomed in or out from the previous extent. A value of 2 means the map was zoomed in twice as far as the previous extent. A value of 0.5 means the map zoomed out twice as far as previously.
|
|
<Point> anchor
|
The location of the mouse pointer. The Point x and y values are in screen units. This point acts as an anchor point, and this part of the map stays within the map region during the zoom process.
|
|
<Number> level
|
Level of an ArcGISTiledMapServiceLayer after zoom is complete.
|
onZoomStart(extent, zoomFactor, anchor, level)
Fires when a user commences zooming.
Arguments:
|
<Extent> extent
|
Gets the extent when the zoom event starts.
|
|
<Number> zoomFactor
|
The scale factor represents the amount as a percentage that the map zoomed in or out from the previous extent. A value of 2 means the map was zoomed in twice as far as the previous extent. A value of 0.5 means the map zoomed out twice as far as previously.
|
|
<Point> anchor
|
The location of the mouse pointer. The Point x and y values are in screen units. This point acts as an anchor point, and this part of the map stays within the map region during the zoom process.
|
|
<Number> level
|
Level of an ArcGISTiledMapServiceLayer before the zoom commences.
|