Follow us on GitHub

com.google.gwt.maps.client
Class MapImpl

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.mvc.MVCObject<MapImpl>
          extended by com.google.gwt.maps.client.MapImpl

public class MapImpl
extends MVCObject<MapImpl>

Creates a new map inside of the given HTML container, which is typically a DIV element

See Map API Doc


Constructor Summary
protected MapImpl()
          Creates a new map inside of the given HTML container, which is typically a DIV element.
 
Method Summary
 HandlerRegistration addBoundsChangeHandler(BoundsChangeMapHandler handler)
          This event is fired when the viewport bounds have changed.
 HandlerRegistration addCenterChangeHandler(CenterChangeMapHandler handler)
          This event is fired when the map center property changes.
 HandlerRegistration addClickHandler(ClickMapHandler handler)
          This event is fired when the user clicks on the map (but not when they click on a marker or infowindow).
 HandlerRegistration addDblClickHandler(DblClickMapHandler handler)
          This event is fired when the user double-clicks on the map.
 HandlerRegistration addDragEndHandler(DragEndMapHandler handler)
          This event is fired when the user stops dragging the map.
 HandlerRegistration addDragHandler(DragMapHandler handler)
          This event is repeatedly fired while the user drags the map.
 HandlerRegistration addDragStartHandler(DragStartMapHandler handler)
          This event is fired when the user starts dragging the map.
 HandlerRegistration addHeadingChangeHandler(HeadingChangeMapHandler handler)
          This event is fired when the map heading property changes.
 HandlerRegistration addIdleHandler(IdleMapHandler handler)
          This event is fired when the map becomes idle after panning or zooming.
 HandlerRegistration addMapTypeIdChangeHandler(MapTypeIdChangeMapHandler handler)
          This event is fired when the mapTypeId property changes.
 HandlerRegistration addMouseMoveHandler(MouseMoveMapHandler handler)
          This event is fired whenever the user's mouse moves over the map container.
 HandlerRegistration addMouseOutMoveHandler(MouseOutMapHandler handler)
          This event is fired when the user's mouse exits the map container.
 HandlerRegistration addMouseOverHandler(MouseOverMapHandler handler)
          This event is fired when the user's mouse enters the map container.
 HandlerRegistration addProjectionChangeHandler(ProjectionChangeMapHandler handler)
          This event is fired when the projection has changed.
 HandlerRegistration addResizeHandler(ResizeMapHandler handler)
          Developers should trigger this event on the map when the div changes size: google.maps.event.trigger(map, 'resize') .
 HandlerRegistration addRightClickHandler(RightClickMapHandler handler)
          This event is fired when the DOM contextmenu event is fired on the map container.
 HandlerRegistration addTilesLoadedHandler(TilesLoadedMapHandler handler)
          This event is fired when the visible tiles have finished loading.
 HandlerRegistration addTiltChangeHandler(TiltChangeMapHandler handler)
          This event is fired when the map tilt property changes.
 HandlerRegistration addZoomChangeHandler(ZoomChangeMapHandler handler)
          This event is fired when the map zoom property changes.
 void fitBounds(LatLngBounds bounds)
          Sets the viewport to contain the given bounds.
 LatLngBounds getBounds()
          Returns the lat/lng bounds of the current viewport.
 LatLng getCenter()
          return map center in coordinates
 MVCArray<Element> getControls()
          TODO gets Additional controls to attach to the map.
 Element getDiv()
          Get map's containing element
 int getHeading()
          Returns the compass heading of aerial imagery.
 MapTypeId getMapTypeId()
          gets MapTypeId
 MapTypeRegistry getMapTypeRegistry()
          gets A registry of MapType instances by string ID.
 MVCArray<JavaScriptObject> getOverlayMapTypes()
          TODO gets Additional map types to overlay.
 Projection getProjection()
          Returns the current Projection.
 StreetViewPanoramaImpl getStreetView()
          Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView().
 int getTilt()
          gets Returns the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane.
 int getZoom()
          get zoom
static MapImpl newInstance(Element element, MapOptions options)
          Creates a new map inside of the given HTML container, which is typically a DIV element.
 void panBy(int x, int y)
          Changes the center of the map by the given distance in pixels.
 void panTo(LatLng latLng)
          Changes the center of the map to the given LatLng.
 void panToBounds(LatLngBounds latLngBounds)
          Pans the map by the minimum amount necessary to contain the given LatLngBounds.
 void setCenter(LatLng latlng)
          set center
 void setControls(ControlPosition controlPosition, Element element)
          sets Additional controls to attach to the map.
 void setControls(MVCArray<Element> controls)
          TODO sets Additional controls to attach to the map.
 void setCustomMapType(String mapTypeId, StyledMapType styledType)
          Set the custom map type into the map's registry
 void setHeading(int heading)
          Sets the compass heading for aerial imagery measured in degrees from cardinal direction North.
 void setMapTypeId(MapTypeId mapTypeId)
          set MapTypeId
 void setMapTypesRegistry(MapTypeRegistry mapTypes)
          TODO sets A registry of MapType instances by string ID.
 void setOptions(MapOptions options)
          set MapOptions
 void setOverlayMapTypes(MVCArray<JavaScriptObject> overlayMapTypes)
          TODO sets Additional map types to overlay.
 void setStreetView(StreetViewPanoramaImpl panorama)
          Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane.
 void setTilt(int tilt)
          Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane.
 void setZoom(int zoom)
          sets map zoom
 
Methods inherited from class com.google.gwt.maps.client.mvc.MVCObject
bindTo, bindTo, bindTo, changed, createInstanceOfMVCObject, get, notify, set, setValues, unbind, unbindAll
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapImpl

protected MapImpl()
Creates a new map inside of the given HTML container, which is typically a DIV element.

Method Detail

newInstance

public static final MapImpl newInstance(Element element,
                                        MapOptions options)
Creates a new map inside of the given HTML container, which is typically a DIV element.

Parameters:
element - - map dom element container, like a div
options - - MapOptions
Returns:
MapImpl

fitBounds

public final void fitBounds(LatLngBounds bounds)
Sets the viewport to contain the given bounds.

Parameters:
bounds - LatLngBounds

getBounds

public final LatLngBounds getBounds()
Returns the lat/lng bounds of the current viewport. If the map is not yet initialized (i.e. the mapType is still null), or center and zoom have not been set then the result is null or undefined.

Returns:
LatLngBounds

getCenter

public final LatLng getCenter()
return map center in coordinates


getDiv

public final Element getDiv()
Get map's containing element


getHeading

public final int getHeading()
Returns the compass heading of aerial imagery. The heading value is measured in degrees (clockwise) from cardinal direction North.

Returns:
int

getMapTypeId

public final MapTypeId getMapTypeId()
gets MapTypeId

Returns:
MapTypeId

getProjection

public final Projection getProjection()
Returns the current Projection. If the map is not yet initialized (i.e. the mapType is still null) then the result is null. Listen to projection_changed and check its value to ensure it is not null.

Returns:
Projection

getStreetView

public final StreetViewPanoramaImpl getStreetView()
Returns the default StreetViewPanorama bound to the map, which may be a default panorama embedded within the map, or the panorama set using setStreetView(). Changes to the map's streetViewControl will be reflected in the display of such a bound panorama.

Returns:
StreetViewPanoramaImpl

getTilt

public final int getTilt()
gets Returns the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. A value of 0 indicates no angle of incidence (no tilt) while 45° imagery will return a value of 45.


getZoom

public final int getZoom()
get zoom


panBy

public final void panBy(int x,
                        int y)
Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values).

Parameters:
x -
y -

panTo

public final void panTo(LatLng latLng)
Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.

Parameters:
latLng -

panToBounds

public final void panToBounds(LatLngBounds latLngBounds)
Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that as much of the bounds as possible will be visible. The bounds will be positioned inside the area bounded by the map type and navigation (pan, zoom, and Street View) controls, if they are present on the map. If the bounds is larger than the map, the map will be shifted to include the northwest corner of the bounds. If the change in the map's position is less than both the width and height of the map, the transition will be smoothly animated.

Parameters:
latLngBounds -

setCenter

public final void setCenter(LatLng latlng)
set center

Parameters:
latlng -

setHeading

public final void setHeading(int heading)
Sets the compass heading for aerial imagery measured in degrees from cardinal direction North.

Parameters:
heading -

setMapTypeId

public final void setMapTypeId(MapTypeId mapTypeId)
set MapTypeId

Parameters:
mapTypeId -

setOptions

public final void setOptions(MapOptions options)
set MapOptions

Parameters:
options -

setStreetView

public final void setStreetView(StreetViewPanoramaImpl panorama)
Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45 indicating a tilt of 45°.

Parameters:
panorama -

setTilt

public final void setTilt(int tilt)
Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBRID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45 indicating a tilt of 45°.

Parameters:
tilt -

setZoom

public final void setZoom(int zoom)
sets map zoom

Parameters:
zoom -

setControls

public final void setControls(MVCArray<Element> controls)
TODO sets Additional controls to attach to the map. To add a control to the map, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered.

Parameters:
controls -

setControls

public final void setControls(ControlPosition controlPosition,
                              Element element)
sets Additional controls to attach to the map. To add a control to the map, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered.

Parameters:
controlPosition -
element -

getControls

public final MVCArray<Element> getControls()
TODO gets Additional controls to attach to the map. To add a control to the map, add the control's <div> to the MVCArray corresponding to the ControlPosition where it should be rendered.


setMapTypesRegistry

public final void setMapTypesRegistry(MapTypeRegistry mapTypes)
TODO sets A registry of MapType instances by string ID.

Parameters:
mapTypes -

setCustomMapType

public final void setCustomMapType(String mapTypeId,
                                   StyledMapType styledType)
Set the custom map type into the map's registry

Parameters:
mapTypeId -
styledType -

getMapTypeRegistry

public final MapTypeRegistry getMapTypeRegistry()
gets A registry of MapType instances by string ID.


setOverlayMapTypes

public final void setOverlayMapTypes(MVCArray<JavaScriptObject> overlayMapTypes)
TODO sets Additional map types to overlay.

Parameters:
overlayMapTypes -

getOverlayMapTypes

public final MVCArray<JavaScriptObject> getOverlayMapTypes()
TODO gets Additional map types to overlay.


addBoundsChangeHandler

public final HandlerRegistration addBoundsChangeHandler(BoundsChangeMapHandler handler)
This event is fired when the viewport bounds have changed.

Parameters:
handler - BoundsChangeMapHandler
Returns:
MapHandlerRegistration

addCenterChangeHandler

public final HandlerRegistration addCenterChangeHandler(CenterChangeMapHandler handler)
This event is fired when the map center property changes.

Parameters:
handler - CenterChangeMapHandler
Returns:
MapHandlerRegistration

addClickHandler

public final HandlerRegistration addClickHandler(ClickMapHandler handler)
This event is fired when the user clicks on the map (but not when they click on a marker or infowindow).

Parameters:
handler - ClickMapHandler
Returns:
MapHandlerRegistration

addDblClickHandler

public final HandlerRegistration addDblClickHandler(DblClickMapHandler handler)
This event is fired when the user double-clicks on the map. Note that the click event will also fire, right before this one.

Parameters:
handler - DblClickMapHandler
Returns:
MapHandlerRegistration

addDragHandler

public final HandlerRegistration addDragHandler(DragMapHandler handler)
This event is repeatedly fired while the user drags the map.

Parameters:
handler - DragMapHandler
Returns:
MapHandlerRegistration

addDragEndHandler

public final HandlerRegistration addDragEndHandler(DragEndMapHandler handler)
This event is fired when the user stops dragging the map.

Parameters:
handler - DragEndMapHandler
Returns:
MapHandlerRegistration

addDragStartHandler

public final HandlerRegistration addDragStartHandler(DragStartMapHandler handler)
This event is fired when the user starts dragging the map.

Parameters:
handler - DragStartMapHandler
Returns:
MapHandlerRegistration

addHeadingChangeHandler

public final HandlerRegistration addHeadingChangeHandler(HeadingChangeMapHandler handler)
This event is fired when the map heading property changes.

Parameters:
handler - HeadingChangeMapHandler
Returns:
MapHandlerRegistration

addIdleHandler

public final HandlerRegistration addIdleHandler(IdleMapHandler handler)
This event is fired when the map becomes idle after panning or zooming.

Parameters:
handler - IdleMapHandler
Returns:
MapHandlerRegistration

addMapTypeIdChangeHandler

public final HandlerRegistration addMapTypeIdChangeHandler(MapTypeIdChangeMapHandler handler)
This event is fired when the mapTypeId property changes.

Parameters:
handler - MapTypeIdChangeMapHandler
Returns:
MapHandlerRegistration

addMouseMoveHandler

public final HandlerRegistration addMouseMoveHandler(MouseMoveMapHandler handler)
This event is fired whenever the user's mouse moves over the map container.

Parameters:
handler - MouseMoveMapHandler
Returns:
MapHandlerRegistration

addMouseOutMoveHandler

public final HandlerRegistration addMouseOutMoveHandler(MouseOutMapHandler handler)
This event is fired when the user's mouse exits the map container.

Parameters:
handler - MouseOutMapHandler
Returns:
MapHandlerRegistration

addMouseOverHandler

public final HandlerRegistration addMouseOverHandler(MouseOverMapHandler handler)
This event is fired when the user's mouse enters the map container.

Parameters:
handler - MouseOverMapHandler
Returns:
MapHandlerRegistration

addProjectionChangeHandler

public final HandlerRegistration addProjectionChangeHandler(ProjectionChangeMapHandler handler)
This event is fired when the projection has changed.

Parameters:
handler - ProjectionChangeMapHandler
Returns:
MapHandlerRegistration

addResizeHandler

public final HandlerRegistration addResizeHandler(ResizeMapHandler handler)
Developers should trigger this event on the map when the div changes size: google.maps.event.trigger(map, 'resize') .

Parameters:
handler - ResizeMapHandler
Returns:
MapHandlerRegistration

addRightClickHandler

public final HandlerRegistration addRightClickHandler(RightClickMapHandler handler)
This event is fired when the DOM contextmenu event is fired on the map container.

Parameters:
handler - RightClickMapHandler
Returns:
MapHandlerRegistration

addTilesLoadedHandler

public final HandlerRegistration addTilesLoadedHandler(TilesLoadedMapHandler handler)
This event is fired when the visible tiles have finished loading.

Parameters:
handler - TilesLoadedMapHandler
Returns:
MapHandlerRegistration

addTiltChangeHandler

public final HandlerRegistration addTiltChangeHandler(TiltChangeMapHandler handler)
This event is fired when the map tilt property changes.

Parameters:
handler - TiltChangeMapHandler
Returns:
MapHandlerRegistration

addZoomChangeHandler

public final HandlerRegistration addZoomChangeHandler(ZoomChangeMapHandler handler)
This event is fired when the map zoom property changes.

Parameters:
handler - ZoomChangeMapHandler
Returns:
MapHandlerRegistration


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.