Package | com.google.maps |
Class | public class Map |
Inheritance | Map ![]() |
Implements | IMap |
Property | Defined by | ||
---|---|---|---|
countryCode : String
The desired map country code.
| Map | ||
key : String
The map key.
| Map | ||
language : String
The desired map language.
| Map | ||
languages : String
[AIR only] Sets the user's preferred languages.
| Map | ||
MERCATOR_PROJECTION : IProjection
[read-only]
Retrieves Mercator projection.
| Map | ||
overlayRaising : Boolean
Set to
true to enable raising of overlays upon mouse-over. | Map | ||
url : String
The url parameter for use in AIR applications.
| Map | ||
version : String
The desired map library version.
| Map |
Method | Defined by | ||
---|---|---|---|
Map()
Constructor.
| Map | ||
addControl(control:IControl):void
Registers a new control.
| Map | ||
addMapType(newMapType:IMapType):void
Registers a new map type.
| Map | ||
addOverlay(overlay:IOverlay):void
Adds an overlay to the map.
| Map | ||
clearControls():void
Removes all controls from the map.
| Map | ||
clearOverlays():void
Removes all overlays from the map.
| Map | ||
closeInfoWindow():Boolean
Closes the information window.
| Map | ||
continuousZoomEnabled():Boolean
Checks whether continuous zoom is enabled.
| Map | ||
controlByKeyboardEnabled():Boolean
Checks whether control by keyboard is enabled.
| Map | ||
crosshairsEnabled():Boolean
Checks whether center crosshairs are enabled.
| Map | ||
disableContinuousZoom():void
Disables continuous smooth zooming.
| Map | ||
disableControlByKeyboard():void
Disables control by keyboard.
| Map | ||
disableCrosshairs():void
Disables the center crosshairs.
| Map | ||
disableDragging():void
Disables dragging of the map.
| Map | ||
disableScrollWheelZoom():void
Disables zooming using a mouse's scroll wheel.
| Map | ||
draggingEnabled():Boolean
Checks whether dragging of the map is enabled.
| Map | ||
enableContinuousZoom():void
Enables continuous smooth zooming.
| Map | ||
enableControlByKeyboard():void
Enables control by keyboard.
| Map | ||
enableCrosshairs():void
Enables the center crosshairs.
| Map | ||
enableDragging():void
Enables dragging of the map.
| Map | ||
enableScrollWheelZoom():void
Enables zooming using a mouse's scroll wheel.
| Map | ||
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).
| Map | ||
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).
| Map | ||
fromPointToLatLng(pos:Point, opt_zoom:Number, opt_nowrap:Boolean = false):LatLng
Returns lat,lng coordinates of specified x, y and zoom.
| Map | ||
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).
| Map | ||
getBoundsZoomLevel(bounds:LatLngBounds):Number
Returns the highest resolution zoom level at which the given rectangular
region fits in the map view.
| Map | ||
Retrieves coordinates of the center in the map view control.
| Map | ||
Retrieves the current map type.
| Map | ||
getDisplayObject():DisplayObject
Retrieves the display object that represents the map.
| Map | ||
getDoubleClickMode():Number
Get the mouse double click mode.
| Map | ||
getImplementationVersion():String
Gets the version of the implementation library SWF.
| Map | ||
getInterfaceVersion():String
Retrieves the version of the client interface.
| Map | ||
Returns the the visible rectangular region of the map view in
geographical coordinates.
| Map | ||
getMapTypes():Array
Retrieves the list of the map types available for the location.
| Map | ||
Retrieves the maximum zoom level.
| Map | ||
Retrieves the minimum zoom level.
| Map | ||
Retrieves the full set of options used by the map.
| Map | ||
Retrieves the pane manager for the map.
| Map | ||
Returns the projection being applied to the map.
| Map | ||
getSize():Point
Retrieves the map view size.
| Map | ||
getZoom():Number
Retrieves the map zoom level.
| Map | ||
isLoaded():Boolean
Checks whether the map has been initialized.
| Map | ||
Opens a simple information window at the given point.
| Map | ||
panBy(distance:Point):void
Starts a pan animation by the given distance in pixels.
| Map | ||
Pans the map to the specified centre location.
| Map | ||
removeControl(control:IControl):void
Removes a control from the map.
| Map | ||
removeMapType(oldMapType:IMapType):void
Removes a registered map type.
| Map | ||
removeOverlay(overlay:IOverlay):void
Removes an overlay from the map.
| Map | ||
returnToSavedPosition():void
Returns map to the saved position.
| Map | ||
savePosition():void
Stores the current map position and zoom level for later recall
by returnToSavedPosition.
| Map | ||
scrollWheelZoomEnabled():Boolean
Checks whether scroll wheel zooming is enabled.
| Map | ||
Changes the centre point of the map.
| Map | ||
setDoubleClickMode(val:Number):void
Set the mouse double click mode.
| Map | ||
setInitOptions(options:MapOptions):void
Sets the options used to initialize the Map.
| Map | ||
setMapType(mapType:IMapType):void
Changes the map type for the map.
| Map | ||
setSize(newSize:Point):void
Sets the size of the map view.
| Map | ||
setZoom(level:Number, opt_doContinuousZoom:Boolean = false):void
Changes the zoom level for the map view control.
| Map | ||
unload():void
Removes the map from its parent and attempts to unload it to free up
memory associated with the map.
| Map | ||
zoomIn(opt_latlng:LatLng = null, opt_doCenter:Boolean = false, opt_doContinuousZoom:Boolean = false):void
Zooms in the map by one zoom level if possible.
| Map | ||
Zooms out the map by one zoom level if possible.
| Map |
Method | Defined by | ||
---|---|---|---|
callLater(call:Function):void
| Map | ||
clearWrapper():void
Remove all event listeners and clear the wrapper.
| Map | ||
delayCall(call:Function):void
Delay a method call until the next frame.
| Map |
countryCode | property |
countryCode:String
[read-write]The desired map country code. If set this provides the country code used by default for geocoding and directions queries. In both instances, however, the default code may be overridden on an individual query basis.
Implementation public function get countryCode():String
public function set countryCode(value:String):void
See also
key | property |
key:String
[read-write]The map key.
Implementation public function get key():String
public function set key(value:String):void
language | property |
language:String
[read-write]The desired map language. Note that we'd generally recommend that you not set this. If left null then the map will pick up its language from the user's browser settings. Before setting this you might first try changing your browser's preferred language setting to see how your map will appear to a user in a different country. Set this explicitly only if you are certain of the language in which all users will interact with your map. This will override the language used for button labels, geocoding and directions queries.
Implementation public function get language():String
public function set language(value:String):void
See also
languages | property |
languages:String
[read-write][AIR only] Sets the user's preferred languages.
Implementation public function get languages():String
public function set languages(value:String):void
import flash.system.Capabilities; : languages = Capabilities.languages.join(',');
MERCATOR_PROJECTION | property |
MERCATOR_PROJECTION:IProjection
[read-only]Retrieves Mercator projection.
Implementation public function get MERCATOR_PROJECTION():IProjection
overlayRaising | property |
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.
public function get overlayRaising():Boolean
public function set overlayRaising(value:Boolean):void
url | property |
url:String
[read-write]The url parameter for use in AIR applications.
Implementation public function get url():String
public function set url(value:String):void
version | property |
version:String
[read-write]The desired map library version.
Implementation public function get version():String
public function set version(value:String):void
Map | () | constructor |
public function Map()
Constructor. When this runs none of the bindable variables has yet been initialized. We defer actions that depend upon them until we have been added to the stage.
addControl | () | method |
public function addControl(control:IControl):void
Registers a new control. This can be called before the MAP_READY event has been received.
Parameterscontrol:IControl — New control to register.
|
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.
ParametersnewMapType:IMapType — New map type to register.
|
addOverlay | () | method |
public function addOverlay(overlay:IOverlay):void
Adds an overlay to the map.
Parametersoverlay:IOverlay — The overlay to be added to the map.
|
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);
callLater | () | method |
protected function callLater(call:Function):void
Parameters
call:Function |
clearControls | () | method |
public function clearControls():void
Removes all controls from the map.
clearOverlays | () | method |
public function clearOverlays():void
Removes all overlays from the map.
clearWrapper | () | method |
protected function clearWrapper():void
Remove all event listeners and clear the wrapper.
closeInfoWindow | () | method |
public function closeInfoWindow():Boolean
Closes the information window.
ReturnsBoolean — true iff there was an info window to close.
|
continuousZoomEnabled | () | method |
public function continuousZoomEnabled():Boolean
Checks whether continuous zoom is enabled.
ReturnsBoolean — true if continuous zoom is enabled.
|
controlByKeyboardEnabled | () | method |
public function controlByKeyboardEnabled():Boolean
Checks whether control by keyboard is enabled.
ReturnsBoolean — true if control by keyboard is enabled.
|
crosshairsEnabled | () | method |
public function crosshairsEnabled():Boolean
Checks whether center crosshairs are enabled.
ReturnsBoolean — true if center crosshairs are enabled.
|
delayCall | () | method |
protected function delayCall(call:Function):void
Delay a method call until the next frame.
Parameterscall:Function — Method to invoke in the next frame.
|
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.
ReturnsBoolean — 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).
ParameterslatLng:LatLng — latLng location on the map
|
|
opt_zoom:Number — target zoom level (defaults to current zoom level)
|
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).
ParameterslatLng: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). |
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).
Parameterspos: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)
|
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).
Parameterspos:Point — Coordinates in the map's view port.
|
|
opt_nowrap:Boolean (default = false ) — Do not wrap longitudes outside of [-180, 180)
|
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.
Parametersbounds:LatLngBounds — Bounds to show.
|
Number — Required zoom level to show these bounds.
|
getCenter | () | method |
public function getCenter():LatLng
Retrieves coordinates of the center in the map view control.
ReturnsLatLng —
LatLng for the center of the map view control.
|
getCurrentMapType | () | method |
public function getCurrentMapType():IMapType
Retrieves the current map type.
ReturnsIMapType —
Current map type.
|
getDisplayObject | () | method |
public function getDisplayObject():DisplayObject
Retrieves the display object that represents the map.
ReturnsDisplayObject — Map display object
|
getDoubleClickMode | () | method |
public function getDoubleClickMode():Number
Get the mouse double click mode.
ReturnsNumber — 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.
ReturnsString — Version of the implementation library SWF.
|
getInterfaceVersion | () | method |
public function getInterfaceVersion():String
Retrieves the version of the client interface.
ReturnsString — Client interface version.
|
getLatLngBounds | () | method |
public function getLatLngBounds():LatLngBounds
Returns the the visible rectangular region of the map view in geographical coordinates.
ReturnsLatLngBounds —
Lat-Lng for the visible map rectangle.
|
getMapTypes | () | method |
public function getMapTypes():Array
Retrieves the list of the map types available for the location.
ReturnsArray — Array of available map types
|
getMaxZoomLevel | () | method |
public function getMaxZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number
Retrieves the maximum zoom level.
Parametersopt_mapType:IMapType (default = null ) — Map type used to determine maximum resolution.
|
|
opt_point:LatLng (default = null ) — Point for which to get the maximum zoom.
|
Number — The maximum zoom level.
|
getMinZoomLevel | () | method |
public function getMinZoomLevel(opt_mapType:IMapType = null, opt_point:LatLng = null):Number
Retrieves the minimum zoom level.
Parametersopt_mapType:IMapType (default = null ) — MapType to determine minimum resolution.
|
|
opt_point:LatLng (default = null ) — Point to get minimum zoom level for.
|
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.
ReturnsMapOptions —
Options used by the map.
|
See also
getPaneManager | () | method |
public function getPaneManager():IPaneManager
Retrieves the pane manager for the map.
ReturnsIPaneManager —
The instance of pane manager.
|
See also
getProjection | () | method |
public function getProjection():IProjection
Returns the projection being applied to the map.
ReturnsIProjection —
Projection being applied to the map.
|
getSize | () | method |
public function getSize():Point
Retrieves the map view size.
ReturnsPoint — Map view size.
|
getZoom | () | method |
public function getZoom():Number
Retrieves the map zoom level.
ReturnsNumber — Zoom level for the map.
|
isLoaded | () | method |
public function isLoaded():Boolean
Checks whether the map has been initialized.
ReturnsBoolean — 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.
Parameterslatlng:LatLng — Point at which the info window is opened.
|
|
options:InfoWindowOptions (default = null ) — Info window options.
|
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.
Parametersdistance:Point — Distance in pixels
|
panTo | () | method |
public function panTo(latLng:LatLng):void
Pans the map to the specified centre location.
ParameterslatLng: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.
Parameterscontrol:IControl — The control to remove.
|
removeMapType | () | method |
public function removeMapType(oldMapType:IMapType):void
Removes a registered map type.
ParametersoldMapType:IMapType — Map type to unregister.
|
removeOverlay | () | method |
public function removeOverlay(overlay:IOverlay):void
Removes an overlay from the map.
Parametersoverlay: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.
ReturnsBoolean — 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.
ParameterslatLng: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.
Parametersval:Number — mouse double click mode (one of the MapAction constants).
|
See also
setInitOptions | () | method |
public function setInitOptions(options:MapOptions):void
Sets the options used to initialize the Map. You should ONLY call this method whilst handling a MapEvent.MAP_PREINITIALIZE event. Before this event values which you need for MapOptions properties may not themselves have been configured. After this event map initialization will have progressed past the point at which MapOptions properties are used.
Parametersoptions:MapOptions — Instance of MapOptions that overrides the defaults
used to initialize the map; or null to use only the default options.
|
See also
setMapType | () | method |
public function setMapType(mapType:IMapType):void
Changes the map type for the map.
ParametersmapType:IMapType — Map type.
|
setSize | () | method |
public function setSize(newSize:Point):void
Sets the size of the map view.
ParametersnewSize: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.
Parameterslevel: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.
Parametersopt_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.
Parametersopt_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