Includes enterprise licensing and support
|
||
|
|
Alpha (opacity) constants. The main role of these constants is to improve code readability, using names that immediately suggest the effect that the chosen opacity value has.
| Name | Value | Description |
|---|---|---|
OPAQUE |
1.00 |
|
PERCENT_0 |
0 |
|
PERCENT_10 |
0.10 |
|
PERCENT_100 |
1.00 |
|
PERCENT_20 |
0.20 |
|
PERCENT_30 |
0.30 |
|
PERCENT_40 |
0.40 |
|
PERCENT_50 |
0.50 |
|
PERCENT_60 |
0.60 |
|
PERCENT_70 |
0.70 |
|
PERCENT_80 |
0.80 |
|
PERCENT_90 |
0.90 |
|
UNSEEN |
0 |
Color stores a color and provides methods for conversion between different textual and numeric representations of color.
| Name | Value | Description |
|---|---|---|
BLACK |
0x000000 |
|
BLUE |
0x0000ff |
|
CYAN |
0x00ffff |
|
DEFAULTLINK |
0x7777cc |
Color used for the 'Terms of Use' link. |
GRAY1 |
0x101010 |
|
GRAY10 |
0xa0a0a0 |
|
GRAY11 |
0xb0b0b0 |
|
GRAY12 |
0xc0c0c0 |
|
GRAY13 |
0xd0d0d0 |
|
GRAY14 |
0xe0e0e0 |
|
GRAY15 |
0xf0f0f0 |
|
GRAY2 |
0x202020 |
|
GRAY3 |
0x303030 |
|
GRAY4 |
0x404040 |
|
GRAY5 |
0x505050 |
|
GRAY6 |
0x606060 |
|
GRAY7 |
0x707070 |
|
GRAY8 |
0x808080 |
|
GRAY9 |
0x909090 |
|
GREEN |
0x00ff00 |
|
MAGENTA |
0xff00ff |
|
RED |
0xff0000 |
|
WHITE |
0xffffff |
|
YELLOW |
0xffff00 |
| Name | Type | Description |
|---|---|---|
b |
Number |
Blue component, in the range [0,255]. |
g |
Number |
Green component, in the range [0,255]. |
r |
Number |
Red component, in the range [0,255]. |
rgb |
Number |
Color as a Number, for example 0x804020. |
Color(clr:Number)Constructs a Color from a Number.
var col:Color = new Color(0x0000ff); // blue
| Parameter | Type | Description |
|---|---|---|
clr |
Number |
toHtml(color:Number): StringReturns a color in HTML format, for example '#321fba'. Clamps the number to the range [0x000000,0xffffff]. Returns the encoding for black if the input value is not a valid number.
var col:Color = new Color(0xff8020); trace(col.toHtml()); // outputs "#ff8020"
| Parameter | Type | Description |
|---|---|---|
color |
Number |
Color to represent in HTML format. |
incRGB(deltaR:Number, deltaG:Number, deltaB:Number): voidIncrements this color's R, G and B components by individual delta values. Each color component is clamped to the valid range [0,255].
var col:Color = new Color(0xff0000); // color is red col.incRGB(0, 255, 0); // color is now yellow
| Parameter | Type | Description |
|---|---|---|
deltaR |
Number |
R component delta. |
deltaG |
Number |
G component delta. |
deltaB |
Number |
B component delta. |
setRGB(compR:Number, compG:Number, compB:Number): voidSets this color from R, G and B components, all in the range [0,255].
var col:Color = new Color(0); col.setRGB(128, 64, 255); // lilac
| Parameter | Type | Description |
|---|---|---|
compR |
Number |
New R component. |
compG |
Number |
New G component. |
compB |
Number |
New B component. |
toString(): StringReturns a string representation of this color, for example 'R:64/G:32/B:255'.
var col:Color = new Color(0xff8020); trace(col.toString()); // outputs "R:255/G:128/B:32"
This class contains information about which copyright message applies to a region of the map given by a rectangle, at a given range of zoom levels. You need this object only if you implement custom map types or tile layers.
Copyright(id:String, bounds:LatLngBounds, minZoom:Number, text:String, opt_maxZoom?:Number, opt_isSupplemental?:Boolean)Constructs a Copyright instance covering a geographical extent and range of zoom levels and specifies the id and text displayed for this instance.
// Create two Copyright instances. Company A's data is used
// throughout all zoom levels over a region spanning 10 degrees of latitude
// and 40 degrees of longitude. Company B's data supplements this over a
// much smaller region at zoom levels 14 and higher.
var regionCopyright:Copyright = new Copyright(
'my_tileset_0',
new LatLngBounds(new LatLng(10, 20), new LatLng(20, 60)),
'Company A',
0);
var cityCopyright:Copyright = new Copyright(
'my_tileset_1',
new LatLngBounds(new LatLng(12, 20), new LatLng(13, 21)),
'Company B',
14,
true);| Parameter | Type | Description |
|---|---|---|
id |
String |
Unique id. |
bounds |
LatLngBounds |
Geographical extent to which this Copyright applies. |
minZoom |
Number |
Minimum zoom at which to display. |
text |
String |
Copyright text. |
opt_maxZoom? |
Number |
Maximum zoom at which to display. |
opt_isSupplemental? |
Boolean |
Indicates whether this copyright supplements copyrights from coarser zoom levels. You might specify a general copyright over an extended region at a coarse zoom level, then add further copyright text within part of this region at a finer zoom level by setting this flag true. Alternatively, you may simply leave this false and specify the entire text at the finer zoom level. |
getBounds(): LatLngBoundsRetrieves the spatial extent of the copyright.
var regionCopyright:Copyright = new Copyright(
'my_tileset_0',
new LatLngBounds(new LatLng(10, 20), new LatLng(20, 60)),
'Company A',
0);
trace(regionCopyright.getBounds()); // outputs "((10, 20), (20, 60))"getId(): StringRetrieves the copyright id.
getMaxZoom(): NumberRetrieves the maximum zoom level that applies to the copyright.
getMinZoom(): NumberRetrieves the minimum zoom level that applies to the copyright.
getText(): StringRetrieves the copyright text.
isSupplemental(): BooleanReturns true if this copyright is supplemental to copyright information from coarser zoom levels. If it is supplemental then it will be added to the coarser zoom level copyright information. If it is not supplemental then this copyright information is fully self-contained.
CopyrightCollection manages copyright messages displayed on maps of custom map type. If you don't implement custom map types, then you don't need to use this class. A copyright collection contains information about which copyright to display for which region on the map at which zoom level. This is very important for map types that display heterogenous data such as the satellite map type.
CopyrightCollection(opt_prefix?:String)Creates a copyright collection for the given map type/spec.
| Parameter | Type | Description |
|---|---|---|
opt_prefix? |
String |
Prefix for copyrights (optional). |
addCopyright(copyright:Copyright): BooleanAdds the given copyright to the collection, returning true if the copyright was new and was added or false if the copyright was a duplicate and ignored.
| Parameter | Type | Description |
|---|---|---|
copyright |
Copyright |
New copyright to add. |
getCopyrightNotice(bounds:LatLngBounds, zoom:Number): CopyrightNoticeReturns a CopyrightNotice instance for the given viewport.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Query bounds. |
zoom |
Number |
Zoom level. |
getCopyrights(bounds:LatLngBounds, zoom:Number): ArrayRetrieves an array of elements of type String, which comprises the copyright text that we should display for the given viewport.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Query bounds. |
zoom |
Number |
Zoom level. |
getCopyrightsAtLatLng(latLng:LatLng): ArrayReturns an array of elements of type Copyright, which are the copyrights pertaining to the specified location.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
The point for which we want to get copyrights for. |
CopyrightNotice stores an array of strings representing copyright text to display on the map, but can also be cast to a single text string. Copyright information for several data providers may apply to a region of the map: maintaining an array allows the text for the individual providers to be extracted. Use the toString method if you wish simply to obtain a single compound text string. You are unlikely to need to construct a CopyrightNotice yourself, but ICopyrightCollection provides a method, getCopyrightNotice() that returns an instance of this class.
CopyrightNotice(prefix:String, copyrightTexts:Array)Construct a CopyrightNotice from a text prefix and an array of elements of type String representing the individual copyright notices. Note that this class stores a reference to this array, rather than cloning the elements.
| Parameter | Type | Description |
|---|---|---|
prefix |
String |
Copyright prefix. |
copyrightTexts |
Array |
Text of each copyright. |
getPrefix(): StringRetrieves the copyright prefix.
getTexts(): ArrayRetrieves the array of copyright texts. Each element in this array is of type String.
toString(): StringReturns a single string made up of the prefix followed by a list of the text array elements.
var notice:CopyrightNotice = new CopyrightNotice(
"Copyright",
[ "Company A", "Company B" ]);
trace(notice.toString()); // outputs "Copyright Company A, CompanyB"
Class InfoWindowOptions specifies a set of rendering parameters for the info window.
| Name | Value | Description |
|---|---|---|
ALIGN_CENTER |
1 |
|
ALIGN_LEFT |
0 |
|
ALIGN_RIGHT |
2 |
| Name | Type | Description |
|---|---|---|
content |
String |
Plain text content for the info window. |
contentFormat |
TextFormat |
Info window's content format. |
contentHTML |
String |
HTML content for the info window. |
contentStyleSheet |
StyleSheet |
Info window's content style sheet. |
cornerRadius |
Object |
A Number value that indicates the info window's corner radius. |
customCloseRect |
Rectangle |
Custom close rectangle. If non-null, this parameter specifies the rectangular region within which a mouse-click will close the info window. When the customContent property is also non-null this region is invisible but still active. When using custom content you are, of course, free to attach mouse listeners within your own content and could use one of these to close the info window; this property provides an alternative. When the customContent property is null the customCloseRect property can be used to move the close button from its default location. |
customContent |
DisplayObject |
Display object used as the info window's custom content. If this field is not null then nothing is drawn by the Maps API for Flash library, but rather the custom content is positioned relative to the info window anchor point. |
customOffset |
Point |
Custom content offset. When custom content is used, this parameter specifies the offset of the infowindow's target location in relation to the customContent's alignment point. This property has no effect if customContent is not specified or if drawDefaultFrame is set to true. |
drawDefaultFrame |
Object |
A Boolean value indicating whether the default infowindow outline (including the default close button) should be drawn around the custom content specified through the customContent property. The default infowindow outline is always drawn if the custom content is not specified. |
fillStyle |
FillStyle |
Info window's fill style. |
hasCloseButton |
Object |
A Boolean value that indicates whether the info window has a close button. |
hasShadow |
Object |
A Boolean value that indicates whether the info window has a shadow. |
hasTail |
Object |
A Boolean value that indicates whether the info window has a tail. |
height |
Object |
A Number value that indicates the info window's height. |
padding |
Object |
A Number value that indicates the padding applied around the info window's title and content. |
pointOffset |
Point |
Offset of the tail point from the info window anchor. This parameter may be used to create the effect of infowindow "floating above the ground" (for negative values of pointOffset.y) instead of touching its latLng location on the map. |
strokeStyle |
StrokeStyle |
Info window's stroke style. |
tailAlign |
Object |
A Number value that specifies the tail alignment. Set this to one of the constants InfoWindowOptions.ALIGN_LEFT, InfoWindowOptions.ALIGN_CENTER or InfoWindowOptions.ALIGN_RIGHT. |
tailHeight |
Object |
A Number value that indicates the tail's height. |
tailOffset |
Object |
A Number value that indicates the horizontal offset of the tail's tip from the info window midpoint. |
tailWidth |
Object |
A Number value that indicates the tail's width. |
title |
String |
Plain text title for the info window. |
titleFormat |
TextFormat |
Info window's title format. |
titleHTML |
String |
HTML title for the info window. |
titleStyleSheet |
StyleSheet |
Info window's title style sheet. |
width |
Object |
A Number value that indicates the info window's width. |
InfoWindowOptions(param?:Object)Constructs an InfoWindowOptions object, optionally initializing it from an object.
// Specifying all InfoWindowOptions properties.
var titleFormat:TextFormat = new TextFormat();
textFormat.bold = true;
var titleStyleSheet:StyleSheet = new StyleSheet();
var h1:Object = {
color: "#FFFF80",
fontWeight: "bold" };
titleStyleSheet.setStyle("h1", h1);
var contentStyleSheet:StyleSheet = new StyleSheet();
var body:Object = {
color: "#FF0080",
fontStyle: "italic" };
contentStyleSheet.setStyle("body", body);
var contentFormat:TextFormat = new TextFormat("Arial", 10);
var options:InfoWindowOptions = new InfoWindowOptions({
strokeStyle: {
color: 0x987654
},
fillStyle: {
color: 0x223344,
alpha: 0.8
},
titleFormat: titleFormat,
titleStyleSheet: titleStyleSheet,
contentFormat: contentFormat,
contentStyleSheet: contentStyleSheet,
width: 200,
cornerRadius: 12,
padding: 10,
hasCloseButton: true,
hasTail: true,
tailWidth: 20,
tailHeight: 30,
tailOffset: -12,
tailAlign: InfoWindowOptions.ALIGN_LEFT,
pointOffset: new Point(3, 8),
hasShadow: true
});| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An object that contains a set of initial values for the new InfoWindowOptions object. The fields are: strokeStyle:StrokeStyle fillStyle:FillStyle title:String titleHTML:String titleFormat:TextFormat titleStyleSheet:StyleSheet content:String contentHTML:String contentFormat:TextFormat contentStyleSheet:StyleSheet width:Object height:Object cornerRadius:Object padding:Object hasCloseButton:Object hasTail:Object tailWidth:Object tailHeight:Object tailOffset:Object tailAlign:Object pointOffset:Point hasShadow:Object |
getDefaultOptions(): InfoWindowOptionsRetrieves the InfoWindowOptions instance that represents the default set of options that applies to all info windows.
// Initialization object corresponding to the initial defaults.
var titleStyleSheet:StyleSheet = new StyleSheet();
titleStyleSheet.setStyle("p", { fontFamily: "_sans" });
var contentStyleSheet:StyleSheet = new StyleSheet();
contentStyleSheet.setStyle("p", { fontFamily: "_sans" });
var initObject:Object = {
strokeStyle: {
thickness: 2,
alpha: 1.0,
color:Color.BLACK
},
fillStyle: {
color: 0xffffff,
alpha: 1.0
},
title: null,
titleHTML: null,
titleFormat: new TextFormat("_sans"),
titleStyleSheet: titleStyleSheet,
content: null,
contentHTML: null,
contentFormat: new TextFormat("_sans"),
contentStyleSheet: contentStyleSheet,
width: 200,
height: null,
cornerRadius: 5,
padding: 0,
hasCloseButton: true,
hasTail: true,
tailWidth: 20,
tailHeight: 20,
tailOffset: 0,
tailAlign: InfoWindowOptions.ALIGN_LEFT,
pointOffset: new Point(0, 0),
hasShadow: true,
customContent: null,
customOffset: null,
customCloseRect: null
}setDefaultOptions(defaults:InfoWindowOptions): void
Sets the default set of options that applies to all infowindows.
Options may also be set for the infowindow individually in the
openInfoWindow call.
If that is the case, options specified in that call
will take precedence over the default options.
The defaults parameter may specify a complete or partial set
of infowindow options. If a partial set of options is specified, it will
supplement the existing defaults, overriding only the values that were
set explicitly and leaving the rest unchanged.
| Parameter | Type | Description |
|---|---|---|
defaults |
InfoWindowOptions |
New default full or partial set of infowindow options. |
toString(): StringReturns a String representation of this object.
LatLng is a point in geographical coordinates with longitude and latitude. Notice that although usual map projections associate longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude coordinate is always written first, followed by the longitude, as is customary in cartography. Notice also that you cannot modify the coordinates of a LatLng. If you want to compute another point, you have to create a new one.
| Name | Value | Description |
|---|---|---|
EARTH_RADIUS |
6378137 |
The equatorial radius of the earth in meters. Assumes a perfectly spherical earth, and hence is approximate. The earth's radius in fact varies between 6357 km at the pole to 6378 KM at the equator - a difference of 0.3%. |
LatLng(lat:Number, lng:Number, opt_noCorrect?:Boolean)Constructs a LatLng. If opt_noCorrect is false, we make sure the latitude and longitude are valid, wrapping the longitude appropriately around the dateline and clamping the latitude at the poles. Valid values for longitude lie in the range [-180,180]. Valid values for latitude lie in the range [-90,90].
// Construct three LatLng instances. var sydney:LatLng = new LatLng(-33.8581, 151.2149); var bound:LatLng = new LatLng(10, 190); // longitude set to -170 var unbound:LatLng = new LatLng(10, 190, true); // longitude set to 190
| Parameter | Type | Description |
|---|---|---|
lat |
Number |
Latitude. |
lng |
Number |
Longitude. |
opt_noCorrect? |
Boolean |
Flag: do not correct to valid range. |
fromRadians(lat:Number, lng:Number, opt_noCorrect?:Boolean): LatLngCreates a latlng from radian values.
| Parameter | Type | Description |
|---|---|---|
lat |
Number |
Latitude in radians. |
lng |
Number |
Longitude in radians. |
opt_noCorrect? |
Boolean |
Flag to prevent correction to valid range. |
fromUrlValue(value:String): LatLngParses a string of the form "lat,lng" and returns a point with those values, or null if the string could not be successfully parsed.
// Create a LatLng from a text string.
var location:LatLng = LatLng.fromUrlValue("-34,151");| Parameter | Type | Description |
|---|---|---|
value |
String |
"lat,lng" string to parse. |
wrapLatLng(latLng:LatLng): LatLngReturns a LatLng that is a copy of the given LatLng, but with latitude clamped to the range [-90, 90] and longitude wrapped to the range [-180, 180].
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Unbound LatLng object. |
angleFrom(other:LatLng): NumberReturns the angle (radians) between this point and the given point. This is also the distance between those points on a unit sphere.
// Calculate angle in radians between London and Paris.
var london:LatLng = new LatLng(51.53, -0.08);
var paris:LatLng = new LatLng(48.8, 2.33);
trace("angle: " + paris.angleFrom(london));| Parameter | Type | Description |
|---|---|---|
other |
LatLng |
Other LatLng |
clone(): LatLngReturns a new LatLng object that is a copy of this.
distanceFrom(other:LatLng, opt_radius?:Number): NumberReturns the distance, in meters, from this point to the given point. Since we approximate the earth as a sphere, the distance could be off by as much as 0.3%.
// Calculate distance in km between London and Sydney.
var london:LatLng = new LatLng(51.53, -0.08);
var sydney:LatLng = new LatLng(-34.0, 151.0);
trace("km: " + sydney.distanceFrom(london) / 1000);| Parameter | Type | Description |
|---|---|---|
other |
LatLng |
Other LatLng |
opt_radius? |
Number |
The radius of the planet (default EARTH_RADIUS). |
equals(other:LatLng): BooleanTests whether this LatLng is coincident with another specified LatLng, allowing for numerical rounding errors.
| Parameter | Type | Description |
|---|---|---|
other |
LatLng |
LatLng against which to compare. |
lat(): NumberReturns the latitude in degrees.
latRadians(): NumberReturns the latitude in radians.
lng(): NumberReturns the longitude in degrees.
lngRadians(): NumberReturns the longitude in radians.
toString(): StringReturns a string representation of this LatLng, for example '48.8584, 2.2944' for Paris.
toUrlValue(opt_precision?:Number): StringReturns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default. This produces the following accuracies (precision:approximate error): -1:1000 kilometers / 700 miles, 0:100 kilometers / 70 miles, 1:10 kilometers / 7 miles, 2:1 kilometer / 0.7 miles, 3:100 meters / 300 feet, 4:10 meters / 30 feet, 5:1 meter / 3 feet, 6:10 centimeters / 4 inches, 7:1 centimeter (a nickel).
| Parameter | Type | Description |
|---|---|---|
opt_precision? |
Number |
Number of digits following decimal point. |
A rectangular bounds on the Earth. The 2D interval is directed, i.e. it extends from the SW corner to the NE corner, even if the longitude interval from NE to SW (the other way round the earth) would be smaller. The bounds can be extended to contain new points with the extend() method.
LatLngBounds(opt_sw?:LatLng, opt_ne?:LatLng)Constructs a LatLngBounds from two LatLng instances, holding the SW extent and NE extent, respectively. A LatLngBounds instance represents a rectangle in geographical coordinates, including one that crosses the 180 degrees meridian.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(10, 50), // spans 1 degree latitude
new LatLng(11, 52)); // and 2 degrees longitude| Parameter | Type | Description |
|---|---|---|
opt_sw? |
LatLng |
South-west corner (optional). |
opt_ne? |
LatLng |
North-east corner (optional). |
clone(): LatLngBoundsCreates a clone of this instance.
containsBounds(other:LatLngBounds): BooleanReturns true if this bounds completely contains the given bounds.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(10, 50), new LatLng(20, 70));
trace(bounds.containsBounds(
new LatLngBounds(
new LatLng(11, 12), new LatLng(52, 68))); // outputs true
| Parameter | Type | Description |
|---|---|---|
other |
LatLngBounds |
Contained LatLngBounds. |
containsLatLng(point:LatLng): BooleanReturns true if the given lat/lng is in this bounds.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(10, 50),
new LatLng(20, 70));
trace(bounds.containsLatLng(new LatLng(15, 51))); // outputs true
trace(bounds.containsLatLng(new LatLng(29, 51))); // outputs false
| Parameter | Type | Description |
|---|---|---|
point |
LatLng |
Test point. |
equals(other:LatLngBounds): BooleanReturns true if this bounds equals the given bound, allowing for numerical rounding errors.
| Parameter | Type | Description |
|---|---|---|
other |
LatLngBounds |
LatLngBounds against which to compare. |
extend(point:LatLng): voidExtends this bounds to contain the given point.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(1, 5), new LatLng(2, 7));
bounds.extend(new LatLng(0, 9));
trace(bounds.toString()); // outputs "((0, 5), (2, 9))"| Parameter | Type | Description |
|---|---|---|
point |
LatLng |
Point to add. |
getCenter(): LatLngComputes the center of this LatLngBounds
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(10, 50),
new LatLng(20, 70));
trace(bounds.getCenter()); // outputs "(15, 60)"getEast(): NumberReturns the east longitude of this bounds.
getNorth(): NumberReturns the north latitude of this bounds.
getNorthEast(): LatLngReturns the north-east corner of this bounds.
getNorthWest(): LatLngReturns the north-west corner of this bounds.
getSouth(): NumberReturns the south latitude of this bounds.
getSouthEast(): LatLngReturns the south-east corner of this bounds.
getSouthWest(): LatLngReturns the south-west corner of this bounds.
getWest(): NumberReturns the west longitude of this bounds.
intersects(other:LatLngBounds): BooleanReturns true if this bounds shares any points with this bounds.
| Parameter | Type | Description |
|---|---|---|
other |
LatLngBounds |
Test LatLngBounds. |
isEmpty(): BooleanReturns true if the bounds are empty.
isFullLat(): BooleanReturns true if the bounds cover all latitudes.
isFullLng(): BooleanReturns true if the bounds cover all longitudes.
isLargerThan(other:LatLngBounds): BooleanReturns true if this bounds is larger than (could contain) the other.
| Parameter | Type | Description |
|---|---|---|
other |
LatLngBounds |
toSpan(): LatLngConverts the given map bounds to a lat/lng span.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(10, 50), new LatLng(20, 70));
trace(bounds.toSpan()); // outputs "(10, 20)"toString(): StringConverts this LatLngBounds to a string.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(1, 5),
new LatLng(2, 7));
trace(bounds.toString()); // outputs "((1, 5), (2, 7))"union(other:LatLngBounds): voidExtends this bounds to contain the union of this and the given bounds.
var bounds:LatLngBounds = new LatLngBounds(
new LatLng(0, 0), new LatLng(1, 1));
bounds.union(
new LatLngBounds(
new LatLng(10, 20), new LatLng(15, 22)));
trace(bounds.toString()); // outputs "((0, 0), (15, 22))"| Parameter | Type | Description |
|---|---|---|
other |
LatLngBounds |
LatLngBounds to union with. |
This is the main class of the Maps API for Flash.
Instantiate Map to create a map.
Map has a number of properties used for global configuration.
It is important to note that these values are only used during
initialization. Whilst they can later be set to different values,
doing so will have no effect upon the map.
You should ensure that these properties are set to appropriate values
before the map is added as a child of another display object.
The properties in this category are:
countryCode
key
language
languages (AIR only)
url (AIR only)
version.
| Name | Type | Description |
|---|---|---|
MERCATOR_PROJECTION |
IProjection |
Retrieves Mercator projection. |
countryCode |
String |
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. |
key |
String |
The map key. |
language |
String |
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. |
languages |
String |
(AIR only) Sets the user's preferred languages. |
overlayRaising |
Boolean |
Set to |
url |
String |
The url parameter for use in AIR applications. |
version |
String |
The desired map library version. |
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(control:IControl): voidRegisters a new control. This can be called before the MAP_READY event has been received.
public class MyMap extends Map {
public function MyMap() {
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
addControl(new MapTypeControl());
}
}| Parameter | Type | Description |
|---|---|---|
control |
IControl |
New control to register. |
addMapType(newMapType:IMapType): voidRegisters a new map type.
| Parameter | Type | Description |
|---|---|---|
newMapType |
IMapType |
New map type to register. |
addOverlay(overlay:IOverlay): voidAdds an overlay 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);| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
The overlay to be added to the map. |
callLater(call:Function): void| Parameter | Type | Description |
|---|---|---|
call |
Function |
clearControls(): voidRemoves all controls from the map.
clearOverlays(): voidRemoves all overlays from the map.
closeInfoWindow(): BooleanCloses the information window.
continuousZoomEnabled(): BooleanChecks whether continuous zoom is enabled.
controlByKeyboardEnabled(): BooleanChecks whether control by keyboard is enabled.
crosshairsEnabled(): BooleanChecks whether center crosshairs are enabled.
delayCall(call:Function): voidDelay a method call until the next frame.
| Parameter | Type | Description |
|---|---|---|
call |
Function |
Method to invoke in the next frame. |
disableContinuousZoom(): voidDisables continuous smooth zooming.
disableControlByKeyboard(): voidDisables control by keyboard.
disableCrosshairs(): voidDisables the center crosshairs.
disableDragging(): voidDisables dragging of the map.
disableScrollWheelZoom(): voidDisables zooming using a mouse's scroll wheel.
draggingEnabled(): BooleanChecks whether dragging of the map is enabled.
enableContinuousZoom(): voidEnables continuous smooth zooming.
enableControlByKeyboard(): voidEnables control by keyboard.
enableCrosshairs(): voidEnables the center crosshairs.
enableDragging(): voidEnables dragging of the map.
enableScrollWheelZoom(): voidEnables zooming using a mouse's scroll wheel.
fromLatLngToPoint(latLng:LatLng, opt_zoom?:Number): PointReturns 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).
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
latLng location on the map |
opt_zoom? |
Number |
target zoom level (defaults to current zoom level) |
fromLatLngToViewport(latLng:LatLng, opt_disablewrap?:Boolean): PointReturns 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).
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng coordinate of the point on the map. |
opt_disablewrap? |
Boolean |
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 center of the map and the target location crosses the +180/-180 degree longtitude wrap-around. For example, the map is currently centered 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 center 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 center (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 center of the map to the target point does not cross the +180/-180 degree longtitude (such as in case where the current center of the map is Sydney, Australia while the target location is Tokyo, Japan). |
fromPointToLatLng(pos:Point, opt_zoom?:Number, opt_nowrap?:Boolean): LatLngReturns 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).
| Parameter | Type | Description |
|---|---|---|
pos |
Point |
x, y of a point |
opt_zoom? |
Number |
target zoom level (defaults to the current zoom level) |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180, 180) |
fromViewportToLatLng(pos:Point, opt_nowrap?:Boolean): LatLngReturns the lat-lng of the point at the given coordinates in the map's view port (the top left corner of the map object).
| Parameter | Type | Description |
|---|---|---|
pos |
Point |
Coordinates in the map's view port. |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180, 180) |
getBoundsZoomLevel(bounds:LatLngBounds): NumberReturns 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.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Bounds to show. |
getCenter(): LatLngRetrieves coordinates of the center in the map view control.
getCurrentMapType(): IMapTypeRetrieves the current map type.
getDisplayObject(): DisplayObjectRetrieves the display object that represents the map.
getDoubleClickMode(): NumberGet the mouse double click mode.
getImplementationVersion(): StringGets the version of the implementation library SWF.
getInterfaceVersion(): StringRetrieves the version of the client interface.
getLatLngBounds(): LatLngBoundsReturns the the visible rectangular region of the map view in geographical coordinates.
getMapTypes(): ArrayRetrieves the list of the map types available for the location.
getMaxZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): NumberRetrieves the maximum zoom level.
| Parameter | Type | Description |
|---|---|---|
opt_mapType? |
IMapType |
Map type used to determine maximum resolution. |
opt_point? |
LatLng |
Point for which to get the maximum zoom. |
getMinZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): NumberRetrieves the minimum zoom level.
| Parameter | Type | Description |
|---|---|---|
opt_mapType? |
IMapType |
MapType to determine minimum resolution. |
opt_point? |
LatLng |
Point to get minimum zoom level for. |
getOptions(): MapOptionsRetrieves 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.
getPaneManager(): IPaneManagerRetrieves the pane manager for the map.
getPrintableBitmap(): Bitmap
Returns a Bitmap instance containing a snapshot image of the map for
printing.
The map itself may contain content loaded from multiple domains.
This method requires that the domain maps.googleapis.com is
granted access to any content that appears on the map via a
crossdomain.xml file. For example, if your map uses a
custom tile layer containing tiles loaded from URLs with the form
http://www.thirdpartymap.com/path/tile_x_y_z.png, place
a crossdomain.xml file at
http://www.thirdpartymap.com/path/crossdomain.xml.
Load this file using Security.loadPolicyFile() and when
loading the tile images ensure that you use a LoaderContext
instance whose checkPolicyFile property is
true.
Note that by using path/ in the above URLs you can grant
maps.googleapis.com privileged access only to content below
http://www.thirdpartymap.com/path/, rather than to all content
on www.thirdpartymap.com.
getProjection(): IProjectionReturns the projection being applied to the map.
getSize(): PointRetrieves the map view size.
getZoom(): NumberRetrieves the map zoom level.
isLoaded(): BooleanChecks whether the map has been initialized.
openInfoWindow(latlng:LatLng, options?:InfoWindowOptions): IInfoWindowOpens a simple information window at the given point.
| Parameter | Type | Description |
|---|---|---|
latlng |
LatLng |
Point at which the info window is opened. |
options? |
InfoWindowOptions |
Info window options. |
panBy(distance:Point, animate?:Boolean): voidStarts a pan animation by the given distance in pixels.
| Parameter | Type | Description |
|---|---|---|
distance |
Point |
Distance in pixels |
animate? |
Boolean |
Whether the change may be animated. |
panTo(latLng:LatLng): voidChanges the center location of the map to the given location. If the location is already visible in the current map view, changes the center in a smooth animation.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new center. |
removeControl(control:IControl): voidRemoves a control from the map. If the control was not added to the map, this does nothing.
| Parameter | Type | Description |
|---|---|---|
control |
IControl |
The control to remove. |
removeMapType(oldMapType:IMapType): voidRemoves a registered map type.
| Parameter | Type | Description |
|---|---|---|
oldMapType |
IMapType |
Map type to unregister. |
removeOverlay(overlay:IOverlay): voidRemoves an overlay from the map.
| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
Overlay to be removed from the map. |
returnToSavedPosition(): voidReturns map to the saved position.
savePosition(): voidStores the current map position and zoom level for later recall by returnToSavedPosition.
scrollWheelZoomEnabled(): BooleanChecks whether scroll wheel zooming is enabled.
setCenter(latLng:LatLng, opt_zoom?:Number, opt_mapType?:IMapType): voidChanges the center location of the map.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new center. |
opt_zoom? |
Number |
New zoom level. |
opt_mapType? |
IMapType |
New map type. |
setDoubleClickMode(val:Number): voidSet the mouse double click mode.
| Parameter | Type | Description |
|---|---|---|
val |
Number |
mouse double click mode (one of the MapAction constants). |
setInitOptions(options:MapOptions): voidSets 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.
| Parameter | Type | Description |
|---|---|---|
options |
MapOptions |
Instance of MapOptions that overrides the defaults used to initialize the map; or null to use only the default options. |
setMapType(mapType:IMapType): voidChanges the map type for the map.
| Parameter | Type | Description |
|---|---|---|
mapType |
IMapType |
Map type. |
setSize(newSize:Point): voidSets the size of the map view.
| Parameter | Type | Description |
|---|---|---|
newSize |
Point |
New view size for the map. |
setZoom(level:Number, opt_doContinuousZoom?:Boolean): voidChanges the zoom level for the map view control.
| Parameter | Type | Description |
|---|---|---|
level |
Number |
New zoom level. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
unload(): voidRemoves 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(opt_latlng?:LatLng, opt_doCenter?:Boolean, opt_doContinuousZoom?:Boolean): voidZooms in the map by one zoom level if possible.
| Parameter | Type | Description |
|---|---|---|
opt_latlng? |
LatLng |
If set, this is the point around which we zoom. Otherwise we will zoom in around the center of the map. |
opt_doCenter? |
Boolean |
If true, we also want to center at opt_latlng. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
zoomOut(opt_latlng?:LatLng, opt_doContinuousZoom?:Boolean): voidZooms out the map by one zoom level if possible.
| Parameter | Type | Description |
|---|---|---|
opt_latlng? |
LatLng |
If set, this is the point around which we zoom. Otherwise we will zoom out around the center of the map. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
This is the main class of the Maps API for Flash that supports 3-D maps.
You should base your map on this class, rather than on
com.google.maps.Map when you wish to use perspective or
orthogonal views of the map and its contents.
Map has a number of properties used for global configuration.
It is important to note that these values are only used during
initialization. While they can later be set to different values,
doing so will have no effect upon the map.
You should ensure that these properties are set to appropriate values
before the map is added as a child of another display object.
The properties in this category are:
countryCode
key
language
languages (AIR only)
url (AIR only)
version.
| Name | Type | Description |
|---|---|---|
camera |
ICamera |
The camera that provides methods for transforming coordinates when in 3-D viewing modes. |
dragMode |
int |
The drag mode that is being used on the map. Acceptable values for this property are MapAction.DRAGMODE_LATLNG, MapAction.DRAGMODE_PITCH and MapAction.DRAGMODE_YAW. By default, the drag mode is updated automatically immediately before dispatching MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP events based on the state of the CTRL and SHIFT keyboard modifier keys. If CTRL is pressed, the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH, else if SHIFT is pressed the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH, else the drag mode is set to MapAction.DRAGMODE_LATLNG. It is recommended that you keep this behavior. It is consistent with that in Google Earth. However, if you need to change it, you should attach listeners both to MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP. Within your handler you then can set an appropriate map dragging mode based on parameters including mouse location and keyboard modifier key state. Note that since the drag mode can change immediately before, and while handling, MapMouseEvent.DRAG_STEP, a new drag mode can begin without the user having first released the mouse button. If the drag mode is changed in the middle of a drag operation, you will receive DRAG_STOP and DRAG_START events before the drag operation proceeds with the new drag mode. |
viewMode |
int |
The view mode that is being applied to map. Acceptable values for this property are View.VIEWMODE_2D, View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL. |
Map3D()
Constructs a Map3D instance.
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.
cancelFlyTo(): void
Aborts any map motion initiated by a call to flyTo() and
causes MapEvent.FLY_TO_CANCELED and
MapEvent.FLY_TO_DONE to be dispatched.
Has no effect if no flight is occurring.
flyTo(center:LatLng, zoom?:Number, attitude?:Attitude, duration?:Number): void
Changes the center location, zoom and attitude of the map over a given
period. You can use a period of 0 if you wish the change to be
instantaneous.
You can make repeated calls to flyTo before animation
has completed for a previous call if you wish to fly a complex route.
Each flight segment will be queued and performed in sequence. If more than
one flight segment is queued then cubic splines will be used to
interpolate the camera location and attitude.
By default the user can interact with the map while a flight is
occurring and doing so will not terminate the flight (it will
continue through the remaining segments from the time the user releases
control). However, a method cancelFlyTo() is available
if you wish to abort the remaining portion of the flight.
MapEvent.FLY_TO_DONE is dispatched when the flight
terminates (whether or not it was canceled).
| Parameter | Type | Description |
|---|---|---|
center |
LatLng |
Coordinates for the new map center. |
zoom? |
Number |
New map zoom level. |
attitude? |
Attitude |
New map attitude. |
duration? |
Number |
Duration in seconds over which the change occurs. |
getAttitude(): AttitudeGets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.
setAttitude(value:Attitude): voidSets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.
| Parameter | Type | Description |
|---|---|---|
value |
Attitude |
New map attitude. |
setInitOptions(options:MapOptions): voidSets the options used to initialize the Map. 3-D maps, by default, have controlByKeyboard set true (developers are free to override this if they wish). The implementation here, that merges new defaults with passed-in options, is necessary since the property Map.options is private and so not directly accessible.
| Parameter | Type | Description |
|---|---|---|
options |
MapOptions |
Constants used to identify map actions.
| Name | Value | Description |
|---|---|---|
ACTION_NOTHING |
3 |
No action. |
ACTION_PAN |
0 |
Pan action. |
ACTION_PAN_ZOOM_IN |
2 |
Pan and zoom-in action. |
ACTION_ZOOM_IN |
1 |
Zoom-in action. |
DRAGMODE_CAMERA_YAW_PITCH |
4 |
Mouse drag changes camera yaw and pitch on a 3-D map. |
DRAGMODE_LATLNG |
0 |
Mouse drag changes map latitude and longitude (map center). |
DRAGMODE_MAP_YAW_PITCH |
3 |
Mouse drag changes yaw and pitch of a 3-D map. |
DRAGMODE_PITCH |
1 |
Mouse drag changes pitch of a 3-D map. |
DRAGMODE_YAW |
2 |
Mouse drag changes yaw of a 3-D map. |
A MapAttitudeEvent object is dispatched into the event flow whenever the map attitude is changing.
| Name | Value | Description |
|---|---|---|
ATTITUDE_CHANGE_END |
mapevent_attitudechangeend |
This event is fired when the change of the map view ends. |
ATTITUDE_CHANGE_START |
mapevent_attitudechangestart |
This event is fired when the map attitude starts changing. |
ATTITUDE_CHANGE_STEP |
mapevent_attitudechangestep |
This event is fired repeatedly while the map attitude is changing. |
| Name | Type | Description |
|---|---|---|
attitude |
Attitude |
Attitude of the map. |
MapAttitudeEvent(type:String, attitude:Attitude, bubbles?:Boolean, cancellable?:Boolean)Creates a MapMoveEvent object to pass as a parameter to event listeners.
| Parameter | Type | Description |
|---|---|---|
type |
String |
The type of the event, accessible as MapMoveEvent.type. |
attitude |
Attitude |
Map's latLng. |
bubbles? |
Boolean |
Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. |
cancellable? |
Boolean |
Determines whether the Event object can be cancelled. The default values is false. |
A MapEvent object is dispatched into the event flow whenever map-specific events occur. Map events may be dispatched by the map object itself or its elements (i.e. overlays/infowindows etc).
| Name | Value | Description |
|---|---|---|
CONTROL_ADDED |
mapevent_controladded |
This event is fired on the map when a control is added to the map. |
CONTROL_REMOVED |
mapevent_controlremoved |
This event is fired on the map when a control is removed from the map. |
COPYRIGHTS_UPDATED |
mapevent_copyrightsupdated |
This event is fired when the copyright that should be displayed on the map is updated. Dispatched by MapType and CopyrightCollection objects. |
FLY_TO_CANCELED |
mapevent_flytocanceled |
This event is fired when the map motion produced by a call to
|
FLY_TO_DONE |
mapevent_flytodone |
This event is fired when the map motion produced by a call to
|
INFOWINDOW_CLOSED |
mapevent_infowindowclosed |
This event is fired when the info window closes. The event INFOWINDOW_CLOSING is fired before this event. If a currently open info window is reopened at a different point using another call to openInfoWindow(), the events INFOWINDOW_CLOSING, INFOWINDOW_CLOSED and INFOWINDOW_OPENED are fired in this order. |
INFOWINDOW_CLOSING |
mapevent_infowindowclosing |
This event is fired before the info window closes. |
INFOWINDOW_OPENED |
mapevent_infowindowopened |
This event is fired when the info window opens. |
MAPTYPE_ADDED |
mapevent_maptypeadded |
This event is fired when a new MapType has been added to the map. Note that this is a separate event from MAPTYPE_CHANGED, which indicates that the map type has changed, rather than just the map can now support this neew map type. |
MAPTYPE_CHANGED |
maptypechanged |
This event is fired when another map type is selected. |
MAPTYPE_REMOVED |
mapevent_maptyperemoved |
This event is fired when a MapType has been removed from the map. |
MAP_PREINITIALIZE |
mapevent_mappreinitialize |
This event is fired immediately before the map is initialized. This event indicates the correct time to call setInitOptions(...) on the map, passing an instance of MapOptions that contains options that the map should have when first displayed. |
MAP_READY |
mapevent_mapready |
This event is fired when map initialization is complete and isLoaded() would return true. This means position, zoom and map type are all initialized, but tile images may still be loading. |
OVERLAY_BEFORE_REMOVED |
mapevent_overlaybeforeremoved |
This event is fired when an overlay is about to be removed from the map. |
OVERLAY_MOVED |
mapevent_overlaymoved |
This event is fired when an overlay's position is changed. This currently applies only to markers and is fired either at the end of dragging or after a call to setLatLng(). |
OVERLAY_REMOVED |
mapevent_overlayremoved |
This event is fired after a single overlay is removed from the map. Developers can use this event to do final clean-up on an overlay instance. |
SIZE_CHANGED |
mapevent_sizechanged |
This event is fired when the size of the map has changed. |
TILES_LOADED |
mapevent_tilesloaded |
This event is fired when all visible target tiles have finished loading.
Target tiles are the tiles that we ideally use to render the map. The
distinction between target tiles and all tiles is relevant mainly when
displaying a 3-D map. The target tiles make up the set of tiles that
we wish to use to render the map. However, while any of these tiles
have not yet been loaded we may use lower or higher resolution tiles
in their place so that holes do not appear in the rendered map.
Note that this event is dispatched repeatedly during normal
panning and zooming of the map.
If you wish to detect when the map's tiles are first loaded,
attach a listener for this event while handling
|
TILES_LOADED_PENDING |
mapevent_tilesloadedpending |
This is a companion event to |
VIEW_CHANGED |
mapevent_viewchanged |
This event is fired when the map view changes. |
VISIBILITY_CHANGED |
mapevent_visibilitychanged |
This event is fired when an overlay's visibility has changed (from visible to hidden or vice-versa). |
| Name | Type | Description |
|---|---|---|
feature |
Object |
The object that the event refers to (such as an instance of IMapType for MapEvent.MAPTYPE_ADDED event or an instance of IControl for MapEvent.CONTROL_REMOVED). |
MapEvent(type:String, feature:Object, bubbles?:Boolean, cancellable?:Boolean)Creates an Event object to pass as a parameter to event listeners.
| Parameter | Type | Description |
|---|---|---|
type |
String |
The type of the event, accessible as MapEvent.type. |
feature |
Object |
Map feature (overlay, control or the map itself) that the event relates to. A MapEvent may be dispatched either on the map itself (in which case the target and feature will be different as the map will be the target) or on a feature (in which case the feature field will match the target). |
bubbles? |
Boolean |
Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. |
cancellable? |
Boolean |
Determines whether the Event object can be cancelled. The default value is false. |
A MapMouseEvent object is dispatched into the event flow whenever a mouse-related event specific to the map or its overlays occurs.
| Name | Value | Description |
|---|---|---|
CLICK |
mapevent_click |
This event is fired when the map is clicked with the mouse. If the click was on a clickable overlay (like a Marker, Polygon, etc), then then an event is also fired on the overlay. |
DOUBLE_CLICK |
mapevent_doubleclick |
This event is fired when a double click is done on the map. Note that this event will not be fired if the double click was on a marker or other clickable overlay. |
DRAG_END |
mapevent_dragend |
This event is fired when the user stops dragging the map. |
DRAG_START |
mapevent_dragstart |
This event is fired when the user starts dragging the map. |
DRAG_STEP |
mapevent_dragstep |
This event is fired repeatedly while the user drags the map. |
MOUSE_DOWN |
mapevent_mousedown |
This event is fired when the user presses the mouse button over the map. |
MOUSE_MOVE |
mapevent_mousemove |
This event is fired when the mouse moves over the map. |
MOUSE_UP |
mapevent_mouseup |
This event is fired when the user releases the mouse button over the map. |
ROLL_OUT |
mapevent_rollout |
This event is fired when the user rolls the mouse off the map. |
ROLL_OVER |
mapevent_rollover |
This event is fired when the user rolls the mouse over the map. |
| Name | Type | Description |
|---|---|---|
altKey |
Boolean |
Whether the Alt key was pressed. |
ctrlKey |
Boolean |
Whether the Ctrl key was pressed. |
latLng |
LatLng |
LatLng over which the MapMouseEvent occurred. |
shiftKey |
Boolean |
Whether the Shift key was pressed. |
MapMouseEvent(type:String, feature:Object, latLng:LatLng, bubbles?:Boolean, cancellable?:Boolean, ctrlKey?:Boolean, altKey?:Boolean, shiftKey?:Boolean)Creates a MapMouseEvent object to pass as a parameter to event listeners.
| Parameter | Type | Description |
|---|---|---|
type |
String |
The type of the event, accessible as MapEvent.type. |
feature |
Object |
Map feature (e.g. overlay, control or the map itself) that the event relates to. For MapMouseEvent, this will match the event target. |
latLng |
LatLng |
Map's latLng. |
bubbles? |
Boolean |
Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. |
cancellable? |
Boolean |
Determines whether the Event object can be cancelled. The default values is false. |
ctrlKey? |
Boolean |
|
altKey? |
Boolean |
|
shiftKey? |
Boolean |
A MapMoveEvent object is dispatched into the event flow whenever the map view is changing.
| Name | Value | Description |
|---|---|---|
MOVE_END |
mapevent_moveend |
This event is fired when the change of the map view ends. |
MOVE_START |
mapevent_movestart |
This event is fired when the map view starts changing. This can be caused by dragging, in which case a MapMouseEvent.DRAG_START event is also fired, or by invocation of a method that changes the map view. |
MOVE_STEP |
mapevent_movestep |
This event is fired repeatedly while the map view is changing. If the change is caused as a result of dragging, MapMouseEvent.DRAG_STEP events will also be generated. |
| Name | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng over which the MapMoveEvent occurred. |
MapMoveEvent(type:String, latLng:LatLng, bubbles?:Boolean, cancellable?:Boolean)Creates a MapMoveEvent object to pass as a parameter to event listeners.
| Parameter | Type | Description |
|---|---|---|
type |
String |
The type of the event, accessible as MapMoveEvent.type. |
latLng |
LatLng |
Map's latLng. |
bubbles? |
Boolean |
Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. |
cancellable? |
Boolean |
Determines whether the Event object can be cancelled. The default values is false. |
MapOptions specifies a set of parameters for initialization of the map. Please note that there is a very specific time when you should use MapOptions and that is whilst handling a MapEvent.MAP_PREINITIALIZE event.
| Name | Type | Description |
|---|---|---|
attitude |
Attitude |
The camera attitude for 3-D view modes. You need to use a
|
backgroundFillStyle |
FillStyle |
The fill style for the map background. |
center |
LatLng |
The initial map center. |
continuousZoom |
Object |
A Boolean value that indicates whether the map initially uses continuous zooming. |
controlByKeyboard |
Object |
A Boolean value that indicates whether the map initially can be controlled by the keyboard. |
crosshairs |
Object |
A Boolean value that indicates whether the map initially has crosshairs. |
crosshairsStrokeStyle |
StrokeStyle |
The stroke style for crosshairs. |
doubleClickMode |
Object |
A Number value that specifies the initial map double-click mode. |
dragging |
Object |
A Boolean value that indicates whether the map initially supports dragging. |
mapType |
IMapType |
The initial map type. Note that if this is null then Google's default map type will be used. Set this if you wish to override this selection. |
mapTypes |
Array |
The initial map types with which the map initially is populated. Note that if this is null the Google's default list of map types will be used. Set this if you wish to override this set. |
mouseClickRange |
Object |
A Number value that indicates the maximum number of pixels that the mouse is allowed to move from where a MouseEvent.MOUSE_DOWN event occurred before any pending MapMouseEvent.CLICK and MapMouseEvent.DOUBLE_CLICK events are canceled. Generally, it is undesirable for a MapMouseEvent.CLICK event to occur after dragging the map; this property enforces this. |
overlayRaising |
Object |
A Boolean value that indicates whether automatic raising of overlays is initially enabled. |
viewMode |
Object |
An int value that indicates the map view mode. You need to use a
|
zoom |
Object |
A Number value that specifies the initial map zoom level. |
MapOptions(param?:Object)Constructs a new MapOptions object, optionally initializing it from an object.
// Creating a MapOptions instance that corresponds to the default
// configuration for creating a map.
var options:MapOptions = new MapOptions({
backgroundFillStyle: {
alpha: Alpha.OPAQUE,
color: Color.GRAY14
},
crosshairs: false,
crosshairsStrokeStyle: {
thickness: 1,
color: Color.BLACK,
alpha: 1,
pixelHinting: false
},
controlByKeyboard: false,
overlayRaising: true,
doubleClickMode: MapAction.ACTION_PAN_ZOOM_IN,
dragging: true,
continuousZoom: false,
mapType: null,
mapTypes: null,
center: new LatLng(0, 0),
zoom: 1
mouseClickRange: 2
});| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object that contains a set of initial values for the MapOptions instance. |
toString(): StringReturns a String representation of this object.
Defines a map type for the Map. A map type is a set of tile layers, a map projection, a tile size, and assorted other settings, such as link colors and copyrights.
| Name | Type | Description |
|---|---|---|
DEFAULT_MAP_TYPES |
Array |
Provides access to the list of default map types. |
HYBRID_MAP_TYPE |
IMapType |
Provides access to Hybrid Map Type |
NORMAL_MAP_TYPE |
IMapType |
Provides access to Normal Map Type |
PHYSICAL_MAP_TYPE |
IMapType |
Provides access to Physical Map Type |
SATELLITE_MAP_TYPE |
IMapType |
Provides access to Satellite Map Type |
MapType(tileLayers:Array, projection:IProjection, name:String, options?:MapTypeOptions)Creates an instance of MapType object (for custom map types).
| Parameter | Type | Description |
|---|---|---|
tileLayers |
Array |
Map's TileLayers. |
projection |
IProjection |
Map Projection. |
name |
String |
Map name. |
options? |
MapTypeOptions |
Map type options. |
getAlt(): StringReturns the text of the hint that is displayed when the user hovers over a control that allows selection of this map type. MapTypeControl is such a control.
getBoundsZoomLevel(bounds:LatLngBounds, viewSize:Point): NumberReturns the highest resolution zoom level required to show the given lat/lng bounds in a map of the given pixel size.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Bounds to show. |
viewSize |
Point |
Size of viewport. |
getCopyrights(bounds:LatLngBounds, zoom:Number): ArrayReturns an array of copyright notices for the given bounds and zoom level. Each element in this array is of type CopyrightNotice.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Current viewport. |
zoom |
Number |
Current zoom level. |
getErrorMessage(): StringReturns the text to be displayed if a tile fails to download.
getLinkColor(): NumberIf a control displays a link above the map, returns the color we should use. The "terms of use" link in the copyright control uses this color, for example.
getMaxResolutionOverride(): NumberReturns the max resolution override.
getMaximumResolution(opt_point?:LatLng): NumberReturns the zoom level of the maximum resolution supported by this map type. If opt_point is given, returns the maximum resolution at the given lat/lng. If opt_point is not given, returns the global maximum.
| Parameter | Type | Description |
|---|---|---|
opt_point? |
LatLng |
Point at which to evaluate resolution. |
getMinimumResolution(opt_point?:LatLng): NumberReturns the zoom level of the minimum resolution supported by this map type. If opt_point is given, returns the minimum resolution at the given lat/lng. If opt_point is not given, returns the global minimum.
| Parameter | Type | Description |
|---|---|---|
opt_point? |
LatLng |
Point at which to evaluate resolution (ignored). |
getName(opt_short?:Boolean): StringRetrieves the map type name.
| Parameter | Type | Description |
|---|---|---|
opt_short? |
Boolean |
Return the abbreviated name. |
getProjection(): IProjectionRetrieves the map type projection.
getRadius(): NumberReturns the radius of the planet for which this map type is defined.
getSpanZoomLevel(center:LatLng, span:LatLng, viewSize:Point): NumberReturns the highest resolution zoom level required to show the given lat/lng span with the given center point.
| Parameter | Type | Description |
|---|---|---|
center |
LatLng |
Center of viewport. |
span |
LatLng |
Span of viewport. |
viewSize |
Point |
Size of viewport in pixels. |
getTextColor(): NumberIf controls are textual, returns the appropriate color to display the text. The copyright control uses this color, for example.
getTileLayers(): ArrayGets the list of tile layers for this map type in the z-order they should be displayed. Note that this cannot be used to change the displayed tile layers after construction of a MapType instance. You must create a new MapType if you wish to display a different set of layers.
getTileSize(): NumberGets the tile size for this map type. The predefined map types' tiles are all 256 by 256 pixels in size: this function would, for these map types, return 256.
getUrlArg(): StringReturns a string that may be used as a URL parameter to identify this map type in permalinks to the current map view. This is currently only used internally. Note that if any built-in tile layers are used in constructing a custom map type, the returned value will be based on the set of layers rather than on any developer-supplied value.
setMaxResolutionOverride(maxResolution:Number): voidSets the max resolution override, such that, if this number is greater than the max resolution that our map type reports to us, we will use this number instead. It represents the number of levels shown on the ZoomControl's scrollbar.
| Parameter | Type | Description |
|---|---|---|
maxResolution |
Number |
Value to set max resolution override to. |
MapTypeOptions class specifies a set of parameters for map types.
| Name | Type | Description |
|---|---|---|
alt |
String |
Alternative text. |
errorMessage |
String |
Error message. |
linkColor |
Object |
A Number value that specifies the link color. |
maxResolution |
Object |
A Number value that specifies the maximum zoom level of this map type. |
minResolution |
Object |
A Number value that specifies the minimum zoom level of this map type. |
radius |
Object |
A Number value that specifies the radius of the map type measured in meters. |
shortName |
String |
Short name of the map type. |
textColor |
Object |
A Number value that specifies the text color. |
tileSize |
Object |
A Number value that specifies the tile size. |
urlArg |
String |
URL argument of the map type. |
MapTypeOptions(param?:Object)Constructs a new MapTypeOptions object, optionally initializing it from an object.
var options:MapTypeOptions = new MapTypeOptions({
shortName: "sea",
urlArg: "s",
maxResolution: 16,
minResolution: 4,
tileSize: 256,
textColor: Color.BLACK,
linkColor: Color.RED,
errorMessage: "This sea tile could not be loaded",
alt: "Sea images",
radius: 51118000
});| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object that contains a set of initial values for the MapTypeOptions instance. |
getDefaultOptions(): MapTypeOptionsRetrieves the MapTypeOptions instance that represents the default set of options that applies to all map types.
// Initialization object corresponding to the initial defaults.
{ shortName: new String(""),
urlArg: new String("c"),
tileSize: 256,
textColor: Color.BLACK,
linkColor: Color.DEFAULTLINK,
errorMessage: new String(""),
alt: new String(""),
radius: LatLng.EARTH_RADIUS
}setDefaultOptions(defaults:MapTypeOptions): void
Sets the default set of options that applies when new map types
are created.
Options may also be set for each individual map type.
If that is the case, options specified for an individual map type
will take precedence over the default options.
The defaults parameter may specify a complete or partial set
of map type options. If a partial set of options is specified, it will
supplement the existing defaults, overriding only the values that were
set explicitly and leaving the rest unchanged.
| Parameter | Type | Description |
|---|---|---|
defaults |
MapTypeOptions |
New default full or partial set of map type options. |
toString(): StringReturns a String representation of this object.
A MapMouseEvent object is dispatched into the event flow whenever the map is being zoomed in or out.
| Name | Value | Description |
|---|---|---|
CONTINUOUS_ZOOM_END |
mapevent_continuouszoomend |
This event is fired when continuous zooming of the map ends. It is followed by a ZOOM_CHANGED event. |
CONTINUOUS_ZOOM_START |
mapevent_continuouszoomstart |
This event is fired when continuous zooming of the map starts. |
CONTINUOUS_ZOOM_STEP |
mapevent_continuouszoomstep |
This event is fired repeatedly while the map is performing continuous zoom. |
ZOOM_CHANGED |
mapevent_zoomchanged |
This event is fired when the map has zoomed. |
ZOOM_RANGE_CHANGED |
mapevent_zoomrangechanged |
This event is fired when the available zoom range for the map changes. This occurs as a result of panning the map to a region where the available zoom levels has changed in comparison to what it previously was or when a change to the zoom range happens programmatically. The zoomLevel property of the respective MapZoomEvent will indicate the current zoom level of the map (which may or may not have changed). To obtain the new minimum and maximum zoom levels for the map, call Map.getMinZoomLevel() and Map.getMaxZoomLevel() methods. |
| Name | Type | Description |
|---|---|---|
zoomLevel |
Number |
Current zoom level for the map. |
MapZoomEvent(type:String, zoomLevel:Number, bubbles?:Boolean, cancellable?:Boolean)Creates a MapZoomEvent object to pass as a parameter to event listeners.
| Parameter | Type | Description |
|---|---|---|
type |
String |
The type of the event. |
zoomLevel |
Number |
Map zoom level. |
bubbles? |
Boolean |
Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false. |
cancellable? |
Boolean |
Determines whether the Event object can be cancelled. The default values is false. |
Constants used to identify panes on the map. Note that whilst each of these constants has a numeric value, pane ordering is managed independently of the actual values.
| Name | Value | Description |
|---|---|---|
PANE_FLOAT |
7 |
Pane holding floating content, default pane for info windows. |
PANE_MAP |
0 |
Bottom-most map pane, directly on top of the map. |
PANE_MARKER |
4 |
Marker pane, default pane for markers. |
PANE_OVERLAYS |
1 |
Overlays pane, default pane for polylines, polygons and ground overlays. |
ProjectionBase is an abstract base class for creating custom projections. Sub-class this and implement each method to create a custom projection for the map.
ProjectionBase()Constructs an instance of ProjectionBase.
fromLatLngToPixel(latLng:LatLng, zoom:Number): PointReturns the map pixel coordinates corresponding to the specified geographical location and zoom level.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Geographical location. |
zoom |
Number |
Zoom level. |
fromPixelToLatLng(pixel:Point, zoom:Number, opt_nowrap?:Boolean): LatLngReturns the geographical location corresponding to the specified map pixel coordinates and zoom level.
| Parameter | Type | Description |
|---|---|---|
pixel |
Point |
Map coordinates in pixels |
zoom |
Number |
Zoom level |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180,180) |
getWrapWidth(zoom:Number): NumberReturns the map periodicity in the x-direction: the number of pixels after which the map repeats itself because it wraps around the earth. By default, returns Infinity, i.e. the map does not repeat itself. This is used by the map to compute the placement of overlays on map views that contain more than one copy of the earth (this usually happens only at low zoom levels).
| Parameter | Type | Description |
|---|---|---|
zoom |
Number |
Zoom level. |
tileCheckRange(tile:Point, zoom:Number, tileSize:Number): BooleanTests whether the tile index is within the valid range for the map type (the map displays empty tiles outside of this range). Note that this function may modify the tile index to point to another instance of the same tile should the map contain more than one Earth.
| Parameter | Type | Description |
|---|---|---|
tile |
Point |
Tile coordinate. |
zoom |
Number |
Zoom level. |
tileSize |
Number |
The size of this tile. |
TileLayerBase is an abstract base class used to provide custom tile layers for the map. Sub-class this and override the appropriate methods to create a custom tile layer. You must override the loadTile() method. You are free to override the other methods as necessary for your application.
TileLayerBase(copyrightCollection:ICopyrightCollection, minResolution?:Number, maxResolution?:Number, alpha?:Number)Constructs a TileLayerBase instance. This should be called only from within the constructor of a class that extends TileLayerBase.
package com.mycompany.maps {
import com.google.maps.TileLayerBase;
public class MyTileLayer extends TileLayerBase {
public function MyTileLayer(copyrightCollection:ICopyrightCollection,
minResolution:Number = NaN,
maxResolution:Number = NaN,
alpha:Number=Alpha.OPAQUE) {
super(copyrightCollection, minResolution, maxResolution, alpha);
}
}
// :
// Overridden methods to implement a custom tile layer
// :
}| Parameter | Type | Description |
|---|---|---|
copyrightCollection |
ICopyrightCollection |
|
minResolution? |
Number |
|
maxResolution? |
Number |
|
alpha? |
Number |
getAlpha(): NumberReturns the opacity (alpha value) of this tile layer. The range of values for getAlpha() is [0,1]. A value of 0 means that the layer is invisible (fully transparent); a value of 1, fully opaque.
getCopyrightCollection(): ICopyrightCollectionRetrieves the copyright collection responsible for handling copyright for this tile layer.
getMapType(): IMapTypeRetrieves the map type for this tile layer.
getMaxResolution(): NumberReturns the finest zoom level.
getMinResolution(): NumberReturns the coarsest zoom level.
loadTile(tilePos:Point, zoom:Number): DisplayObjectCreates and loads a tile (x, y) at the given zoom level. You must override this and return a DisplayObject holding your custom tile. Do not call the base class version of this method in your sub-class' implementation.
public override function loadTile(
tilePos:Point, zoom:Number):DisplayObject {
var loader:Loader = new Loader();
var tileUrl:String = "http://tiles.mycompany.com/tile_" +
tilePos.x + "_" + tilePos.y + "_" + zoom + ".png";
loader.load(new URLRequest(tileUrl));
return loader;
}| Parameter | Type | Description |
|---|---|---|
tilePos |
Point |
Tile coordinates. |
zoom |
Number |
Tile zoom. |
setMapType(mapType:IMapType): voidSets the map type for this tile layer.
| Parameter | Type | Description |
|---|---|---|
mapType |
IMapType |
Map type. |
Class View provides constants for use with 3-D maps.
| Name | Value | Description |
|---|---|---|
VIEWMODE_2D |
0 |
Conventional 2-D map view. |
VIEWMODE_ORTHOGONAL |
2 |
3-D orthogonal map view. This is an alternative to VIEW_PERSPECTIVE that provides limited depth cues but lacks scaling of features with distance. If using Flash 9, VIEW_ORTHOGONAL will result in more rapid rendering. |
VIEWMODE_PERSPECTIVE |
1 |
3-D perspective map view. Perspective projection requires significant computation on Flash 9, but is natively supported by Flash 10. If targeting Flash 9 you may wish to consider using VIEW_ORTHOGONAL, which will result in more rapid rendering. |
Base class for controls. Sub-class this to provide a custom control for the map.
| Name | Type | Description |
|---|---|---|
map |
IMap |
|
position |
ControlPosition |
ControlBase(position:ControlPosition)Construct a control located relative to a specfied corner of the map.
// MyControl is a developer-created sub-class of ControlBase.
var control:MyControl = new MyControl(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
Positioning of the control relative to the map. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (typically, the control itself).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that the control operates on. Normally invoked automatically from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
Map interface |
setControlPosition(controlPosition:ControlPosition): voidChanges control's position.
| Parameter | Type | Description |
|---|---|---|
controlPosition |
ControlPosition |
Control's new position. |
ControlPosition describes the position of a control in the map view. It specifies which corner of the map view is to be treated as a reference point and the X and Y padding offsets from this corner.
| Name | Value | Description |
|---|---|---|
ANCHOR_BOTTOM_LEFT |
0x20 |
The control will be anchored in the bottom left corner of the map. |
ANCHOR_BOTTOM_RIGHT |
0x21 |
The control will be anchored in the bottom right corner of the map. |
ANCHOR_TOP_LEFT |
0 |
The control will be anchored in the top left corner of the map. |
ANCHOR_TOP_RIGHT |
1 |
The control will be anchored in the top right corner of the map. |
AUTO_ALIGN_NONE |
0 |
The control will not be automatically aligned. |
AUTO_ALIGN_X |
1 |
The control will be aligned automatically horizontally so as not to overlap with one another. |
AUTO_ALIGN_Y |
2 |
The control will be aligned automatically vertically so as not to overlap with one another. |
ControlPosition(anchor:Number, opt_paddingX?:Number, opt_paddingY?:Number, opt_autoAlign?:uint)Constructs a ControlPosition from offsets relative to a specified map corner.
// Create a ControlPosition instance to anchor a control 16 pixels // left of and 10 pixels below the top-right corner of the map. var position:ControlPosition = new ControlPosition( ControlPosition.ANCHOR_TOP_RIGHT, 16, 10);
| Parameter | Type | Description |
|---|---|---|
anchor |
Number |
Anchor type. |
opt_paddingX? |
Number |
Horizontal padding (defaults to 0). |
opt_paddingY? |
Number |
Vertical padding (if different from horizontal padding). |
opt_autoAlign? |
uint |
Sets whether the control should be automatically aligned. |
equals(other:ControlPosition): BooleanTests against another ControlPosition for equality.
| Parameter | Type | Description |
|---|---|---|
other |
ControlPosition |
ControlPosition to compare with. |
getAnchor(): NumberRetrieves the anchor identifier.
// Test whether a position is anchored to the map's bottom-left
// corner.
if (position.getAnchor()==ControlPosition.ANCHOR_BOTTOM_LEFT)
trace("Positioned relative to the map's bottom-left corner.");getAutoAlign(): uintRetrieves the automatic alignment type.
getOffsetX(): NumberRetrieves the horizontal offset.
getOffsetY(): NumberRetrieves the vertical offset.
toString(): StringString representation of position object.
A MapTypeControl provides a control for selecting and switching between supported map types via buttons. Controls will be made available for all map types currently attached to the map at the time the control is constructed. By default, maps support the set of MapType.DEFAULT_MAP_TYPES; additional map types can be added explicitly via Map.addMapType().
MapTypeControl(options?:MapTypeControlOptions)Constructs a MapTypeControl object.
| Parameter | Type | Description |
|---|---|---|
options? |
MapTypeControlOptions |
Map type control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
Class MapTypeControlOptions specifies a set of options for the map type control.
| Name | Value | Description |
|---|---|---|
ALIGN_HORIZONTALLY |
0 |
Align buttons horizontally |
ALIGN_VERTICALLY |
1 |
Align buttons vertically |
| Name | Type | Description |
|---|---|---|
buttonAlignment |
Object |
A Number value that specifies button alignment (one of MapTypeControlOptions.ALIGN_HORIZONTALLY or MapTypeControlOptions.ALIGN_VERTICALLY). |
buttonSize |
Point |
Button size. |
buttonSpacing |
Point |
Button spacing. This is a Point so that buttons can be laid out both horizontally and vertically, with the appropriate coordinate used to space buttons in each case. |
buttonStyle |
ButtonStyle |
Button style. |
position |
ControlPosition |
Control's position on the map. |
MapTypeControlOptions(param?:Object)Constructs an MapTypeControlOptions object, optionally initializing it from an object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{ buttonSize: new Point(67, 19),
buttonStyle: new ButtonStyle({
}),
buttonSpacing: new Point(0, 0),
buttonAlignment: MapTypeControlOptions.ALIGN_HORIZONTALLY,
position: new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 10)
} |
toString(): StringReturns a String representation of this object.
NavigationControl allows the user to change the navigation parameters of the map - zoom, center and attitude (for a 3D map).
NavigationControl(options?:NavigationControlOptions)Constructs a NavigationControl object.
| Parameter | Type | Description |
|---|---|---|
options? |
NavigationControlOptions |
NavigationControl control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
Class NavigationControlOptions specifies a set of options for the navigation control.
| Name | Type | Description |
|---|---|---|
position |
ControlPosition |
Control's position on the map. |
NavigationControlOptions(param?:Object)Constructs an instance of NavigationControlOptions, optionally initializing it from a generic object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{
position: new ControlPosition(ControlPosition.ANCHOR_TOP_LEFT, 10)
}
|
toString(): StringReturns a String representation of this object.
A OverviewMapControl shows a small map in the corner of the containing map and displays a rectangle representing the containing map viewport. The rectangle can be dragged, or the overview map can be dragged to update the viewport.
OverviewMapControl(options?:OverviewMapControlOptions)Constructs a OverviewMapControl object.
| Parameter | Type | Description |
|---|---|---|
options? |
OverviewMapControlOptions |
Map overview control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
setSize(newSize:Point): voidChanges the control's size.
| Parameter | Type | Description |
|---|---|---|
newSize |
Point |
Control's new size in pixels. |
Class OverviewMapControlOptions specifies a set of options for the overview map control.
| Name | Type | Description |
|---|---|---|
controlStyle |
BevelStyle |
Control's bevel style. |
navigatorStyle |
RectangleStyle |
Navigator window stroke style. |
padding |
Point |
Gap between the border and the content of the control. |
position |
ControlPosition |
Control's position on the map. |
size |
Point |
Control's size. |
OverviewMapControlOptions(param?:Object)Constructs an OverviewMapControlOptions object, optionally initializing it from an object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{ size: {
x: 100,
y: 100
},
padding: {
x: 4,
y: 4
},
controlStyle: {
fillStyle: {
color: Color.WHITE,
alpha: 1.0
},
strokeStyle: {
color: Color.BLACK,
alpha: 1.0,
thickness: 1.0
},
bevelStyle: BevelStyle.BEVEL_RAISED,
bevelThickness: 2.0,
bevelAlpha: 0.6,
highlightColor: Color.WHITE,
shadowColor: Color.BLACK
},
navigatorStyle: {
fillStyle: {
color: NAVIGATOR_COLOR,
alpha: Alpha.PERCENT_20
},
strokeStyle: {
thickness: 2,
color: NAVIGATOR_COLOR,
alpha: 1.0
}
},
position: new ControlPosition(ControlPosition.ANCHOR_BOTTOM_RIGHT, 10)
} |
toString(): StringtoString method.
A PositionControl contains a set of panning buttons to pan the map.
PositionControl(options?:PositionControlOptions)Constructs a PositionControl object.
| Parameter | Type | Description |
|---|---|---|
options? |
PositionControlOptions |
Position control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
Class PositionControlOptions specifies a set of options for the position control.
| Name | Type | Description |
|---|---|---|
buttonSize |
Point |
Button size. |
buttonSpacing |
Point |
Button spacing. |
buttonStyle |
ButtonStyle |
Button style. |
position |
ControlPosition |
Control's position on the map. |
PositionControlOptions(param?:Object)Constructs an PositionControlOptions object, optionally initializing it from an object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{ buttonSize: new Point(17, 17),
buttonStyle: new ButtonStyle({
}),
buttonSpacing: new Point(4, 4),
position: new ControlPosition(ControlPosition.ANCHOR_TOP_LEFT, 10)
} |
toString(): StringtoString method. Returns a String representation of this object.
A ScaleControl provides a control that shows the scale of the map.
ScaleControl(options?:ScaleControlOptions)Constructs a ScaleControl object.
| Parameter | Type | Description |
|---|---|---|
options? |
ScaleControlOptions |
Scale control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
Class ScaleControlOptions specifies a set of options for the scale control.
| Name | Value | Description |
|---|---|---|
UNITS_BOTH |
0 |
Show both imperial and metric scale indicators. |
UNITS_BOTH_PREFER_IMPERIAL |
2 |
Show both imperial and metric scale indicators with the imperial scale indicator appearing on top. |
UNITS_BOTH_PREFER_METRIC |
1 |
Show both imperial and metric scale indicators with the metric scale indicator appearing on top. |
UNITS_IMPERIAL_ONLY |
6 |
Show only the imperial scale indicator. |
UNITS_METRIC_ONLY |
5 |
Show only the metric scale indicator. |
UNITS_SINGLE |
4 |
Show only one scale indicator, chosen based upon the user's locale. |
| Name | Type | Description |
|---|---|---|
labelFormat |
TextFormat |
Format for the label(s) of the control. |
lineThickness |
Object |
An integer value indicating the thickness of the lines in the scale control. |
maxWidth |
Object |
A number indicating the maximum width of the scale control. |
position |
ControlPosition |
Control's position on the map. |
units |
Object |
Units that are shown by the scale control. One of the ScaleControlOptions.UNITS_ constants. |
ScaleControlOptions(param?:Object)Constructs an ScaleControlOptions object, optionally initializing it from an object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{ position: new ControlPosition(ControlPosition.ANCHOR_BOTTOM_LEFT, 70, 5)
units: ScaleControlOptions.UNITS_BOTH,
maxWidth: 125,
lineThickness: 1,
labelFormat: {
font: "_sans",
size: 11
}
} |
toString(): StringReturns a String representation of this object.
A ZoomControl contains buttons for zooming the map in and out and a zoom slider.
ZoomControl(options?:ZoomControlOptions)Constructs a ZoomControl object, with an optional options setting.
| Parameter | Type | Description |
|---|---|---|
options? |
ZoomControlOptions |
Zoom control options. |
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
Class ZoomControlOptions specifies a set of options for the zoom control.
| Name | Type | Description |
|---|---|---|
buttonSize |
Point |
Button size. |
buttonSpacing |
Point |
Button spacing. |
buttonStyle |
ButtonStyle |
Button style. |
hasScrollTrack |
Object |
A Boolean value that specifies whether we have a scroll track. |
position |
ControlPosition |
Control's position on the map. |
ZoomControlOptions(param?:Object)Constructs an ZoomControlOptions object, optionally initializing it from an object.
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. // Initialization object corresponding to the default set.
{ buttonSize: new Point(17, 17),
buttonStyle: new ButtonStyle({
allStates: {
bevelThickness: 1.5,
bevelAlpha: 0.5
}
}),
buttonSpacing: new Point(4, 4),
hasScrollTrack: true,
position: new ControlPosition(ControlPosition.ANCHOR_TOP_LEFT, 31, 76)
} |
toString(): StringReturns a String representation of this object.
Attitude represents the rotation of an object in space.
| Name | Type | Description |
|---|---|---|
pitch |
Number |
|
roll |
Number |
|
yaw |
Number |
|
Attitude(yaw:Number, pitch:Number, roll:Number)Initializes roll, pitch, and yaw. All default to zero, which represents an object looking directly at the ground.
| Parameter | Type | Description |
|---|---|---|
yaw |
Number |
Yaw in degrees. |
pitch |
Number |
Pitch in degrees. |
roll |
Number |
Roll in degrees. |
equals(other:Attitude): BooleanDetermines whether this attitude is identical to another attitude.
| Parameter | Type | Description |
|---|---|---|
other |
Attitude |
The other attitude. |
toString(): StringGenerates a string representation of this object. This method returns a string listing, in order, the yaw, pitch and roll angles in degrees, comma-separated and enclosed in parentheses. An example is "(10, 20, 0)".
Point3D represents a position in a 3-D coordinate system. It is used to hold x, y, z coordinate values.
| Name | Type | Description |
|---|---|---|
x |
Number |
x coordinate. |
y |
Number |
y coordinate. |
z |
Number |
z coordinate. |
Point3D(x:Number, y:Number, z:Number)Constructs a Point3D instance and initializes x, y and z.
| Parameter | Type | Description |
|---|---|---|
x |
Number |
Initial x value. |
y |
Number |
Initial y value. |
z |
Number |
Initial z value.. |
toString(): StringReturns a string that contains the values of the x, y and z coordinates. The string has the form "(x=x, y=y, z=z)", so calling the toString() method for a point at 12,15,16 would return "(x=12, y=15, z=16)".
TransformationGeometry holds the geometry information necessary to reconstruct the camera projection that transforms world coordinates into viewport coordinates and vice-versa. Point3D instances are used to return values with x, y and z coordinate values.
| Name | Type | Description |
|---|---|---|
cameraPosition |
Point3D |
Camera position in world coordinates. |
cameraXAxis |
Point3D |
Normalized vector that is the projection of the camera x-axis into world coordinates. |
cameraYAxis |
Point3D |
Normalized vector that is the projection of the camera y-axis into world coordinates. |
cameraZAxis |
Point3D |
Normalized vector that is the projection of the camera z-axis into world coordinates. |
focalLength |
Number |
Distance from the camera to the viewport.
The relationship between |
viewportSize |
Point |
Size of the viewport in pixels. |
TransformationGeometry(cameraPosition:Point3D, cameraXAxis:Point3D, cameraYAxis:Point3D, cameraZAxis:Point3D, viewportSize:Point, focalLength:Number)Constructs a TransformationGeometry instance and initializes its properties.
| Parameter | Type | Description |
|---|---|---|
cameraPosition |
Point3D |
Camera position in world coordinates. |
cameraXAxis |
Point3D |
Normalized vector that is the projection of the camera x-axis into world coordinates. |
cameraYAxis |
Point3D |
Normalized vector that is the projection of the camera y-axis into world coordinates. |
cameraZAxis |
Point3D |
Normalized vector that is the projection of the camera z-axis into world coordinates. |
viewportSize |
Point |
Size of the viewport in pixels. |
focalLength |
Number |
Distance from the camera to the viewport. |
Interface ICamera provides access to viewing geometry and transformation methods needed when using a map with perspective. Use Map3D.camera to return the map's camera as an ICamera instance.
| Name | Type | Description |
|---|---|---|
attitude |
Attitude |
Map attitude. |
center |
LatLng |
Map center. |
focalLength |
Number |
Camera focal length. |
is3D |
Boolean |
Whether we are in 3-D view. |
maxPitch |
Number |
Maximum pitch in degrees. |
maxRoll |
Number |
Maximum roll in degrees. |
maxYaw |
Number |
Maximum yaw in degrees. |
minPitch |
Number |
Minimum pitch in degrees. |
minRoll |
Number |
Minimum roll in degrees. |
minYaw |
Number |
Minimum yaw in degrees. |
shadowMatrix |
Matrix |
Transformation matrix to apply to an image drawn on the viewport to generate its shadow (drawn on the viewport, but appears to stretch along the map). |
viewport |
Point |
Viewport size. |
zoom |
Number |
Map zoom. |
zoomScale |
Number |
Map zoom scale. |
getLatLngClosestToCenter(latLng:LatLng): LatLng
This method takes a LatLng and returns a
LatLng that either is the same, or is adjusted by a
multiple of 360 degrees longitudinally, so as to be as close as
possible to the map center. In a 3-D viewing mode the returned
LatLng will correspond to the visible region of the map.
Mathematically, the given LatLng's longitude will be
wrapped into the range [center_longitude-180, center_longitude+180].
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng to be wrapped. |
getTransformationGeometry(): TransformationGeometryReturns camera transformation geometry information that can be used to construct a 4 x 4 matrix for transforming (x,y,z,w) positions. You can use this function as the basis for performing transformations more advanced than converting between 2-D world position and 2-D viewport position. The Google Maps API for Flash demo gallery contains examples of using these coefficients to perform full 3-D transformations.
isAhead(latLng:LatLng): BooleanDetermines whether a point is in front of the camera. All points in front of the focal plane are considered to be in front of the camera. If this method returns true then it is guaranteed that latLngToViewport(latLng) will return a point below the horizon.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Location to test. |
isOnMap(viewportPoint:Point): BooleanDetermines whether a viewport point is on the displayed map, which in 3-D means whether it is below the horizon.
| Parameter | Type | Description |
|---|---|---|
viewportPoint |
Point |
Viewport point to test. |
latLngToViewport(latlng:LatLng): PointTransforms a lat/lng location to a point on the viewport. This function always returns a point, although if the lat/lng is behind the camera then this point will be above the horizon. Therefore to determine whether a point is visible, users should first call isAhead, then this function. It is also possible for this function to return points that have both coordinates equal to infinity (occurs in the case that the point is on the boundary between the "forwards" and "backwards" parts of the world plane). Once again, querying isAhead first will prevent infinite points from being generated.
| Parameter | Type | Description |
|---|---|---|
latlng |
LatLng |
Location as a LatLng. |
latLngToWorld(latlng:LatLng): PointTransforms a lat/lng location to world coordinates.
| Parameter | Type | Description |
|---|---|---|
latlng |
LatLng |
Location as a LatLng. |
viewportToLatLng(viewportPoint:Point): LatLngTransforms a viewport location to lat/lng. This function always returns a location, although if the point is above the horizon then the lat/lng will be behind the camera. Therefore users should sanitize viewport locations using isOnMap before calling this function.
| Parameter | Type | Description |
|---|---|---|
viewportPoint |
Point |
Location in viewport coordinates. |
viewportToWorld(viewportPoint:Point): PointTransforms viewport coordinate to world coordinates.
| Parameter | Type | Description |
|---|---|---|
viewportPoint |
Point |
Viewport coordinates. |
worldDistance(worldPoint:Point): NumberReturns the distance from the camera to a point given in world coordinates.
| Parameter | Type | Description |
|---|---|---|
worldPoint |
Point |
Point in world coordinates. |
worldToLatLng(worldPoint:Point): LatLngTransforms world coordinates to an unwrapped lat/lng location.
| Parameter | Type | Description |
|---|---|---|
worldPoint |
Point |
World coordinates. |
worldToViewport(point:Point): PointTransforms world coordinates to viewport coordinates.
| Parameter | Type | Description |
|---|---|---|
point |
Point |
World coordinates. |
IClientGeocoder is the interface implemented by client geocoder object. A client geocoder communicates with Google servers to obtain geocodes for user specified addresses. In addition, a geocoder maintains its own cache of addresses, which allows repeated queries to be answered without a round trip to the server.
geocode(address:String): voidInitiates a geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.
| Parameter | Type | Description |
|---|---|---|
address |
String |
Address to geocode. |
getOptions(): ClientGeocoderOptionsRetrieves the geocoder object's options. Use the setOptions() method to modify geocoder options.
resetCache(): voidResets the geocoding cache, clearing all results retrieved by this and other ClientGeocoder objects.
reverseGeocode(latLng:LatLng): voidInitiates a reverse geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng to reverse geocode. |
setOptions(options:ClientGeocoderOptions): voidUpdates the geocoder options. The options parameter may specify a complete or partial set of geocoder options.
| Parameter | Type | Description |
|---|---|---|
options |
ClientGeocoderOptions |
New full or partial set of geocoder options. |
This interface is implemented by map controls. You can implement this interface or use com.google.maps.controls.ControlBase class in order to provide a custom control for the map. Controls are added to the map using the Map.addControl() method.
getControlPosition(): ControlPositionRetrieves the control position.
getDisplayObject(): DisplayObjectRetrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
getSize(): PointRetrieves the control's size.
initControlWithMap(map:IMap): voidSets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map. |
setControlPosition(position:ControlPosition): voidSets the control's position and updates its position on the map.
navigatorControl.setControlPosition(
new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));| Parameter | Type | Description |
|---|---|---|
position |
ControlPosition |
New position for the control. |
ICopyrightCollection is the interface implemented by CopyrightCollection and equivalent classes. CopyrightCollection manages copyright messages displayed on maps of custom map type. A copyright collection contains information about which copyright to display for which region on the map at which zoom level. This is very important for map types that display heterogenous data such as the satellite map type.
addCopyright(copyright:Copyright): BooleanAdds the given copyright to the collection, returning true if the copyright was new and was added or false if the copyright was a duplicate and ignored.
| Parameter | Type | Description |
|---|---|---|
copyright |
Copyright |
New copyright to add. |
getCopyrightNotice(bounds:LatLngBounds, zoom:Number): CopyrightNoticeReturns a CopyrightNotice instance for the given viewport.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Query bounds. |
zoom |
Number |
Zoom level. |
getCopyrights(bounds:LatLngBounds, zoom:Number): ArrayRetrieves an array of elements of type String, which comprises the copyright text that we should display for the given viewport.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Query bounds. |
zoom |
Number |
Zoom level. |
getCopyrightsAtLatLng(latLng:LatLng): ArrayReturns an array of elements of type Copyright, which are the copyrights pertaining to the specified location.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
The point for which we want to get copyrights for. |
IDirections is the interface implemented by a Directions object. A Directions object communicates with Google servers to obtain directions between two or more waypoints. Responses to such requests contain an encoded polyline representing the directions, and HTML-formatted steps to take.
| Name | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
The bounding box for the result of this directions query. This is will be null if no successful result is available. |
copyrightsHtml |
String |
An HTML string containing the copyright information for this result. |
distance |
Number |
The total distance of this entire directions request in meters. |
distanceHtml |
String |
The total distance of this entire directions request in a localized string representation in the units that are predominant in the starting country of this set of directions. |
duration |
Number |
The total time of this entire directions request in seconds. |
durationHtml |
String |
The total time of this entire directions request in a localized string representation. |
numGeocodes |
uint |
The number of geocoded entries available in the result. For a successful query, this should be equal to the total number of input waypoints. When no results are available (either because no query was issued or because the previous query was unsuccessful), this will be 0. |
numRoutes |
uint |
The number of routes available in the result. For a successful query, this should be the total number of input waypoints minus 1. When no results are available (either because no query was issued or because the previous query was unsuccessful), this will be 0. |
status |
uint |
The status code of the directions request. This will be 500 if no result is available. |
summaryHtml |
String |
An HTML snippet containing a summary of the distance and time for this entire directions request. |
clear(): void
Clears any existing directions results and cancels any pending
load() requests.
createPolyline(options?:PolylineOptions): IPolylineCreate the Polyline object associated with the entire directions response. Note that there is a single polyline that represents all routes in the response. This object can be created only after the directions results have been loaded (i.e. the "load" event has been triggered).
| Parameter | Type | Description |
|---|---|---|
options? |
PolylineOptions |
Options for the creation of the polyline. |
getGeocode(i:uint): PlacemarkReturn the geocoded result for the ith waypoint.
| Parameter | Type | Description |
|---|---|---|
i |
uint |
The index of the geocoded result to return. This should be in the
range |
getOptions(): DirectionsOptionsRetrieves the directions object's options. Use the setOptions() method to modify directions object's options.
getRoute(i:uint): RouteReturn the Route object for the ith route in the response.
| Parameter | Type | Description |
|---|---|---|
i |
uint |
The index of the route to return. This should be in the range
|
load(query:String): void
Initiates a directions request. Dispatches either
DirectionsEvent.DIRECTIONS_SUCCESS,
DirectionsEvent.DIRECTIONS_FAILURE, or
DirectionsEvent.DIRECTIONS_ABORTED
on completion. Each event serves
as a notification that the directions response has come back from the
server, and in the case of the success event, the response information can
be retrieved from this object. When directions results are received, this
object clears old results, replacing them with new ones. Directions results
consist of multiple routes, one per
consecutive pair of waypoints/addresses specified in the query. In turn,
routes consist of multiple steps. If a previous
load() request has not completed when a new call to
load() is invoked, the previous request is cancelled and a
DirectionsEvent.DIRECTIONS_ABORTED event will be dispatched
for that request. Thus,
you can use a single Directions object to issue directions requests
serially, but to generate multiple requests in parallel, you must use
multiple Directions objects.
| Parameter | Type | Description |
|---|---|---|
query |
String |
A Maps-style directions query. This can be of the form "from: src to: dst1 to: dst2 ..." or any free-form directions query ("SFO to SJC"). |
setOptions(options:DirectionsOptions): voidUpdates the directions options. The options parameter may specify a complete or partial set of directions options.
| Parameter | Type | Description |
|---|---|---|
options |
DirectionsOptions |
New full or partial set of options for directions. |
IGroundOverlay is the interface implemented by ground overlay
objects. Ground overlays are images laid out over the map content
whose corners are located with latitude/longitude pairs.
Ground overlays dispatch a number of events as the user interacts with
them:
MapMouseEvent.MOUSE_DOWN
MapMouseEvent.MOUSE_UP
MapMouseEvent.MOUSE_MOVE
MapMouseEvent.ROLL_OVER
MapMouseEvent.ROLL_OUT
MapMouseEvent.CLICK
MapMouseEvent.DOUBLE_CLICK.
The latLng property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately underneath
the mouse pointer.
getOptions(): GroundOverlayOptionsRetrieves the full set of options used by the ground overlay. Use the setOptions method to modify the options on the ground overlay.
setOptions(options:GroundOverlayOptions): void
Updates the ground overlay options.
The options parameter may specify a complete or partial set
of ground overlay options. If a partial set of options is specified, it
will supplement the existing marker options, overriding only the values
that were set explicitly and leaving the rest unchanged.
// Modify the ground overlay's stroke colour, leaving the rest
// of its options unchanged.
var options:GroundOverlayOptions =
new GroundOverlayOptions( { strokeStyle: { color: 0x000080 }} );
myGroundOverlay.setOptions(options);| Parameter | Type | Description |
|---|---|---|
options |
GroundOverlayOptions |
New full or partial set of options for the ground overlay. |
IInfoWindow is the interface implemented by information windows that can display HTML-formatted text.
| Name | Type | Description |
|---|---|---|
removed |
Boolean |
Checks whether the infowindow was removed. |
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.
| Name | Type | Description |
|---|---|---|
MERCATOR_PROJECTION |
IProjection |
Retrieves Mercator projection. |
overlayRaising |
Boolean |
Set to |
addControl(control:IControl): voidRegisters a new control. This can be called before the MAP_READY event has been received.
public class MyMap extends Map {
public function MyMap() {
super();
addEventListener(MapEvent.MAP_READY, onMapReady);
addControl(new MapTypeControl());
}
}| Parameter | Type | Description |
|---|---|---|
control |
IControl |
New control to register. |
addMapType(newMapType:IMapType): voidRegisters a new map type.
| Parameter | Type | Description |
|---|---|---|
newMapType |
IMapType |
New map type to register. |
addOverlay(overlay:IOverlay): voidAdds an overlay 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);| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
The overlay to be added to the map. |
clearControls(): voidRemoves all controls from the map.
clearOverlays(): voidRemoves all overlays from the map.
closeInfoWindow(): BooleanCloses the information window.
continuousZoomEnabled(): BooleanChecks whether continuous zoom is enabled.
controlByKeyboardEnabled(): BooleanChecks whether control by keyboard is enabled.
crosshairsEnabled(): BooleanChecks whether center crosshairs are enabled.
disableContinuousZoom(): voidDisables continuous smooth zooming.
disableControlByKeyboard(): voidDisables control by keyboard.
disableCrosshairs(): voidDisables the center crosshairs.
disableDragging(): voidDisables dragging of the map.
disableScrollWheelZoom(): voidDisables zooming using a mouse's scroll wheel.
draggingEnabled(): BooleanChecks whether dragging of the map is enabled.
enableContinuousZoom(): voidEnables continuous smooth zooming.
enableControlByKeyboard(): voidEnables control by keyboard.
enableCrosshairs(): voidEnables the center crosshairs.
enableDragging(): voidEnables dragging of the map.
enableScrollWheelZoom(): voidEnables zooming using a mouse's scroll wheel.
fromLatLngToPoint(latLng:LatLng, opt_zoom?:Number): PointReturns 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).
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
latLng location on the map |
opt_zoom? |
Number |
target zoom level (defaults to current zoom level) |
fromLatLngToViewport(latLng:LatLng, opt_disablewrap?:Boolean): PointReturns 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).
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng coordinate of the point on the map. |
opt_disablewrap? |
Boolean |
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 center of the map and the target location crosses the +180/-180 degree longtitude wrap-around. For example, the map is currently centered 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 center 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 center (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 center of the map to the target point does not cross the +180/-180 degree longtitude (such as in case where the current center of the map is Sydney, Australia while the target location is Tokyo, Japan). |
fromPointToLatLng(pos:Point, opt_zoom?:Number, opt_nowrap?:Boolean): LatLngReturns 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).
| Parameter | Type | Description |
|---|---|---|
pos |
Point |
x, y of a point |
opt_zoom? |
Number |
target zoom level (defaults to the current zoom level) |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180, 180) |
fromViewportToLatLng(pos:Point, opt_nowrap?:Boolean): LatLngReturns the lat-lng of the point at the given coordinates in the map's view port (the top left corner of the map object).
| Parameter | Type | Description |
|---|---|---|
pos |
Point |
Coordinates in the map's view port. |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180, 180) |
getBoundsZoomLevel(bounds:LatLngBounds): NumberReturns 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.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Bounds to show. |
getCenter(): LatLngRetrieves coordinates of the center in the map view control.
getCurrentMapType(): IMapTypeRetrieves the current map type.
getDisplayObject(): DisplayObjectRetrieves the display object that represents the map.
getDoubleClickMode(): NumberGet the mouse double click mode.
getImplementationVersion(): StringGets the version of the implementation library SWF.
getLatLngBounds(): LatLngBoundsReturns the the visible rectangular region of the map view in geographical coordinates.
getMapTypes(): ArrayRetrieves the list of the map types available for the location.
getMaxZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): NumberRetrieves the maximum zoom level.
| Parameter | Type | Description |
|---|---|---|
opt_mapType? |
IMapType |
Map type used to determine maximum resolution. |
opt_point? |
LatLng |
Point for which to get the maximum zoom. |
getMinZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): NumberRetrieves the minimum zoom level.
| Parameter | Type | Description |
|---|---|---|
opt_mapType? |
IMapType |
MapType to determine minimum resolution. |
opt_point? |
LatLng |
Point to get minimum zoom level for. |
getOptions(): MapOptionsRetrieves 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.
getPaneManager(): IPaneManagerRetrieves the pane manager for the map.
getPrintableBitmap(): Bitmap
Returns a Bitmap instance containing a snapshot image of the map for
printing.
The map itself may contain content loaded from multiple domains.
This method requires that the domain maps.googleapis.com is
granted access to any content that appears on the map via a
crossdomain.xml file. For example, if your map uses a
custom tile layer containing tiles loaded from URLs with the form
http://www.thirdpartymap.com/path/tile_x_y_z.png, place
a crossdomain.xml file at
http://www.thirdpartymap.com/path/crossdomain.xml.
Load this file using Security.loadPolicyFile() and when
loading the tile images ensure that you use a LoaderContext
instance whose checkPolicyFile property is
true.
Note that by using path/ in the above URLs you can grant
maps.googleapis.com privileged access only to content below
http://www.thirdpartymap.com/path/, rather than to all content
on www.thirdpartymap.com.
getProjection(): IProjectionReturns the projection being applied to the map.
getSize(): PointRetrieves the map view size.
getZoom(): NumberRetrieves the map zoom level.
isLoaded(): BooleanChecks whether the map has been initialized.
openInfoWindow(latlng:LatLng, options?:InfoWindowOptions): IInfoWindowOpens a simple information window at the given point.
| Parameter | Type | Description |
|---|---|---|
latlng |
LatLng |
Point at which the info window is opened. |
options? |
InfoWindowOptions |
Info window options. |
panBy(distance:Point, animate?:Boolean): voidStarts a pan animation by the given distance in pixels.
| Parameter | Type | Description |
|---|---|---|
distance |
Point |
Distance in pixels |
animate? |
Boolean |
Whether the change may be animated. |
panTo(latLng:LatLng): voidChanges the center location of the map to the given location. If the location is already visible in the current map view, changes the center in a smooth animation.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new center. |
removeControl(control:IControl): voidRemoves a control from the map. If the control was not added to the map, this does nothing.
| Parameter | Type | Description |
|---|---|---|
control |
IControl |
The control to remove. |
removeMapType(oldMapType:IMapType): voidRemoves a registered map type.
| Parameter | Type | Description |
|---|---|---|
oldMapType |
IMapType |
Map type to unregister. |
removeOverlay(overlay:IOverlay): voidRemoves an overlay from the map.
| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
Overlay to be removed from the map. |
returnToSavedPosition(): voidReturns map to the saved position.
savePosition(): voidStores the current map position and zoom level for later recall by returnToSavedPosition.
scrollWheelZoomEnabled(): BooleanChecks whether scroll wheel zooming is enabled.
setCenter(latLng:LatLng, opt_zoom?:Number, opt_mapType?:IMapType): voidChanges the center location of the map.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new center. |
opt_zoom? |
Number |
New zoom level. |
opt_mapType? |
IMapType |
New map type. |
setDoubleClickMode(val:Number): voidSet the mouse double click mode.
| Parameter | Type | Description |
|---|---|---|
val |
Number |
mouse double click mode (one of the MapAction constants). |
setMapType(mapType:IMapType): voidChanges the map type for the map.
| Parameter | Type | Description |
|---|---|---|
mapType |
IMapType |
Map type. |
setSize(newSize:Point): voidSets the size of the map view.
| Parameter | Type | Description |
|---|---|---|
newSize |
Point |
New view size for the map. |
setZoom(level:Number, opt_doContinuousZoom?:Boolean): voidChanges the zoom level for the map view control.
| Parameter | Type | Description |
|---|---|---|
level |
Number |
New zoom level. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
unload(): voidRemoves 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(opt_latlng?:LatLng, opt_doCenter?:Boolean, opt_doContinuousZoom?:Boolean): voidZooms in the map by one zoom level if possible.
| Parameter | Type | Description |
|---|---|---|
opt_latlng? |
LatLng |
If set, this is the point around which we zoom. Otherwise we will zoom in around the center of the map. |
opt_doCenter? |
Boolean |
If true, we also want to center at opt_latlng. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
zoomOut(opt_latlng?:LatLng, opt_doContinuousZoom?:Boolean): voidZooms out the map by one zoom level if possible.
| Parameter | Type | Description |
|---|---|---|
opt_latlng? |
LatLng |
If set, this is the point around which we zoom. Otherwise we will zoom out around the center of the map. |
opt_doContinuousZoom? |
Boolean |
Whether the zoom operation should be continuous (provided that continuous zoom is enabled for the map). |
IMap3D is the interface implemented by Map3D. Create an instance of class Map3D to create a map that supports 3-D views.
| Name | Type | Description |
|---|---|---|
camera |
ICamera |
The camera that may be used to return information about the viewing geometry and perform transformations between LatLng, world and viewport coordinates. |
dragMode |
int |
The drag mode that is being used on the map. Acceptable values for this property are MapAction.DRAGMODE_LATLNG, MapAction.DRAGMODE_PITCH and MapAction.DRAGMODE_YAW. By default, the drag mode is updated automatically immediately before dispatching MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP events based on the state of the CTRL and SHIFT keyboard modifier keys. If CTRL is pressed, the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH, else if SHIFT is pressed the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH, else the drag mode is set to MapAction.DRAGMODE_LATLNG. It is recommended that you keep this behavior. It is consistent with that in Google Earth. However, if you need to change it, you should attach listeners both to MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP. Within your handler you then can set an appropriate map dragging mode based on parameters including mouse location and keyboard modifier key state. Note that since the drag mode can change immediately before, and while handling, MapMouseEvent.DRAG_STEP, a new drag mode can begin without the user having first released the mouse button. If the drag mode is changed in the middle of a drag operation, you will receive DRAG_STOP and DRAG_START events before the drag operation proceeds with the new drag mode. |
viewMode |
int |
The view mode that is being applied to map. Acceptable values for this property are View.VIEWMODE_2D, View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL. |
cancelFlyTo(): void
Aborts any map motion initiated by a call to flyTo() and
causes MapEvent.FLY_TO_CANCELED and
MapEvent.FLY_TO_DONE to be dispatched.
Has no effect if no flight is occurring.
flyTo(center:LatLng, zoom?:Number, attitude?:Attitude, duration?:Number): void
Changes the center location, zoom and attitude of the map over a given
period. You can use a period of 0 if you wish the change to be
instantaneous.
You can make repeated calls to flyTo() before animation
has completed for a previous call if you wish to fly a complex route.
Each flight segment will be queued and performed in sequence. If more than
one flight segment is queued then cubic splines will be used to
interpolate the camera location and attitude.
By default the user can interact with the map while a flight is
occurring and doing so will not terminate the flight (it will
continue through the remaining segments from the time the user releases
control). However, a method cancelFlyTo() is available
if you wish to abort the remaining portion of the flight.
MapEvent.FLY_TO_DONE is dispatched when the flight
terminates (whether or not it was canceled).
| Parameter | Type | Description |
|---|---|---|
center |
LatLng |
Coordinates for the new map center. |
zoom? |
Number |
New map zoom level. |
attitude? |
Attitude |
New map attitude. |
duration? |
Number |
Duration in seconds over which the change occurs. |
getAttitude(): AttitudeGets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.
setAttitude(value:Attitude): voidSets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.
| Parameter | Type | Description |
|---|---|---|
value |
Attitude |
New map attitude. |
IMapType is the interface implemented by map type objects. A map type is a set of tile layers, a map projection, a tile size, and assorted other settings, such as link colors and copyrights. Google provides a set of predefined map types. You can also use com.google.maps.MapType class to define a custom map type. Map types can be added to the map using the Map.addMapType() method.
getAlt(): StringReturns the text of the hint that is displayed when the user hovers over a control that allows selection of this map type. MapTypeControl is such a control.
getBoundsZoomLevel(bounds:LatLngBounds, viewSize:Point): NumberReturns the highest resolution zoom level required to show the given lat/lng bounds in a map of the given pixel size.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Bounds to show. |
viewSize |
Point |
Size of viewport. |
getCopyrights(bounds:LatLngBounds, zoom:Number): ArrayReturns an array of copyright notices for the given bounds and zoom level. Each element in this array is of type CopyrightNotice.
| Parameter | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
Current viewport. |
zoom |
Number |
Current zoom level. |
getErrorMessage(): StringReturns the text to be displayed if a tile fails to download.
getLinkColor(): NumberIf a control displays a link above the map, returns the color we should use. The "terms of use" link in the copyright control uses this color, for example.
getMaxResolutionOverride(): NumberReturns the max resolution override.
getMaximumResolution(opt_point?:LatLng): NumberReturns the zoom level of the maximum resolution supported by this map type. If opt_point is given, returns the maximum resolution at the given lat/lng. If opt_point is not given, returns the global maximum.
| Parameter | Type | Description |
|---|---|---|
opt_point? |
LatLng |
Point at which to evaluate resolution. |
getMinimumResolution(opt_point?:LatLng): NumberReturns the zoom level of the minimum resolution supported by this map type. If opt_point is given, returns the minimum resolution at the given lat/lng. If opt_point is not given, returns the global minimum.
| Parameter | Type | Description |
|---|---|---|
opt_point? |
LatLng |
Point at which to evaluate resolution (ignored). |
getName(opt_short?:Boolean): StringRetrieves the map type name.
| Parameter | Type | Description |
|---|---|---|
opt_short? |
Boolean |
Return the abbreviated name. |
getProjection(): IProjectionRetrieves the map type projection.
getRadius(): NumberReturns the radius of the planet for which this map type is defined.
getSpanZoomLevel(center:LatLng, span:LatLng, viewSize:Point): NumberReturns the highest resolution zoom level required to show the given lat/lng span with the given center point.
| Parameter | Type | Description |
|---|---|---|
center |
LatLng |
Center of viewport. |
span |
LatLng |
Span of viewport. |
viewSize |
Point |
Size of viewport in pixels. |
getTextColor(): NumberIf controls are textual, returns the appropriate color to display the text. The copyright control uses this color, for example.
getTileLayers(): ArrayGets the list of tile layers for this map type in the z-order they should be displayed. Note that this cannot be used to change the displayed tile layers after construction of a MapType instance. You must create a new MapType if you wish to display a different set of layers.
getTileSize(): NumberGets the tile size for this map type. The predefined map types' tiles are all 256 by 256 pixels in size: this function would, for these map types, return 256.
getUrlArg(): StringReturns a string that may be used as a URL parameter to identify this map type in permalinks to the current map view. This is currently only used internally. Note that if any built-in tile layers are used in constructing a custom map type, the returned value will be based on the set of layers rather than on any developer-supplied value.
setMaxResolutionOverride(maxResolution:Number): voidSets the max resolution override, such that, if this number is greater than the max resolution that our map type reports to us, we will use this number instead. It represents the number of levels shown on the ZoomControl's scrollbar.
| Parameter | Type | Description |
|---|---|---|
maxResolution |
Number |
Value to set max resolution override to. |