public class MapWidget
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MapWidget.BaseMap |
static class |
MapWidget.Options |
Constructor and Description |
---|
MapWidget(com.google.gwt.user.client.ui.SimplePanel mapPanel,
MapLoadHandler onLoad)
Creates a new map.
|
MapWidget(com.google.gwt.user.client.ui.SimplePanel mapPanel,
MapLoadHandler onLoad,
MapWidget.Options options)
Creates a new Map.
|
Modifier and Type | Method and Description |
---|---|
void |
addClickHandler(ClickHandler handler)
Add handler for when map is clicked.
|
void |
addControl(Control control)
Add new control to the Control Layer.
|
void |
addDblClickHandler(DblClickHandler handler)
Add handler for when maps is double clicked
|
void |
addExtentChangeHandler(MapExtentChangeHandler handler)
Add Handler to listen to maps onResize Event
Fires when the extent of the map has changed.
|
void |
addInfoWindow(com.google.gwt.user.client.ui.Widget panel) |
void |
addKeyDownHandler(MapKeyDownHandler handler) |
void |
addKeyUpHandler(MapKeyUpHandler handler) |
Layer |
addLayer(Layer layer)
Adds an ESRI Layer to the map.
|
Layer |
addLayer(Layer layer,
int index)
Adds an ESRI Layer to the map.
|
void |
addLayerAddHandler(MapLayerAddHandler handler) |
void |
addLayerAddResultHandler(MapLayerAddResultHandler handler) |
void |
addLayerRemoveHandler(MapLayerRemoveHandler handler) |
void |
addLayerReorderHandler(MapLayerReorderHandler handler) |
void |
addLayers(Layer[] layers)
Adds multiple layers to a map.
|
void |
addLayersAddResultHandler(MapLayersAddResultHandler handler) |
void |
addLayersRemovedHandler(MapLayersRemovedHandler handler) |
void |
addLayersReorderedHandler(MapLayersReorderedHandler handler)
Fires when all the layers have been reordered.
|
void |
addLoadHandler(MapLoadHandler handler)
Add Handler to listen to maps onLoad Event
|
void |
addMouseDownHandler(MouseDownHandler handler) |
void |
addMouseDragEndHandler(MapMouseDragEndHandler handler) |
void |
addMouseDragHandler(MapMouseDragHandler handler) |
void |
addMouseDragStartHandler(MapMouseDragStartHandler handler) |
void |
addMouseMoveHandler(MouseMoveHandler handler) |
void |
addMouseOutHandler(MouseOutHandler handler) |
void |
addMouseOverHandler(MouseOverHandler handler) |
void |
addMouseUpHandler(MouseUpHandler handler) |
void |
addMouseWheelHandler(MouseWheelHandler handler) |
void |
addPanEndHandler(MapPanEndHandler handler) |
void |
addPanHandler(MapPanHandler handler)
Add Handler to listen to maps onPan Event
|
void |
addPanStartHandler(MapPanStartHandler handler) |
void |
addRepositionHandler(MapRepositionHandler handler) |
void |
addResizeHandler(MapResizeHandler handler)
Add Handler to listen to maps onResize Event
|
void |
addTimeExtentChange(TimeExtentChangeHandler handler) |
void |
addUnloadHandler(MapUnloadHandler handler)
Add Handler to listen to maps onUnload Event
|
void |
addUpdateEndHandler(UpdateEndHandler handler) |
void |
addUpdateStartHandler(UpdateStartHandler handler) |
void |
addZoomEndHandler(MapZoomEndHandler handler) |
void |
addZoomHandler(MapZoomHandler handler) |
void |
addZoomStartHandler(MapZoomStartHandler handler) |
static boolean |
assertLoaded()
Make sure the $wnd.esri library has been loaded.
|
void |
centerAndZoom(Point center,
double levelOrFactor)
Centers and zooms the map.
|
void |
centerAt(Point center)
Recenters the map based on map coordinates as the center point.
|
void |
destroy()
Destroys the map instance.
|
void |
disableClickRecenter()
Disallows clicking on a map to recenter it.
|
void |
disableDoubleClickZoom()
Disallows double clicking on a map to zoom in a level and recenter the map.
|
void |
disableKeyboardNavigation()
Disallows panning and zooming using the keyboard.
|
void |
disableMapNavigation()
Disallows all map navigation except the slider and pan arrows.
|
void |
disablePan()
Disallows panning a map using the mouse.
|
void |
disableRubberBandZoom()
Disallows zooming in or out on a map using a bounding box.
|
void |
disableScrollWheelZoom()
Disallows zooming in or out on a map using the mouse scroll wheel.
|
void |
disableShiftDoubleClickZoom()
Disallows shift double clicking on a map to zoom in a level and recenter the map.
|
void |
disableSnapping()
Disables snapping on the map.
|
void |
enableClickRecenter()
Permits users to click on a map to recenter it.
|
void |
enableDoubleClickZoom()
Permits users to double click on a map to zoom in a level and recenter the map
|
void |
enableKeyboardNavigation()
Permits users to pan and zoom using the keyboard.
|
void |
enableMapNavigation()
Allows all map navigation.
|
void |
enablePan()
Permits users to pan a map using the mouse.
|
void |
enableRubberBandZoom()
Permits users to zoom in or out on a map using a bounding box.
|
void |
enableScrollWheelZoom()
Permits users to zoom in or out on a map using the mouse scroll wheel.
|
void |
enableShiftDoubleClickZoom()
Permits users to shift double click on a map to zoom in a level and recenter the map.
|
SnappingManager |
enableSnapping()
Enable snapping on the map when working with the Editor, Measurement widget or the Draw and
Edit toolbars.
|
SnappingManager |
enableSnapping(SnappingManager.SnappingOptions options)
Enable snapping on the map when working with the Editor, Measurement widget or the Draw and Edit
toolbars.
|
Extent |
getExtent()
The current extent of the map in map units.
|
GraphicsLayer |
getGraphics()
Add and remove graphics from the GraphicsLayer.
|
com.google.gwt.core.client.JsArrayString |
getGraphicsLayerIds()
An array of the current GraphicsLayers in the map.
|
int |
getHeight()
Current height of the map in screen pixels.
|
java.lang.String |
getId()
Reference to HTML DIV or other element where the map is placed
on the page.
|
InfoWindow |
getInfoWindow()
Displays the InfoWindow on a map.
|
java.lang.String |
getInfoWindowAnchor(Point screenCoords)
Sets an InfoWindow's anchor when calling InfoWindow.show
|
Layer |
getLayer(java.lang.String id)
Returns an individual layer of a map.
|
com.google.gwt.core.client.JsArrayString |
getLayerIds()
Array of current TiledMapServiceLayers and DynamicMapServiceLayers
added to the map.
|
float |
getLevel()
Gets the current level of detail ID for the map.
|
com.google.gwt.core.client.JavaScriptObject |
getMapObject()
Return the actual ersi.map object that has been created
|
com.google.gwt.user.client.ui.SimplePanel |
getMapPanel() |
java.lang.String |
getNavigationMode()
Indicates whether the map uses CSS3 transformations when panning and zooming.
|
Point |
getPosition()
This point geometry in screen coordinates represent the top-left corner
of the map container.
|
com.google.gwt.dom.client.Element |
getRoot()
The DOM node that contains the container of layers, build-in info window, logo and slider.
|
SnappingManager |
getSnappingManager()
If snapping is enabled on the map using map.enableSnapping() this property provides access to the
SnappingManager.
|
SpatialReference |
getSpatialReference()
The spatial reference of the map.
|
TimeExtent |
getTimeExtent()
The current TimeExtent for the map.
|
int |
getWidth()
Current width of the map in screen pixels.
|
void |
hidePanArrows()
Hides the pan arrows from the map.
|
void |
hideZoomSlider()
Hides the zoom slider from the map.
|
boolean |
isClickRecenter()
When true, the key sequence of shift then click to recenter the map is enabled.
|
boolean |
isDoubleClickZoom()
When true, double click zoom is enabled.
|
boolean |
isFadeOnZoom()
Indicates if the fade effect is enabled while zooming.
|
boolean |
isForce3DTransforms()
When the mapNavigation mode is set to 'css-transforms', CSS3 transforms will be used for map navigation when supported
by the browser.
|
boolean |
isKeyboardNavigation()
When true, double click zoom is enabled.
|
boolean |
isLoaded()
After the first layer is loaded, the value is set to true.
|
boolean |
isPan()
When true, map panning is enabled using the mouse.
|
boolean |
isPanArrows()
When true, pan arrows are displayed around the edge of the map.
|
boolean |
isRubberBandZoom()
When true, rubberband zoom is enabled.
|
boolean |
isScrollWheelZoom()
When true, the mouse scroll wheel zoom is enabled.
|
boolean |
isShiftDoubleClickZoom()
When true, shift double click zoom is enabled.
|
boolean |
isZoomSlider()
When true, the zoom slider is displayed on the map.
|
void |
panDown()
Pans the map south.
|
void |
panLeft()
Pans the map west.
|
void |
panLowerLeft()
Pans the map southwest.
|
void |
panLowerRight()
Pans the map southeast.
|
void |
panRight()
Pans the map east.
|
void |
panUp()
Pans the map north.
|
void |
panUpperLeft()
Pans the map northwest.
|
void |
panUpperRight()
Pans the map northeast.
|
void |
removeAllLayers()
Removes all layers from the map.
|
void |
removeControl(Control control)
Remove control from the Control Layer.
|
void |
removeLayer(Layer layer)
Removes the specified layer from the map.
|
void |
reorderLayer(Layer layer,
int index)
Changes the layer order in the map.
|
void |
reposition()
Repositions the map DIV on the page.
|
void |
resize()
Resizes the map DIV.
|
void |
setExtent(Extent extent)
Sets the extent of the map.
|
void |
setExtent(Extent extent,
boolean fit)
Sets the extent of the map.
|
void |
setHeight(java.lang.String height)
Updates the MapWidget's height.
|
void |
setLevel(int level)
Sets the map to the specified level ID.
|
void |
setMapCursor(java.lang.String cursor)
Sets the default cursor for the map.
|
void |
setSize(java.lang.String width,
java.lang.String height)
Updates the MapWidget's size.
|
void |
setTimeExtent(TimeExtent timeExtent)
Sets the TimeExtent for the map.
|
void |
setTimeSlider(TimeSlider timeSlider)
Set the time slider associated with the map.
|
void |
setWidth(java.lang.String width)
Updates the MapWidget's width.
|
void |
showPanArrows()
Shows the pan arrows on the map.
|
void |
showZoomSlider()
Shows the zoom slider on the map.
|
Point |
toMap(Point screenPoint)
Converts a single screen point or an array of screen points to map coordinates.
|
Point |
toScreen(Point mapPoint)
Converts a single map point or an array of map points to screen coordinates.
|
public MapWidget(com.google.gwt.user.client.ui.SimplePanel mapPanel, MapLoadHandler onLoad)
initializationLayer
- - Layer map will be initialized to. After the map is added to the dom, this will be
the first layer added to the map. Once the map is initialized the onLoad handler will be called. Can be null.onLoad
- - This is the map load handler to be fired once the map as been added to the dom and the
first layer has been initialized. Can be null.public MapWidget(com.google.gwt.user.client.ui.SimplePanel mapPanel, MapLoadHandler onLoad, MapWidget.Options options)
initializationLayer
- - Layer map will be initialized to. After the map is added to the dom, this will be
the first layer added to the map. Once the map is initialized the onLoad handler will be called.onLoad
- - This is the map load handler to be fired once the map as been added to the dom and the
first layer has been initialized. Can be null.options
- - Optional parameters for the map.public void addControl(Control control)
control
- - Control to be added to the mappublic void removeControl(Control control)
control
- - Control to be removedpublic static final boolean assertLoaded()
public com.google.gwt.core.client.JavaScriptObject getMapObject()
public com.google.gwt.user.client.ui.SimplePanel getMapPanel()
public void setSize(java.lang.String width, java.lang.String height)
width
- - width MapWidget should be set toheight
- - height MapWidget should be set topublic void setWidth(java.lang.String width)
width
- - width MapWidget should be set topublic void setHeight(java.lang.String height)
height
- - height MapWidget should be set topublic void addInfoWindow(com.google.gwt.user.client.ui.Widget panel)
public Extent getExtent()
public boolean isFadeOnZoom()
public boolean isForce3DTransforms()
public GraphicsLayer getGraphics()
public com.google.gwt.core.client.JsArrayString getGraphicsLayerIds()
public int getHeight()
public java.lang.String getId()
public InfoWindow getInfoWindow()
public boolean isClickRecenter()
public boolean isDoubleClickZoom()
public boolean isKeyboardNavigation()
public boolean isPan()
public boolean isPanArrows()
public boolean isRubberBandZoom()
public boolean isScrollWheelZoom()
public boolean isShiftDoubleClickZoom()
public boolean isZoomSlider()
public com.google.gwt.core.client.JsArrayString getLayerIds()
public boolean isLoaded()
public java.lang.String getNavigationMode()
public Point getPosition()
public com.google.gwt.dom.client.Element getRoot()
public SnappingManager getSnappingManager()
public SpatialReference getSpatialReference()
public TimeExtent getTimeExtent()
public int getWidth()
public Layer addLayer(Layer layer, int index)
layer
- - Layer to be added to the map.index
- - A layer can be added at a specific index in the map.public Layer addLayer(Layer layer)
layer
- - Layer to be added to the map.public void addLayers(Layer[] layers)
layers
- - Layers to be added to the map.public void centerAndZoom(Point center, double levelOrFactor)
center
- - Centers the map on the specified x,y location.levelOrFactor
- - 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.public void centerAt(Point center)
center
- - Centers the map on the specified x,y location.public void destroy()
public void disableClickRecenter()
public void disableDoubleClickZoom()
public void disableKeyboardNavigation()
public void disableMapNavigation()
public void disablePan()
public void disableRubberBandZoom()
public void disableScrollWheelZoom()
public void disableShiftDoubleClickZoom()
public void disableSnapping()
public void enableClickRecenter()
public void enableDoubleClickZoom()
public void enableKeyboardNavigation()
public void enableMapNavigation()
public void enablePan()
public void enableRubberBandZoom()
public void enableScrollWheelZoom()
public void enableShiftDoubleClickZoom()
public SnappingManager enableSnapping()
public SnappingManager enableSnapping(SnappingManager.SnappingOptions options)
options
- - optional parameterspublic java.lang.String getInfoWindowAnchor(Point screenCoords)
screenCoords
- - The anchor point in screen units.public Layer getLayer(java.lang.String id)
id
- - ID assigned to the layer.public float getLevel()
public void hidePanArrows()
public void hideZoomSlider()
public void panDown()
public void panLeft()
public void panLowerLeft()
public void panLowerRight()
public void panRight()
public void panUp()
public void panUpperLeft()
public void panUpperRight()
public void removeAllLayers()
public void removeLayer(Layer layer)
layer
- - Layer to be removed from the map.public void reorderLayer(Layer layer, int index)
layer
- - The layer to be moved.index
- - Refers to the location for placing the layer. The bottom
most layer has an index of 0.public void reposition()
public void resize()
public void setExtent(Extent extent, boolean fit)
extent
- - Sets the minx, miny, maxx, and maxy for a map.fit
- - When true, for maps that contain tiled map service layers, you are guaranteed
to have the input extent shown completely on the map.public void setExtent(Extent extent)
extent
- - Sets the minx, miny, maxx, and maxy for a map.public void setLevel(int level)
level
- - The level ID.public void setMapCursor(java.lang.String cursor)
cursor
- - A standard CSS cursor value. Some common values include "default",
"pointer", "crosshair", "text", "help", and "wait".public void setTimeExtent(TimeExtent timeExtent)
timeExtent
- - Set the time extent for which data is displayed on the map.public void setTimeSlider(TimeSlider timeSlider)
timeSlider
- - The time slider dijit to associate with the map.public void showPanArrows()
public void showZoomSlider()
public final Point toMap(Point screenPoint)
screenPoint
- - Converts screen coordinates to map coordinates.public final Point toScreen(Point mapPoint)
mapPoint
- - Converts map coordinates to screen coordinates.public void addClickHandler(ClickHandler handler)
handler
- - 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.public void addDblClickHandler(DblClickHandler handler)
handler
- - 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.public void addExtentChangeHandler(MapExtentChangeHandler handler)
handler
- public void addKeyDownHandler(MapKeyDownHandler handler)
handler
- - Fires when a keyboard key is pressed.public void addKeyUpHandler(MapKeyUpHandler handler)
handler
- - Fires when a keyboard key is released.public void addLayerAddHandler(MapLayerAddHandler handler)
handler
- - Fires any time a layer is added to the map.public void addLayerAddResultHandler(MapLayerAddResultHandler handler)
handler
- - Fires after specified layer has been added to the map.public void addLayerRemoveHandler(MapLayerRemoveHandler handler)
handler
- - Fires after the layer has been removed.public void addLayerReorderHandler(MapLayerReorderHandler handler)
handler
- - Fires when the map layer order has been changed.public void addLayersAddResultHandler(MapLayersAddResultHandler handler)
handler
- - Fires after all layers are added to the map.public void addLayersRemovedHandler(MapLayersRemovedHandler handler)
handler
- - Fires after all the layers have been removed.public void addLayersReorderedHandler(MapLayersReorderedHandler handler)
handler
- public void addLoadHandler(MapLoadHandler handler)
handler
- - Fires when the first or base layer has been successfully added to the map.public void addMouseDownHandler(MouseDownHandler handler)
handler
- - Fires when a mouse button is pressed down and the mouse cursor is in the map region of the HTML page.public void addMouseDragHandler(MapMouseDragHandler handler)
handler
- - Fires while the mouse is being dragged until the mouse button is released.public void addMouseDragEndHandler(MapMouseDragEndHandler handler)
handler
- - Fires when a mouse button is released and the user stops dragging the mouse.public void addMouseDragStartHandler(MapMouseDragStartHandler handler)
handler
- - Fires when a mouse button is pressed down and the user starts to drag the mouse.public void addMouseMoveHandler(MouseMoveHandler handler)
handler
- - 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.public void addMouseOutHandler(MouseOutHandler handler)
handler
- - Fires when the mouse moves out of the map region of the HTML page.public void addMouseOverHandler(MouseOverHandler handler)
handler
- - Fires when the mouse moves into the map region of the HTML page.public void addMouseUpHandler(MouseUpHandler handler)
handler
- - Fires when the mouse button is released and the mouse pointer is within the map region of the HTML page.public void addMouseWheelHandler(MouseWheelHandler handler)
handler
- - Fires when the mouse wheel is scrolled.public void addPanHandler(MapPanHandler handler)
handler
- - Fires during the pan process.public void addPanEndHandler(MapPanEndHandler handler)
handler
- - Fires when the pan is complete.public void addPanStartHandler(MapPanStartHandler handler)
handler
- - Fires when a user commences panning.public void addRepositionHandler(MapRepositionHandler handler)
handler
- - Fires when the map DIV is repositioned.public void addResizeHandler(MapResizeHandler handler)
handler
- - Fires when the Div containing the map has been resized.public void addTimeExtentChange(TimeExtentChangeHandler handler)
handler
- - Fires when the map's timeExtent property is set.public void addUnloadHandler(MapUnloadHandler handler)
handler
- - Fires when the page is refreshed.public void addZoomHandler(MapZoomHandler handler)
handler
- - Fires during the zoom process.public void addUpdateEndHandler(UpdateEndHandler handler)
handler
- - Fires after layers that are updating their content have completed. This event is often used in combination
with onUpdateStart to display a "Map is busy" or "Loading? " message as visual feedback to the end-user. (As of v2.2)public void addUpdateStartHandler(UpdateStartHandler handler)
handler
- - Fires when one or more layers being updating their content. This event is often used in combination with onUpdateEnd
to display a "Map is busy" or "Loading? " message as visual feedback to the end-user. (As of v2.2)public void addZoomEndHandler(MapZoomEndHandler handler)
handler
- - Fires when the zoom is complete.public void addZoomStartHandler(MapZoomStartHandler handler)
handler
- - Fires when a user commences zooming.