Packagecom.google.maps.interfaces
Interfacepublic interface IMap extends IWrappableEventDispatcher, flash.events.IEventDispatcher, IWrappable
ImplementorsMap, MapType

IMap is the interface implemented by Map. Create an instance of class Map to create a map. This is the central class in the API.



Public Properties
 PropertyDefined by
 InheritedinterfaceChain : Array
List of interfaces for wrapping this object.
IWrappable
  MERCATOR_PROJECTION : IProjection
[read-only] Retrieves Mercator projection.
IMap
  overlayRaising : Boolean
Set to true to enable raising of overlays upon mouse-over.
IMap
 Inheritedwrapper : Object
Instance of the cross-domain wrapper for this object.
IWrappable
Public Methods
 MethodDefined by
  
addControl(control:IControl):void
Registers a new control.
IMap
  
addMapType(newMapType:IMapType):void
Registers a new map type.
IMap
  
addOverlay(overlay:IOverlay):void
Adds an overlay to the map.
IMap
  
Removes all controls from the map.
IMap
  
Removes all overlays from the map.
IMap
  
closeInfoWindow():Boolean
Closes the information window.
IMap
  
Checks whether continuous zoom is enabled.
IMap
  
Checks whether control by keyboard is enabled.
IMap
  
Checks whether center crosshairs are enabled.
IMap
  
Disables continuous smooth zooming.
IMap
  
Disables control by keyboard.
IMap
  
Disables the center crosshairs.
IMap
  
Disables dragging of the map.
IMap
  
Disables zooming using a mouse's scroll wheel.
IMap
  
draggingEnabled():Boolean
Checks whether dragging of the map is enabled.
IMap
  
Enables continuous smooth zooming.
IMap
  
Enables control by keyboard.
IMap
  
Enables the center crosshairs.
IMap
  
Enables dragging of the map.
IMap
  
Enables zooming using a mouse's scroll wheel.
IMap
  
fromLatLngToPoint(latLng:LatLng, opt_zoom:Number):Point
Returns x,y coordinates of specified lat, lng and zoom relative to the origin of the map's projection (the origin is the top left corner of the top left tile of the map for the specified map zoom level).
IMap
  
fromLatLngToViewport(latLng:LatLng, opt_disablewrap:Boolean = false):Point
Returns the pixel coordinates for the specified latLng location in the coordinate system of the map's view port ([0,0] being the top left corner of the map object).
IMap
  
fromPointToLatLng(pos:Point, opt_zoom:Number, opt_nowrap:Boolean = false):LatLng
Returns lat,lng coordinates of specified x, y and zoom.
IMap
  
fromViewportToLatLng(pos:Point, opt_nowrap:Boolean = false):LatLng
Returns the lat-lng of the point at the given coordinates in the map's view port (the top left corner of the map object).
IMap
 Inherited
Retrieves the base event dispatcher object that allows access to event dispatching capability for cross-domain objects.
IWrappableEventDispatcher
  
Returns the highest resolution zoom level at which the given rectangular region fits in the map view.
IMap
  
Retrieves coordinates of the center in the map view control.
IMap
  
Retrieves the current map type.
IMap
  
getDisplayObject():DisplayObject
Retrieves the display object that represents the map.
IMap
  
Get the mouse double click mode.
IMap
  
Gets the version of the implementation library SWF.
IMap
  
Returns the the visible rectangular region of the map view in geographical coordinates.
IMap
  
getMapTypes():Array
Retrieves the list of the map types available for the location.
IMap
  
getMaxZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number
Retrieves the maximum zoom level.
IMap
  
getMinZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number
Retrieves the minimum zoom level.
IMap
  
Retrieves the full set of options used by the map.
IMap
  
Retrieves the pane manager for the map.
IMap
  
Returns the projection being applied to the map.
IMap
  
getSize():Point
Retrieves the map view size.
IMap
  
getZoom():Number
Retrieves the map zoom level.
IMap
  
isLoaded():Boolean
Checks whether the map has been initialized.
IMap
  
Opens a simple information window at the given point.
IMap
  
panBy(distance:Point):void
Starts a pan animation by the given distance in pixels.
IMap
  
panTo(latLng:LatLng):void
Pans the map to the specified centre location.
IMap
  
removeControl(control:IControl):void
Removes a control from the map.
IMap
  
removeMapType(oldMapType:IMapType):void
Removes a registered map type.
IMap
  
removeOverlay(overlay:IOverlay):void
Removes an overlay from the map.
IMap
  
Returns map to the saved position.
IMap
  
savePosition():void
Stores the current map position and zoom level for later recall by returnToSavedPosition.
IMap
  
Checks whether scroll wheel zooming is enabled.
IMap
  
setCenter(latLng:LatLng, opt_zoom:Number, opt_mapType:IMapType = null):void
Changes the centre point of the map.
IMap
  
setDoubleClickMode(val:Number):void
Set the mouse double click mode.
IMap
  
setMapType(mapType:IMapType):void
Changes the map type for the map.
IMap
  
setSize(newSize:Point):void
Sets the size of the map view.
IMap
  
setZoom(level:Number, opt_doContinuousZoom:Boolean = false):void
Changes the zoom level for the map view control.
IMap
  
unload():void
Removes the map from its parent and attempts to unload it to free up memory associated with the map.
IMap
  
zoomIn(opt_latlng:LatLng = null, opt_doCenter:Boolean = false, opt_doContinuousZoom:Boolean = false):void
Zooms in the map by one zoom level if possible.
IMap
  
zoomOut(opt_latlng:LatLng = null, opt_doContinuousZoom:Boolean = false):void
Zooms out the map by one zoom level if possible.
IMap
Property detail
MERCATOR_PROJECTIONproperty
MERCATOR_PROJECTION:IProjection  [read-only]

Retrieves Mercator projection.

Implementation
    public function get MERCATOR_PROJECTION():IProjection
overlayRaisingproperty 
overlayRaising:Boolean  [read-write]

Set to true to enable raising of overlays upon mouse-over. If enabled then a mouse-over event over an overlay that supports it (only markers do at present) will bring that overlay to the top. By default overlay raising is enabled.

Implementation
    public function get overlayRaising():Boolean
    public function set overlayRaising(value:Boolean):void
Method detail
addControl()method
public function addControl(control:IControl):void

Registers a new control. This can be called before the MAP_READY event has been received.

Parameters
control:IControl — New control to register.

Example
   public class MyMap extends Map {
     public function MyMap() {
       super();
       addEventListener(MapEvent.MAP_READY, onMapReady);
       addControl(new MapTypeControl());
     }
   }

addMapType()method 
public function addMapType(newMapType:IMapType):void

Registers a new map type.

Parameters
newMapType:IMapType — New map type to register.
addOverlay()method 
public function addOverlay(overlay:IOverlay):void

Adds an overlay to the map.

Parameters
overlay:IOverlay — The overlay to be added to the map.

Example
   var marker:Marker = new Marker(
       new LatLng(48.858842, 2.346997),
       new MarkerOptions({ fillRGB: 0x004000,
                           name: "Paris, France",
                           description: "City on the Seine" }));
   map.addOverlay(marker);

clearControls()method 
public function clearControls():void

Removes all controls from the map.

clearOverlays()method 
public function clearOverlays():void

Removes all overlays from the map.

closeInfoWindow()method 
public function closeInfoWindow():Boolean

Closes the information window.

Returns
Boolean — true iff there was an info window to close.
continuousZoomEnabled()method 
public function continuousZoomEnabled():Boolean

Checks whether continuous zoom is enabled.

Returns
Boolean — true if continuous zoom is enabled.
controlByKeyboardEnabled()method 
public function controlByKeyboardEnabled():Boolean

Checks whether control by keyboard is enabled.

Returns
Boolean — true if control by keyboard is enabled.
crosshairsEnabled()method 
public function crosshairsEnabled():Boolean

Checks whether center crosshairs are enabled.

Returns
Boolean — true if center crosshairs are enabled.
disableContinuousZoom()method 
public function disableContinuousZoom():void

Disables continuous smooth zooming.

disableControlByKeyboard()method 
public function disableControlByKeyboard():void

Disables control by keyboard.

disableCrosshairs()method 
public function disableCrosshairs():void

Disables the center crosshairs.

disableDragging()method 
public function disableDragging():void

Disables dragging of the map.

disableScrollWheelZoom()method 
public function disableScrollWheelZoom():void

Disables zooming using a mouse's scroll wheel.

draggingEnabled()method 
public function draggingEnabled():Boolean

Checks whether dragging of the map is enabled.

Returns
Boolean — true if dragging of the map is enabled.
enableContinuousZoom()method 
public function enableContinuousZoom():void

Enables continuous smooth zooming.

enableControlByKeyboard()method 
public function enableControlByKeyboard():void

Enables control by keyboard.

enableCrosshairs()method 
public function enableCrosshairs():void

Enables the center crosshairs.

enableDragging()method 
public function enableDragging():void

Enables dragging of the map.

enableScrollWheelZoom()method 
public function enableScrollWheelZoom():void

Enables zooming using a mouse's scroll wheel.

fromLatLngToPoint()method 
public function fromLatLngToPoint(latLng:LatLng, opt_zoom:Number):Point

Returns x,y coordinates of specified lat, lng and zoom relative to the origin of the map's projection (the origin is the top left corner of the top left tile of the map for the specified map zoom level).

Parameters
latLng:LatLng — latLng location on the map
 
opt_zoom:Number — target zoom level (defaults to current zoom level)

Returns
Point — Point object with x and y properties
fromLatLngToViewport()method 
public function fromLatLngToViewport(latLng:LatLng, opt_disablewrap:Boolean = false):Point

Returns the pixel coordinates for the specified latLng location in the coordinate system of the map's view port ([0,0] being the top left corner of the map object).

Parameters
latLng:LatLng — LatLng coordinate of the point on the map.
 
opt_disablewrap:Boolean (default = false) — Whether wrapping of the map around +180/-180 degree longtitude is disabled.

Depending on the value of this parameter, the call may return the same or two different pixel coordinates depending on whether or not the shortest path between the current centre of the map and the target location crosses the +180/-180 degree longtitude wrap-around.

For example, the map is currently centred at Sydney, Australia [LatLng(-33.857, 151.215)] and the location passed into this call is San Francisco, USA [LatLng(37.779, -122.420)] This call will return two different pixel coordinates for the two values of the opt_disablewrap parameter.

By default (opt_disablewrap set to false), the map will wrap the around the +180/-180 degree longtitude to return the pixel coordinate that will lie to the right of the current centre of the map (picking the shorter path from Sydney to San Francisco that goes across the Pacific Ocean).

If the wrapping of the map is disabled (opt_disablewrap set to true), the pixel coordinate returned by the call will be to the left of the current centre (the longer path from Sydney to San Francisco going across the Indian and Atlantic Oceans).

The value returned by the call will be the same for either value of opt_disablewrap parameter if the shorter path from the current centre of the map to the target point does not cross the +180/-180 degree longtitude (such as in case where the current centre of the map is Sydney, Australia while the target location is Tokyo, Japan).

Returns
Point
fromPointToLatLng()method 
public function fromPointToLatLng(pos:Point, opt_zoom:Number, opt_nowrap:Boolean = false):LatLng

Returns lat,lng coordinates of specified x, y and zoom. The coordinates are relative to the origin of the map's projection (the top left corner of the top left tile of the map for the specified zoom level).

Parameters
pos:Point — x, y of a point
 
opt_zoom:Number — target zoom level (defaults to the current zoom level)
 
opt_nowrap:Boolean (default = false) — Do not wrap longitudes outside of [-180, 180)

Returns
LatLng — LatLng object with lat and lng
fromViewportToLatLng()method 
public function fromViewportToLatLng(pos:Point, opt_nowrap:Boolean = false):LatLng

Returns the lat-lng of the point at the given coordinates in the map's view port (the top left corner of the map object).

Parameters
pos:Point — Coordinates in the map's view port.
 
opt_nowrap:Boolean (default = false) — Do not wrap longitudes outside of [-180, 180)

Returns
LatLng — LatLng of the specified view port coordinates.
getBoundsZoomLevel()method 
public function getBoundsZoomLevel(bounds:LatLngBounds):Number

Returns the highest resolution zoom level at which the given rectangular region fits in the map view. The zoom level is computed for the currently selected map type.

Parameters
bounds:LatLngBounds — Bounds to show.

Returns
Number — Required zoom level to show these bounds.
getCenter()method 
public function getCenter():LatLng

Retrieves coordinates of the center in the map view control.

Returns
LatLng — LatLng for the center of the map view control.
getCurrentMapType()method 
public function getCurrentMapType():IMapType

Retrieves the current map type.

Returns
IMapType — Current map type.
getDisplayObject()method 
public function getDisplayObject():DisplayObject

Retrieves the display object that represents the map.

Returns
DisplayObject — Map display object
getDoubleClickMode()method 
public function getDoubleClickMode():Number

Get the mouse double click mode.

Returns
Number — mouse double click mode (one of the MapAction constants).

See also

getImplementationVersion()method 
public function getImplementationVersion():String

Gets the version of the implementation library SWF.

Returns
String — Version of the implementation library SWF.
getLatLngBounds()method 
public function getLatLngBounds():LatLngBounds

Returns the the visible rectangular region of the map view in geographical coordinates.

Returns
LatLngBounds — Lat-Lng for the visible map rectangle.
getMapTypes()method 
public function getMapTypes():Array

Retrieves the list of the map types available for the location.

Returns
Array — Array of available map types
getMaxZoomLevel()method 
public function getMaxZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number

Retrieves the maximum zoom level.

Parameters
opt_mapType:IMapType (default = null) — Map type used to determine maximum resolution.
 
opt_point:LatLng (default = null) — Point for which to get the maximum zoom.

Returns
Number — The maximum zoom level.
getMinZoomLevel()method 
public function getMinZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number

Retrieves the minimum zoom level.

Parameters
opt_mapType:IMapType (default = null) — MapType to determine minimum resolution.
 
opt_point:LatLng (default = null) — Point to get minimum zoom level for.

Returns
Number — The minimum zoom level.
getOptions()method 
public function getOptions():MapOptions

Retrieves the full set of options used by the map. Note that since MapOptions is used only during map initialization, this method only allows those original settings to be retrieved and does not support re-configuration of the map.

Returns
MapOptions — Options used by the map.

See also

Map.setInitOptions()
getPaneManager()method 
public function getPaneManager():IPaneManager

Retrieves the pane manager for the map.

Returns
IPaneManager — The instance of pane manager.

See also

getProjection()method 
public function getProjection():IProjection

Returns the projection being applied to the map.

Returns
IProjection — Projection being applied to the map.
getSize()method 
public function getSize():Point

Retrieves the map view size.

Returns
Point — Map view size.
getZoom()method 
public function getZoom():Number

Retrieves the map zoom level.

Returns
Number — Zoom level for the map.
isLoaded()method 
public function isLoaded():Boolean

Checks whether the map has been initialized.

Returns
Boolean — Returns true iff the map was initialized by a call to setCenter() since it was created.
openInfoWindow()method 
public function openInfoWindow(latlng:LatLng, options:InfoWindowOptions = null):IInfoWindow

Opens a simple information window at the given point.

Parameters
latlng:LatLng — Point at which the info window is opened.
 
options:InfoWindowOptions (default = null) — Info window options.

Returns
IInfoWindow — Reference to newly created info window.
panBy()method 
public function panBy(distance:Point):void

Starts a pan animation by the given distance in pixels.

Parameters
distance:Point — Distance in pixels
panTo()method 
public function panTo(latLng:LatLng):void

Pans the map to the specified centre location.

Parameters
latLng:LatLng — Coordinates for the new centre.
removeControl()method 
public function removeControl(control:IControl):void

Removes a control from the map. If the control was not added to the map, this does nothing.

Parameters
control:IControl — The control to remove.
removeMapType()method 
public function removeMapType(oldMapType:IMapType):void

Removes a registered map type.

Parameters
oldMapType:IMapType — Map type to unregister.
removeOverlay()method 
public function removeOverlay(overlay:IOverlay):void

Removes an overlay from the map.

Parameters
overlay:IOverlay — Overlay to be removed from the map.
returnToSavedPosition()method 
public function returnToSavedPosition():void

Returns map to the saved position.

savePosition()method 
public function savePosition():void

Stores the current map position and zoom level for later recall by returnToSavedPosition.

scrollWheelZoomEnabled()method 
public function scrollWheelZoomEnabled():Boolean

Checks whether scroll wheel zooming is enabled.

Returns
Boolean — true if scroll wheel zooming is enabled.
setCenter()method 
public function setCenter(latLng:LatLng, opt_zoom:Number, opt_mapType:IMapType = null):void

Changes the centre point of the map.

Parameters
latLng:LatLng — Coordinates for the new centre.
 
opt_zoom:Number — New zoom level.
 
opt_mapType:IMapType (default = null) — New map type.
setDoubleClickMode()method 
public function setDoubleClickMode(val:Number):void

Set the mouse double click mode.

Parameters
val:Number — mouse double click mode (one of the MapAction constants).

See also

setMapType()method 
public function setMapType(mapType:IMapType):void

Changes the map type for the map.

Parameters
mapType:IMapType — Map type.
setSize()method 
public function setSize(newSize:Point):void

Sets the size of the map view.

Parameters
newSize:Point — New view size for the map.
setZoom()method 
public function setZoom(level:Number, opt_doContinuousZoom:Boolean = false):void

Changes the zoom level for the map view control.

Parameters
level:Number — New zoom level.
 
opt_doContinuousZoom:Boolean (default = false) — Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map).

See also

unload()method 
public function unload():void

Removes the map from its parent and attempts to unload it to free up memory associated with the map. The map object will no longer be usable after the call to this method.

zoomIn()method 
public function zoomIn(opt_latlng:LatLng = null, opt_doCenter:Boolean = false, opt_doContinuousZoom:Boolean = false):void

Zooms in the map by one zoom level if possible.

Parameters
opt_latlng:LatLng (default = null) — If set, this is the point around which we zoom. Otherwise we will zoom in around the center of the map.
 
opt_doCenter:Boolean (default = false) — If true, we also want to center at opt_latlng.
 
opt_doContinuousZoom:Boolean (default = false) — Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map).

See also

zoomOut()method 
public function zoomOut(opt_latlng:LatLng = null, opt_doContinuousZoom:Boolean = false):void

Zooms out the map by one zoom level if possible.

Parameters
opt_latlng:LatLng (default = null) — If set, this is the point around which we zoom. Otherwise we will zoom out around the center of the map.
 
opt_doContinuousZoom:Boolean (default = false) — Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map).

See also