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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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.
// 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. <table> <tr><th>precision</th><th>approximate error</tr> <tr><td>-1</td><td>1000 kilometers / 700 miles</tr> <tr><td>0</td><td>100 kilometers / 70 miles</tr> <tr><td>1</td><td>10 kilometers / 7 miles</tr> <tr><td>2</td><td>1 kilometer / 0.7 miles</tr> <tr><td>3</td><td>100 meters / 300 feet</tr> <tr><td>4</td><td>10 meters / 30 feet</tr> <tr><td>5</td><td>1 meter / 3 feet</tr> <tr><td>6</td><td>10 centimeters / 4 inches</tr> <tr><td>7</td><td>1 centimeter (a nickel)</tr> </table>
| 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.
| 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.
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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 centre of the map and the target location crosses the +180/-180 degree longtitude wrap-around. For example, the map is currently centred at Sydney, Australia [LatLng(-33.857, 151.215)] and the location passed into this call is San Francisco, USA [LatLng(37.779, -122.420)] This call will return two different pixel coordinates for the two values of the opt_disablewrap parameter. By default (opt_disablewrap set to false), the map will wrap the around the +180/-180 degree longtitude to return the pixel coordinate that will lie to the right of the current centre of the map (picking the shorter path from Sydney to San Francisco that goes across the Pacific Ocean). If the wrapping of the map is disabled (opt_disablewrap set to true), the pixel coordinate returned by the call will be to the left of the current centre (the longer path from Sydney to San Francisco going across the Indian and Atlantic Oceans). The value returned by the call will be the same for either value of opt_disablewrap parameter if the shorter path from the current centre of the map to the target point does not cross the +180/-180 degree longtitude (such as in case where the current centre of the map is Sydney, Australia while the target location is Tokyo, Japan). |
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.
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): voidStarts a pan animation by the given distance in pixels.
| Parameter | Type | Description |
|---|---|---|
distance |
Point |
Distance in pixels |
panTo(latLng:LatLng): voidPans the map to the specified centre location.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new centre. |
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 centre point of the map.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new centre. |
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). |
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. |
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. |
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. |
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 |
|---|---|---|
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. |
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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.
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 by the maps application.
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. |
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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. |
ControlPosition(anchor:Number, opt_paddingX?:Number, opt_paddingY?:Number)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). |
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.");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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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.
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
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.
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.
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 centre of the map and the target location crosses the +180/-180 degree longtitude wrap-around. For example, the map is currently centred at Sydney, Australia [LatLng(-33.857, 151.215)] and the location passed into this call is San Francisco, USA [LatLng(37.779, -122.420)] This call will return two different pixel coordinates for the two values of the opt_disablewrap parameter. By default (opt_disablewrap set to false), the map will wrap the around the +180/-180 degree longtitude to return the pixel coordinate that will lie to the right of the current centre of the map (picking the shorter path from Sydney to San Francisco that goes across the Pacific Ocean). If the wrapping of the map is disabled (opt_disablewrap set to true), the pixel coordinate returned by the call will be to the left of the current centre (the longer path from Sydney to San Francisco going across the Indian and Atlantic Oceans). The value returned by the call will be the same for either value of opt_disablewrap parameter if the shorter path from the current centre of the map to the target point does not cross the +180/-180 degree longtitude (such as in case where the current centre of the map is Sydney, Australia while the target location is Tokyo, Japan). |
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.
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): voidStarts a pan animation by the given distance in pixels.
| Parameter | Type | Description |
|---|---|---|
distance |
Point |
Distance in pixels |
panTo(latLng:LatLng): voidPans the map to the specified centre location.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new centre. |
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 centre point of the map.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Coordinates for the new centre. |
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). |
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.
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 by the maps application.
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. |
IMarker is the interface implemented by marker objects to mark position on that map. Markers can be added to the map using the Map.addOverlay() method.
closeInfoWindow(): voidCloses the info window if it is associated with this marker.
getLatLng(): LatLngRetrieves the location of the marker.
getOptions(): MarkerOptionsRetrieves the full set of options used by the marker. Use the setOptions method to modify the options on the marker.
openInfoWindow(options?:InfoWindowOptions): IInfoWindowOpens an information window above the marker.
| Parameter | Type | Description |
|---|---|---|
options? |
InfoWindowOptions |
InfoWindow options. |
setLatLng(value:LatLng): voidChanges the LatLng of the marker.
| Parameter | Type | Description |
|---|---|---|
value |
LatLng |
New LatLng location of the marker. |
setOptions(options:MarkerOptions): void
Updates the marker options.
The options parameter may specify a complete or partial set
of marker 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 marker's fill colour, leaving the rest
// of its options unchanged.
var options:MarkerOptions =
new MarkerOptions( { fillStyle: { color: 0x000080 }} );
myMarker.setOptions(options);| Parameter | Type | Description |
|---|---|---|
options |
MarkerOptions |
New full or partial set of options for the marker. |
This interface is implemented by the overlay objects, such as markers, polylines, polygons, ground overlays and info windows. An instance of IOverlay can be put on the map with the method Map.addOverlay().
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
getDefaultPane(map:IMap): IPaneRetrieves the default pane that this overlay should be placed on if none is explicitly specified (when the overlay is added through the IMap.addOverlay() call).
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
Instance of map that this overlay is added to. |
positionOverlay(zoomChanged:Boolean): voidReposition the overlay on the screen. This method is called in response to changes in the position (centre) of the map and/or the map's zoom level. Developers should not call the method themselves. The implementation of this method should either change the position of the overlay on the screen in response to the change of the map's centre or redraw the overlay completely if it needs to be reconfigured for a different map centre/zoom level. Repositioning of the overlay should be done by changing the placement of the overlay's display object on its pane using the mappings provided by the IPane interface (fromLatLngToPaneCoords or fromProjectionPointToPaneCoords).
| Parameter | Type | Description |
|---|---|---|
zoomChanged |
Boolean |
Whether the zoom level of the map has changed or the call was invoked just as a result of a map pan. |
IPane is the interface is implemented by the map panes. Pane is a container for overlays (such as markers, polylines, polygons etc).
| Name | Type | Description |
|---|---|---|
id |
uint |
Pane's id. |
map |
IMap |
The instance of map this pane is added to. Null if the pane is removed from the map. |
paneManager |
IPaneManager |
The instance of pane manager this pane is added to. Null if the pane is removed from the map. |
visible |
Boolean |
Visibility of the pane. |
addOverlay(overlay:IOverlay): voidAdds an overlay to the pane.
| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
Overlay to add to this pane. |
bringToTop(overlay:IOverlay): voidBrings an overlay to the top of all other overlays on the pane.
| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
Overlay to position at the top. |
clear(): voidRemoves all overlays added to this pane.
fromLatLngToPaneCoords(latLng:LatLng, closestToCenter?:Boolean): PointTranslates the latLng to the pane's coordinate system. This method may be used by overlays displayed by the pane to determine their location. Pane's coordinate system may or may not match that of the map.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
LatLng for the location to translate. |
closestToCenter? |
Boolean |
If true, return the x coordinate closest to the centre of the map when multiple map copies are shown; if false, just map the latlng directly. |
fromPaneCoordsToLatLng(point:Point, opt_nowrap?:Boolean): LatLngTranslates a point in the pane's coordinate system to lat/lng. Pane's coordinate system may or may not match that of the map.
| Parameter | Type | Description |
|---|---|---|
point |
Point |
A point in the pane's coordinate system |
opt_nowrap? |
Boolean |
Whether the value of longtitude should be preserved even when it value lies outside of the [-180, +180]. When this parameter if set to false (the default), the longtitude will be wrapped to bring it within the range [-180, +180]. |
fromPaneCoordsToProjectionPoint(point:Point): PointConverts a point in the pane's coordinate system to projection point coordinates for the current zoom level of the map. Projection points are those returned by IProjection.fromLatLngToPixel (i.e. point (0,0) is the top-left corner of the top-left tile for the specific zoom level of the map).
| Parameter | Type | Description |
|---|---|---|
point |
Point |
Pixel coordinates within the pane |
fromProjectionPointToPaneCoords(projectionPoint:Point): PointConverts projection point coordinates to the pane's local coordinates.
| Parameter | Type | Description |
|---|---|---|
projectionPoint |
Point |
Pixel coordinates of the object in relation to the origin of the map (i.e. point (0,0) is the top-left corner of the top-left tile for the specific zoom level of the map). |
getViewportBounds(): RectangleRetrieves the bounds of the viewport in the pane's coordinate system.
invalidate(): voidInvalidates all the geometry on the pane causing a delayed update.
removeOverlay(overlay:IOverlay): voidRemoves an overlay from the pane.
| Parameter | Type | Description |
|---|---|---|
overlay |
IOverlay |
Overlay to remove from this pane. |
updatePosition(force?:Boolean): voidUpdates this pane on changes to the map (such as panning and zooming).
| Parameter | Type | Description |
|---|---|---|
force? |
Boolean |
Whether to force updates to all overlays on this pane. |
Interface to the Pane manager of the map. Pane manager is responsible for creating/removing/transposing overlay panes on the map.
| Name | Type | Description |
|---|---|---|
map |
IMap |
Reference to the map. |
paneCount |
int |
Total number of panes available. |
clearOverlays(): voidRemoves all overlays registered on all panes.
containsPane(pane:IPane): BooleanChecks whether the pane manager contains the specified pane.
| Parameter | Type | Description |
|---|---|---|
pane |
IPane |
createPane(index?:int): IPaneCreates a new pane and adds it at the specified position.
| Parameter | Type | Description |
|---|---|---|
index? |
int |
Position of the new pane in the pane stack (if not specified, the pane is added just below the infowindow pane). |
getPaneAt(index:int): IPaneRetrieves the pane by its relative position.
| Parameter | Type | Description |
|---|---|---|
index |
int |
Depth index of the pane. |
getPaneById(paneId:int): IPaneRetrieves the pane by the pane's id.
| Parameter | Type | Description |
|---|---|---|
paneId |
int |
Pane's id. |
getPaneIndex(pane:IPane): intRetrieves the depth index of the pane.
| Parameter | Type | Description |
|---|---|---|
pane |
IPane |
Pane whose index needs to be determined. |
placePaneAt(pane:IPane, index:int): voidPositions the pane at the specified depth. Changing the pane's index allows rearranging the depths of panes in relation to each other.
| Parameter | Type | Description |
|---|---|---|
pane |
IPane |
Pane whose placement will be changed. |
index |
int |
Depth index of the pane. |
removeAllPanes(): voidRemove all panes.
removePane(pane:IPane): voidRemoves the pane.
| Parameter | Type | Description |
|---|---|---|
pane |
IPane |
Pane to remove. |
IPolygon is the interface implemented by Polygon and equivalent user-created classes. Polygon is a map overlay that represents polygon objects.
getInnerPolylineCount(): NumberReturns the number of polylines that make up the inner boundaries of this polygon.
getInnerVertex(line:Number, index:Number): LatLngReturns the LatLng of the vertex with the specified index from the specified inner polyline boundary.
| Parameter | Type | Description |
|---|---|---|
line |
Number |
Index of the inner polyline. |
index |
Number |
Index of the target vertex within the specified polyline. |
getInnerVertexCount(line:Number): NumberReturns the number of vertices in a specified inner line.
| Parameter | Type | Description |
|---|---|---|
line |
Number |
Index of the inner line. |
getLatLngBounds(): LatLngBoundsReturns the LatLngBounds of this polygon, or null if the polygon contains no points.
getOptions(): PolygonOptionsRetrieves the polygon's options. Use the setOptions() method to modify options on the polygon.
getOuterVertex(index:Number): LatLngReturns the vertex from the outer boundary with the specified index.
| Parameter | Type | Description |
|---|---|---|
index |
Number |
Index of the target vertex. |
getOuterVertexCount(): NumberReturns the number of vertices in the outer line.
setOptions(options:PolygonOptions): void
Updates the polygon's options.
The options parameter may specify a complete or partial set
of polygon options. If a partial set of options is specified, it will
supplement the existing polygon options, overriding only the values that
were set explicitly and leaving the rest unchanged.
For example, the following piece of code will modify the polygon's
fill alpha, leaving the rest of its options unchanged.
var options:PolygonOptions =
new PolygonOptions( { fillStyle: { alpha: 0.2 }} );
myPolygon.setOptions(options);
| Parameter | Type | Description |
|---|---|---|
options |
PolygonOptions |
New full or partial set of options for the polygon. |
IPolyline is the interface implemented by Polyline and equivalent user-created classes. Polyline is a map overlay representing polyline objects and is constructed from a list of vertices.
getLatLngBounds(): LatLngBoundsReturns the LatLngBounds of this polyline or a subsequence of this polyline. Returns null if this polyline contains no points.
getLength(opt_radius?:Number): NumberReturns the length (in meters) of the polyline along the surface of a spherical Earth.
| Parameter | Type | Description |
|---|---|---|
opt_radius? |
Number |
Radius of the spherical celestial object. |
getOptions(): PolylineOptionsRetrieves the polyline's options. Use the setOptions() method to modify polyline's options.
getVertex(index:Number): LatLngReturns the vertex with the specified index.
| Parameter | Type | Description |
|---|---|---|
index |
Number |
Index of the target vertex. |
getVertexCount(): NumberReturns the number of vertices in this polyline.
setOptions(options:PolylineOptions): void
Updates the polyline options.
The options parameter may specify a complete or partial set
of polyline options. If a partial set of options is specified, it will
supplement the existing polyline options, overriding only the values that
were set explicitly and leaving the rest unchanged. For example, the
following piece of code will modify the polyline's stroke thickness,
leaving the rest of its options unchanged.
var options:PolylineOptions =
new PolylineOptions( { strokeStyle: { thickness: 3 }} );
myPolyline.setOptions(options);
| Parameter | Type | Description |
|---|---|---|
options |
PolylineOptions |
New full or partial set of options for the polyline. |
IProjection is the interface for map projections. A map projection implementor is passed to the constructor of MapType. This interface is implemented by MercatorProjection, which is used by all predefined map types. You can implement this interface if you want to define map types with different map projections. Use class ProjectionBase for your custom projections.
fromLatLngToPixel(latLng:LatLng, zoom:Number): PointReturns the map coordinates in pixels for the point at the given geographical coordinates, and the given zoom level.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Geographical position |
zoom |
Number |
Zoom level |
fromPixelToLatLng(pixel:Point, zoom:Number, opt_nowrap?:Boolean): LatLngReturns the map coordinates in pixels for the point at the given geographical coordinates, and the given zoom level.
| Parameter | Type | Description |
|---|---|---|
pixel |
Point |
Map coordinate in pixels |
zoom |
Number |
Zoom level |
opt_nowrap? |
Boolean |
Do not wrap longitudes outside of [-180, 180) |
getWrapWidth(zoom:Number): NumberReturns to the map the periodicity in x-direction, i.e. the number of pixels after which the map repeats itself because it wrapped once round the earth. By default, returns Infinity, i.e. the map will 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): BooleanReturns to the map if the tile index is in a valid range for the map type. Otherwise the map will display an empty tile. It also may modify the tile index to point to another instance of the same tile in the case that the map contains more than one copy of the earth, and hence the same tile at different tile coordinates.
| Parameter | Type | Description |
|---|---|---|
tile |
Point |
Tile coordinate. |
zoom |
Number |
Tile zoom coordinate. |
tilesize |
Number |
The size of this tile. |
IScaleControl is the interface implemented by ScaleControl. A ScaleControl provides a control that shows the scale of the map.
This interface is defined by tile layer implementations that are used by different map types. In order to define a custom tile layer, use class TileLayerBase.
getAlpha(): NumberReturns the opacity/alpha of the movie clip for the tile layer. The range of values for getAlpha() is 0.0 - 1.0.
getCopyrightCollection(): ICopyrightCollectionRetrieves the copyright collection responsible for handling copyright 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.
| Parameter | Type | Description |
|---|---|---|
tilePos |
Point |
Tile coordinates. |
zoom |
Number |
Tile zoom. |
| Name | Type | Description |
|---|---|---|
projection |
IProjection |
Projection used for calculating positions of tiles. |
tileLayer |
ITileLayer |
Tile layer used for the overlay. |
tileSize |
int |
Tile size. |
IWrappable is the base interface for all objects that provide AS3 cross-domain scripting functionality.
| Name | Type | Description |
|---|---|---|
interfaceChain |
Array |
List of interfaces for wrapping this object. Used in cross-domain communication. |
wrapper |
Object |
Instance of the cross-domain wrapper for this object. |
IWrappableEventDispatcher is the base interface for all objects that provide cross-domain event dispatching functionality.
getBaseEventDispatcher(): ObjectRetrieves the base event dispatcher object that allows access to event dispatching capability for cross-domain objects.
Class EncodedPolylineData represents the set of data required for creating an encoded polyline.
| Name | Type | Description |
|---|---|---|
levels |
String |
String containing encoded polyline zoom level groups. |
numLevels |
Number |
Number of zoom levels contained in the encoded levels string. |
points |
String |
String containing encoded latitude and longitude coordinates. |
zoomFactor |
Number |
Magnification between adjacent sets of zoom levels in the encoded levels string. |
EncodedPolylineData(points:String, zoomFactor:Number, levels:String, numLevels:Number)Constructor.
| Parameter | Type | Description |
|---|---|---|
points |
String |
String containing encoded latitude and longitude coordinates. |
zoomFactor |
Number |
Magnification between adjacent sets of zoom levels in the encoded levels string. |
levels |
String |
String containing encoded polyline zoom level groups. |
numLevels |
Number |
Number of zoom levels contained in the encoded levels string. |
GroundOverlays are images laid out over the map content whose corners are located with latitude/longitude pairs.
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
GroundOverlay(content:DisplayObject, bounds:LatLngBounds, options?:GroundOverlayOptions)Constructs a new GroundOverlay instance, using the specified options.
| Parameter | Type | Description |
|---|---|---|
content |
DisplayObject |
Content to display. |
bounds |
LatLngBounds |
Latitude and longitude bounds over which the image extends. |
options? |
GroundOverlayOptions |
Ground overlay options. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.
getDefaultPane(map:IMap): IPaneRetrieves the default pane that this overlay should be placed on if none is explicitly specified (when the overlay is added through the IMap.addOverlay() call).
| Parameter | Type | Description |
|---|---|---|
map |
IMap |
Instance of map that this overlay is added to. |
getOptions(): GroundOverlayOptionsRetrieves the full set of options used by the ground overlay. Use the setOptions method to modify the options on the ground overlay.
positionOverlay(zoomChanged:Boolean): voidReposition the overlay on the screen. This method is called in response to changes in the position (centre) of the map and/or the map's zoom level. Developers should not call the method themselves. The implementation of this method should either change the position of the overlay on the screen in response to the change of the map's centre or redraw the overlay completely if it needs to be reconfigured for a different map centre/zoom level. Repositioning of the overlay should be done by changing the placement of the overlay's display object on its pane using the mappings provided by the IPane interface (fromLatLngToPaneCoords or fromProjectionPointToPaneCoords).
| Parameter | Type | Description |
|---|---|---|
zoomChanged |
Boolean |
Whether the zoom level of the map has changed or the call was invoked just as a result of a map pan. |
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. |
GroundOverlayOptions class specifies a set of rendering parameters for a GroundOverlay.
| Name | Type | Description |
|---|---|---|
rotation |
Object |
A Number value that specifies the ground overlay rotation (specified in degrees in the clockwise direction). |
rotationContentCenter |
Point |
Ground overlay rotation center in content coordinates. This is the point, in the coordinates of the GroundOverlay's content, around which rotation occurs. If not set, then rotation occurs around the content center. |
strokeStyle |
StrokeStyle |
Ground overlay stroke style. |
GroundOverlayOptions(param?:Object)Constructs a new GroundOverlayOptions object, optionally initializing it from an object.
var options:GroundOverlayOptions = new GroundOverlayOptions({
strokeStyle: {
color: 0x987654,
alpha: 0.8,
thickness: 3,
pixelHinting: true
},
rotation: 90,
});| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. |
getDefaultOptions(): GroundOverlayOptionsRetrieves the GroundOverlayOptions instance that represents the default set of options that applies to all ground overlays.
// Initialization object corresponding to the initial defaults.
{ strokeStyle:
{ thickness: 0,
alpha: 0.0, // invisible
color: Color.BLACK,
pixelHinting: false
},
rotation: 0
}setDefaultOptions(defaults:GroundOverlayOptions): void
Updates the default GroundOverlayOptions. These default will apply to all
ground overlays created after the call to setDefaultOptions
method.
Individual ground overlays can also specify their own sets of options.
Individual options take precedence over the default ones.
The defaults 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 defaults, overriding only the values that were
set explicitly and leaving the rest unchanged.
| Parameter | Type | Description |
|---|---|---|
defaults |
GroundOverlayOptions |
The new set of defaults for ground overlay options. |
toString(): StringReturns a String representation of this object.
A Marker object marks a position on the map. It implements the IOverlay interface and can be added to the map using the Map.addOverlay() method.<br> A marker is associated with a latlng, which determines the geographical position where its icon is anchored on the map.<br> It can either render a default icon or display a custom icon provided by a developer. A custom icon (or rendering options for the standard icon) may be specified using the Marker.setOptions() method.<br>
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
Marker(latLng:LatLng, options?:MarkerOptions)Constructs a new marker at the specified lat-lng, with the specified options.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Marker location. |
options? |
MarkerOptions |
Full or partial set of marker options. When a partial set of options is specified, the marker's complete set of options will be a combination of partial options and the existing defaults set using MarkerOptions.setDefaultOptions() call. |
clearWrapper(): voidRemove all event listeners and clear the wrapper.