Google Maps API for Flash (Deprecated)

Google Maps API ActionScript Reference

  1. com.google.maps
    1. Alpha
    2. Color
    3. Copyright
    4. CopyrightCollection
    5. CopyrightNotice
    6. InfoWindowOptions
    7. LatLng
    8. LatLngBounds
    9. Map
    10. Map3D
    11. MapAction
    12. MapAttitudeEvent
    13. MapEvent
    14. MapMouseEvent
    15. MapMoveEvent
    16. MapOptions
    17. MapType
    18. MapTypeOptions
    19. MapZoomEvent
    20. PaneId
    21. ProjectionBase
    22. StyledMapType
    23. StyledMapTypeOptions
    24. TileLayerBase
    25. View
  1. com.google.maps.interfaces
    1. ICamera
    2. IClientGeocoder
    3. IControl
    4. ICopyrightCollection
    5. IDirections
    6. IElevation
    7. IGroundOverlay
    8. IInfoWindow
    9. IMap
    10. IMap3D
    11. IMapType
    12. IMarker
    13. IMaxZoom
    14. IOverlay
    15. IPane
    16. IPaneManager
    17. IPolygon
    18. IPolyline
    19. IProjection
    20. IScaleControl
    21. IStyledMapType
    22. ITileLayer
    23. ITileLayerOverlay
    24. IWrappable
    25. IWrappableEventDispatcher
  1. com.google.maps.styles
    1. BevelStyle
    2. ButtonFaceStyle
    3. ButtonStyle
    4. FillStyle
    5. GradientStyle
    6. MapTypeStyle
    7. MapTypeStyleElementType
    8. MapTypeStyleFeatureType
    9. MapTypeStyleRule
    10. RectangleStyle
    11. StrokeStyle
  1. com.google.maps.controls
    1. ControlBase
    2. ControlPosition
    3. MapTypeControl
    4. MapTypeControlOptions
    5. NavigationControl
    6. NavigationControlOptions
    7. OverviewMapControl
    8. OverviewMapControlOptions
    9. PositionControl
    10. PositionControlOptions
    11. ScaleControl
    12. ScaleControlOptions
    13. ZoomControl
    14. ZoomControlOptions
  1. com.google.maps.overlays
    1. EncodedPolylineData
    2. GroundOverlay
    3. GroundOverlayOptions
    4. Marker
    5. MarkerOptions
    6. OverlayBase
    7. Polygon
    8. PolygonOptions
    9. Polyline
    10. PolylineOptions
    11. TileLayerOverlay
  1. com.google.maps.geom
    1. Attitude
    2. Point3D
    3. TransformationGeometry
  1. com.google.maps.services
    1. ClientGeocoder
    2. ClientGeocoderOptions
    3. Directions
    4. DirectionsEvent
    5. DirectionsOptions
    6. Elevation
    7. ElevationEvent
    8. ElevationResponse
    9. GeocodingEvent
    10. GeocodingResponse
    11. MaxZoom
    12. MaxZoomEvent
    13. Placemark
    14. Route
    15. ServiceStatus
    16. Step

class Alpha

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.

Fields Summary

Constants

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

Back to top

class Color

Color stores a color and provides methods for conversion between different textual and numeric representations of color.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
BLACK 0x000000
BLUE 0x0000ff
CYAN 0x00ffff
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

Properties

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.

Constructors

Color(clr:Number)

Constructs a Color from a Number.

var col:Color = new Color(0x0000ff);  // blue
Parameter Type Description
clr Number

Static Methods

toHtml(color:Number): String

Returns 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.

Instance Methods

incRGB(deltaR:Number, deltaG:Number, deltaB:Number): void

Increments 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): void

Sets 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(): String

Returns 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"

Back to top

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.

Constructors Summary

Methods Summary

Constructors

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.

Instance Methods

getBounds(): LatLngBounds

Retrieves 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(): String

Retrieves the copyright id.

getMaxZoom(): Number

Retrieves the maximum zoom level that applies to the copyright.

getMinZoom(): Number

Retrieves the minimum zoom level that applies to the copyright.

getText(): String

Retrieves the copyright text.

isSupplemental(): Boolean

Returns 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.

Back to top

class CopyrightCollection

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.

Implements

Constructors Summary

Methods Summary

Constructors

CopyrightCollection(opt_prefix?:String)

Creates a copyright collection for the given map type/spec.

Parameter Type Description
opt_prefix? String

Prefix for copyrights (optional).

Instance Methods

addCopyright(copyright:Copyright): Boolean

Adds 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): CopyrightNotice

Returns a CopyrightNotice instance for the given viewport.

Parameter Type Description
bounds LatLngBounds

Query bounds.

zoom Number

Zoom level.

getCopyrights(bounds:LatLngBounds, zoom:Number): Array

Retrieves 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): Array

Returns 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.

Back to top

class CopyrightNotice

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.

Constructors Summary

Methods Summary

Constructors

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.

Instance Methods

getPrefix(): String

Retrieves the copyright prefix.

getTexts(): Array

Retrieves the array of copyright texts. Each element in this array is of type String.

toString(): String

Returns 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"

Back to top

class InfoWindowOptions

Class InfoWindowOptions specifies a set of rendering parameters for the info window.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
ALIGN_CENTER 1
ALIGN_LEFT 0
ALIGN_RIGHT 2

Properties

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.

Constructors

InfoWindowOptions(param?:Object)

Constructs an InfoWindowOptions object, optionally initializing it from an object.

// Specifying all InfoWindowOptions properties.
var titleFormat:TextFormat = new TextFormat();
titleFormat.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

Static Methods

getDefaultOptions(): InfoWindowOptions

Retrieves 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.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class LatLng

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.

Fields Summary

Constructors Summary

Methods Summary

Constants

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%.

Constructors

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.

Static Methods

fromRadians(lat:Number, lng:Number, opt_noCorrect?:Boolean): LatLng

Creates 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): LatLng

Parses a string of the form "lat,lng" and returns a point with those values, or null if the string could not be successfully parsed.

// Create a LatLng from a text string.
var location:LatLng = LatLng.fromUrlValue("-34,151");
Parameter Type Description
value String

"lat,lng" string to parse.

wrapLatLng(latLng:LatLng): LatLng

Returns 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.

Instance Methods

angleFrom(other:LatLng): Number

Returns 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(): LatLng

Returns a new LatLng object that is a copy of this.

distanceFrom(other:LatLng, opt_radius?:Number): Number

Returns 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): Boolean

Tests 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(): Number

Returns the latitude in degrees.

latRadians(): Number

Returns the latitude in radians.

lng(): Number

Returns the longitude in degrees.

lngRadians(): Number

Returns the longitude in radians.

toString(): String

Returns a string representation of this LatLng, for example "48.8584, 2.2944" for Paris.

toUrlValue(opt_precision?:Number): String

Returns a string of the form "lat,lng" for this LatLng. We round the lat/lng values to 6 decimal places by default.

precision approximate error
-1 1000 kilometers / 700 miles
0 100 kilometers / 70 miles
1 10 kilometers / 7 miles
2 1 kilometer / 0.7 miles
3 100 meters / 300 feet
4 10 meters / 30 feet
5 1 meter / 3 feet
6 10 centimeters / 4 inches
7 1 centimeter (a nickel)

Parameter Type Description
opt_precision? Number

Number of digits following decimal point.

Back to top

class LatLngBounds

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.

Constructors Summary

Methods Summary

Constructors

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).

Instance Methods

clone(): LatLngBounds

Creates a clone of this instance.

containsBounds(other:LatLngBounds): Boolean

Returns 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): Boolean

Returns 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): Boolean

Returns 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): void

Extends 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(): LatLng

Computes 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(): Number

Returns the east longitude of this bounds.

getNorth(): Number

Returns the north latitude of this bounds.

getNorthEast(): LatLng

Returns the north-east corner of this bounds.

getNorthWest(): LatLng

Returns the north-west corner of this bounds.

getSouth(): Number

Returns the south latitude of this bounds.

getSouthEast(): LatLng

Returns the south-east corner of this bounds.

getSouthWest(): LatLng

Returns the south-west corner of this bounds.

getWest(): Number

Returns the west longitude of this bounds.

intersects(other:LatLngBounds): Boolean

Returns true if this bounds shares any points with this bounds.

Parameter Type Description
other LatLngBounds

Test LatLngBounds.

isEmpty(): Boolean

Returns true if the bounds are empty.

isFullLat(): Boolean

Returns true if the bounds cover all latitudes.

isFullLng(): Boolean

Returns true if the bounds cover all longitudes.

isLargerThan(other:LatLngBounds): Boolean

Returns true if this bounds is larger than (could contain) the other.

Parameter Type Description
other LatLngBounds

toSpan(): LatLng

Converts 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(): String

Converts 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): void

Extends 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.

Back to top

class Map

This is the main class of the Maps API for Flash. Instantiate Map to create a map.

Map has a number of properties used for global configuration. It is important to note that these values are only used during initialization. Whilst they can later be set to different values, doing so will have no effect upon the map.

You should ensure that these properties are set to appropriate values before the map is added as a child of another display object.

The properties in this category are:

  • countryCode
  • key
  • language
  • languages (AIR only)
  • url (AIR only)
  • version

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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

sensor String

The map sensor property, may be "false" or "true".

Use of the Google Maps API now requires that you indicate whether your application is using a sensor (such as a GPS locator) to determine the user's location.

url String

The url parameter for use in AIR applications.

version String

The desired map library version.

Constructors

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.

Instance Methods

addControl(control:IControl): void

Registers 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): void

Registers a new map type.

Parameter Type Description
newMapType IMapType

New map type to register.

addOverlay(overlay:IOverlay): void

Adds 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(): void

Removes all controls from the map.

clearOverlays(): void

Removes all overlays from the map.

closeInfoWindow(): Boolean

Closes the information window.

continuousZoomEnabled(): Boolean

Checks whether continuous zoom is enabled.

controlByKeyboardEnabled(): Boolean

Checks whether control by keyboard is enabled.

crosshairsEnabled(): Boolean

Checks whether center crosshairs are enabled.

delayCall(call:Function): void

Delay a method call until the next frame.

Parameter Type Description
call Function

Method to invoke in the next frame.

disableContinuousZoom(): void

Disables continuous smooth zooming.

disableControlByKeyboard(): void

Disables control by keyboard.

disableCrosshairs(): void

Disables the center crosshairs.

disableDragging(): void

Disables dragging of the map.

disableScrollWheelZoom(): void

Disables zooming using a mouse's scroll wheel.

draggingEnabled(): Boolean

Checks whether dragging of the map is enabled.

enableContinuousZoom(): void

Enables continuous smooth zooming.

enableControlByKeyboard(): void

Enables control by keyboard.

enableCrosshairs(): void

Enables the center crosshairs.

enableDragging(): void

Enables dragging of the map.

enableScrollWheelZoom(): void

Enables zooming using a mouse's scroll wheel.

fromLatLngToPoint(latLng:LatLng, opt_zoom?:Number): Point

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

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): Point

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

Parameter Type Description
latLng LatLng

LatLng coordinate of the point on the map.

opt_disablewrap? Boolean

Whether wrapping of the map around +180/-180 degree longtitude is disabled.

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

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

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

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

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

fromPointToLatLng(pos:Point, opt_zoom?:Number, opt_nowrap?:Boolean): LatLng

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

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): LatLng

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

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): Number

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

Parameter Type Description
bounds LatLngBounds

Bounds to show.

getCenter(): LatLng

Retrieves coordinates of the center in the map view control.

getCurrentMapType(): IMapType

Retrieves the current map type.

getDisplayObject(): DisplayObject

Retrieves the display object that represents the map.

getDoubleClickMode(): Number

Get the mouse double click mode.

getImplementationVersion(): String

Gets the version of the implementation library SWF.

getInterfaceVersion(): String

Retrieves the version of the client interface.

getLatLngBounds(): LatLngBounds

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

getMapTypes(): Array

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

getMaxZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): Number

Retrieves 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): Number

Retrieves 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(): MapOptions

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

getPaneManager(): IPaneManager

Retrieves the pane manager for the map.

getPrintableBitmap(): Bitmap

Returns a Bitmap instance containing a snapshot image of the map for printing.

The map itself may contain content loaded from multiple domains. This method requires that the domain maps.googleapis.com is granted access to any content that appears on the map via a crossdomain.xml file. For example, if your map uses a custom tile layer containing tiles loaded from URLs with the form http://www.thirdpartymap.com/path/tile_x_y_z.png, place a crossdomain.xml file at http://www.thirdpartymap.com/path/crossdomain.xml. Load this file using Security.loadPolicyFile() and when loading the tile images ensure that you use a LoaderContext instance whose checkPolicyFile property is true.

Note that by using path/ in the above URLs you can grant maps.googleapis.com privileged access only to content below http://www.thirdpartymap.com/path/, rather than to all content on www.thirdpartymap.com.

getProjection(): IProjection

Returns the projection being applied to the map.

getSize(): Point

Retrieves the map view size.

getZoom(): Number

Retrieves the map zoom level.

isLoaded(): Boolean

Checks whether the map has been initialized.

openInfoWindow(latlng:LatLng, options?:InfoWindowOptions): IInfoWindow

Opens a simple information window at the given point.

Parameter Type Description
latlng LatLng

Point at which the info window is opened.

options? InfoWindowOptions

Info window options.

panBy(distance:Point, animate?:Boolean): void

Starts a pan animation by the given distance in pixels.

Parameter Type Description
distance Point

Distance in pixels

animate? Boolean

Whether the change may be animated.

panTo(latLng:LatLng): void

Changes the center location of the map to the given location. If the location is already visible in the current map view, changes the center in a smooth animation.

Parameter Type Description
latLng LatLng

Coordinates for the new center.

removeControl(control:IControl): void

Removes 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): void

Removes a registered map type.

Parameter Type Description
oldMapType IMapType

Map type to unregister.

removeOverlay(overlay:IOverlay): void

Removes an overlay from the map.

Parameter Type Description
overlay IOverlay

Overlay to be removed from the map.

returnToSavedPosition(): void

Returns map to the saved position.

savePosition(): void

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

scrollWheelZoomEnabled(): Boolean

Checks whether scroll wheel zooming is enabled.

setCenter(latLng:LatLng, opt_zoom?:Number, opt_mapType?:IMapType): void

Changes the center location of the map.

Parameter Type Description
latLng LatLng

Coordinates for the new center.

opt_zoom? Number

New zoom level.

opt_mapType? IMapType

New map type.

setDoubleClickMode(val:Number): void

Set the mouse double click mode.

Parameter Type Description
val Number

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

setInitOptions(options:MapOptions): void

Sets the options used to initialize the Map. You should ONLY call this method whilst handling a MapEvent.MAP_PREINITIALIZE event. Before this event values which you need for MapOptions properties may not themselves have been configured. After this event map initialization will have progressed past the point at which MapOptions properties are used.

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): void

Changes the map type for the map.

Parameter Type Description
mapType IMapType

Map type.

setSize(newSize:Point): void

Sets the size of the map view.

Parameter Type Description
newSize Point

New view size for the map.

setZoom(level:Number, opt_doContinuousZoom?:Boolean): void

Changes 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(): void

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

zoomIn(opt_latlng?:LatLng, opt_doCenter?:Boolean, opt_doContinuousZoom?:Boolean): void

Zooms 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): void

Zooms 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).

Back to top

class Map3D

This is the main class of the Maps API for Flash that supports 3-D maps. You should base your map on this class, rather than on com.google.maps.Map when you wish to use perspective or orthogonal views of the map and its contents.

Map has a number of properties used for global configuration. It is important to note that these values are only used during initialization. While they can later be set to different values, doing so will have no effect upon the map.

You should ensure that these properties are set to appropriate values before the map is added as a child of another display object.

The properties in this category are:

  • countryCode
  • key
  • language
  • languages (AIR only)
  • url (AIR only)
  • version

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
camera ICamera

The camera that provides methods for transforming coordinates when in 3-D viewing modes.

dragMode int

The drag mode that is being used on the map. Acceptable values for this property are MapAction.DRAGMODE_LATLNG, MapAction.DRAGMODE_PITCH and MapAction.DRAGMODE_YAW.

By default, the drag mode is updated automatically immediately before dispatching MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP events based on the state of the CTRL and SHIFT keyboard modifier keys. If SHIFT is pressed, the drag mode is set to MapAction.DRAGMODE_MAP_YAW_PITCH, else if CTRL is pressed the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH; if neither is pressed the drag mode is set to MapAction.DRAGMODE_LATLNG.

It is recommended that you keep this behavior. It is consistent with that in Google Earth. However, if you need to change it, you should attach listeners both to MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP. Within your handler you then can set an appropriate map dragging mode based on parameters including mouse location and keyboard modifier key state.

Note that since the drag mode can change immediately before, and while handling, MapMouseEvent.DRAG_STEP, a new drag mode can begin without the user having first released the mouse button. If the drag mode is changed in the middle of a drag operation, you will receive DRAG_STOP and DRAG_START events before the drag operation proceeds with the new drag mode.

viewMode int

The view mode that is being applied to map. Acceptable values for this property are View.VIEWMODE_2D, View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL.

Constructors

Map3D()

Constructs a Map3D instance. When this runs none of the bindable variables has yet been initialized. We defer actions that depend upon them until we have been added to the stage.

Instance Methods

cancelFlyTo(): void

Aborts any map motion initiated by a call to flyTo() and causes MapEvent.FLY_TO_CANCELED and MapEvent.FLY_TO_DONE to be dispatched.

Calling this method has no effect if no flight is occurring.

flyTo(center:LatLng, zoom?:Number, attitude?:Attitude, duration?:Number): void

Changes the center location, zoom and attitude of the map over a given period. You can use a period of 0 if you wish the change to be instantaneous.

You can make repeated calls to flyTo() before animation has completed for a previous call if you wish to fly a complex route. Each flight segment will be queued and performed in sequence. If more than one flight segment is queued then cubic splines will be used to interpolate the camera location and attitude.

By default the user can interact with the map while a flight is occurring and doing so will not terminate the flight (it will continue through the remaining segments from the time the user releases control). However, a method cancelFlyTo() is available if you wish to abort the remaining portion of the flight.

MapEvent.FLY_TO_DONE is dispatched when the flight terminates (whether or not it was canceled).

Parameter Type Description
center LatLng

Coordinates for the new map center.

zoom? Number

New map zoom level.

attitude? Attitude

New map attitude.

duration? Number

Duration in seconds over which the change occurs.

getAttitude(): Attitude

Gets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.

setAttitude(value:Attitude): void

Sets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.

Parameter Type Description
value Attitude

New map attitude.

setInitOptions(options:MapOptions): void

Sets the options used to initialize the Map. 3-D maps, by default, have controlByKeyboard set true (developers are free to override this if they wish). The implementation here, that merges new defaults with passed-in options, is necessary since the property Map.options is private and so not directly accessible.

Parameter Type Description
options MapOptions

Instance of MapOptions that overrides the defaults used to initialize the map; or null to use only the default options.

Back to top

class MapAction

Constants used to identify map actions.

Fields Summary

Constants

Name Value Description
ACTION_NOTHING 3

No action.

ACTION_PAN 0

Pan action.

ACTION_PAN_ZOOM_IN 2

Pan and zoom-in action.

ACTION_ZOOM_IN 1

Zoom-in action.

DRAGMODE_CAMERA_YAW_PITCH 4

Mouse drag changes camera yaw and pitch on a 3-D map.

DRAGMODE_LATLNG 0

Mouse drag changes map latitude and longitude (map center).

DRAGMODE_MAP_YAW_PITCH 3

Mouse drag changes yaw and pitch of a 3-D map.

DRAGMODE_PITCH 1

Mouse drag changes pitch of a 3-D map.

DRAGMODE_YAW 2

Mouse drag changes yaw of a 3-D map.

Back to top

class MapAttitudeEvent

A MapAttitudeEvent object is dispatched into the event flow whenever the map attitude is changing.

Fields Summary

Constructors Summary

Constants

Name Value Description
ATTITUDE_CHANGE_END mapevent_attitudechangeend

This event is fired when the change of the map view ends.

ATTITUDE_CHANGE_START mapevent_attitudechangestart

This event is fired when the map attitude starts changing.

ATTITUDE_CHANGE_STEP mapevent_attitudechangestep

This event is fired repeatedly while the map attitude is changing.

Properties

Name Type Description
attitude Attitude

Attitude of the map.

Constructors

MapAttitudeEvent(type:String, attitude:Attitude, bubbles?:Boolean, cancellable?:Boolean)

Creates a MapMoveEvent object to pass as a parameter to event listeners.

Parameter Type Description
type String

The type of the event, accessible as MapMoveEvent.type.

attitude Attitude

Map's latLng.

bubbles? Boolean

Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.

cancellable? Boolean

Determines whether the Event object can be cancelled. The default values is false.

Back to top

class MapEvent

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).

Fields Summary

Constructors Summary

Constants

Name Value Description
CONTROL_ADDED mapevent_controladded

This event is fired on the map when a control is added to the map.

CONTROL_REMOVED mapevent_controlremoved

This event is fired on the map when a control is removed from the map.

COPYRIGHTS_UPDATED mapevent_copyrightsupdated

This event is fired when the copyright that should be displayed on the map is updated. Dispatched by MapType and CopyrightCollection objects.

FLY_TO_CANCELED mapevent_flytocanceled

This event is fired when the map motion produced by a call to Map3D.flyTo() is canceled via a call to Map3D.cancelFlyTo(). The flyyTo() and flyToCancel() methods are only supported on 3-D maps.

FLY_TO_DONE mapevent_flytodone

This event is fired when the map motion produced by a call to Map3D.flyTo() completes. The flyTo() method is currently only supported on 3-D maps.

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.

MAPTYPE_STYLE_CHANGED mapevent_maptypestylechanged

This event is fired when the style of a styled map type changes.

MAP_PREINITIALIZE mapevent_mappreinitialize

This event is fired immediately before the map is initialized. This event indicates the correct time to call setInitOptions(...) on the map, passing an instance of MapOptions that contains options that the map should have when first displayed.

MAP_READY mapevent_mapready

This event is fired when map initialization is complete and isLoaded() would return true. This means position, zoom and map type are all initialized, but tile images may still be loading.

OVERLAY_BEFORE_REMOVED mapevent_overlaybeforeremoved

This event is fired when an overlay is about to be removed from the map.

OVERLAY_MOVED mapevent_overlaymoved

This event is fired when an overlay's position is changed. This currently applies only to markers and is fired either at the end of dragging or after a call to setLatLng().

OVERLAY_REMOVED mapevent_overlayremoved

This event is fired after a single overlay is removed from the map. Developers can use this event to do final clean-up on an overlay instance.

SIZE_CHANGED mapevent_sizechanged

This event is fired when the size of the map has changed.

TILES_LOADED mapevent_tilesloaded

This event is fired when all visible target tiles have finished loading.

Target tiles are the tiles that we ideally use to render the map. The distinction between target tiles and all tiles is relevant mainly when displaying a 3-D map. The target tiles make up the set of tiles that we wish to use to render the map. However, while any of these tiles have not yet been loaded we may use lower or higher resolution tiles in their place so that holes do not appear in the rendered map.

Note that this event is dispatched repeatedly during normal panning and zooming of the map.

If you wish to detect when the map's tiles are first loaded, attach a listener for this event while handling MapEvent.MAP_PREINITIALIZE. You should also set the initial map view (center, zoom, map type, and, if you are showing a 3-D map, attitude) within this function as this initial map view is the one to which the subsequent TILES_LOADED event will apply.

This event is dispatched by the map and by TileLayerOverlay instances.

TILES_LOADED_PENDING mapevent_tilesloadedpending

This is a companion event to MapEvent.TILES_LOADED indicating that loading of new tiles has been initiated and that MapEvent.TILES_LOADED will be dispatched when all tiles have loaded.

MapEvent.TILES_LOADED_PENDING may be dispatched multiple times before MapEvent.TILES_LOADED is dispatched if we are repeatedly loading more tiles. If you want to use a timeout to perform appropriate action should tiles not load, the API behavior allows flexibility in whether you count the time from when the first or the last tile load is initiated.

VIEW_CHANGED mapevent_viewchanged

This event is fired when the map view changes.

VISIBILITY_CHANGED mapevent_visibilitychanged

This event is fired when an overlay's visibility has changed (from visible to hidden or vice-versa).

Properties

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).

Constructors

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.

Back to top

class MapMouseEvent

A MapMouseEvent object is dispatched into the event flow whenever a mouse-related event specific to the map or its overlays occurs.

Fields Summary

Constructors Summary

Constants

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.

Properties

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.

Constructors

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

Back to top

class MapMoveEvent

A MapMoveEvent object is dispatched into the event flow whenever the map view is changing.

Fields Summary

Constructors Summary

Constants

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.

Properties

Name Type Description
latLng LatLng

LatLng over which the MapMoveEvent occurred.

Constructors

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.

Back to top

class MapOptions

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.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
attitude Attitude

The camera attitude for 3-D view modes. You need to use a Map3D instance as your map if you are to make use of this property. The property will be ignored if you are using a standard Map instance.

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.

scrollWheelZoom Object

A Boolean value that indicates whether the map initially provides scroll wheel zoom.

viewMode Object

An int value that indicates the map view mode. You need to use a Map3D instance as your map if you are to make use of this property. The property will be ignored if you are using a standard Map instance. Supported view modes are View.VIEWMODE_2D, View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL.

zoom Object

A Number value that specifies the initial map zoom level.

Constructors

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,
  scrollWheelZoom: 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.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class MapType

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.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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

Constructors

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.

Instance Methods

getAlt(): String

Returns 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): Number

Returns 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): Array

Returns 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(): String

Returns the text to be displayed if a tile fails to download.

getLinkColor(): Number

If 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(): Number

Returns the max resolution override.

getMaximumResolution(opt_point?:LatLng): Number

Returns 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): Number

Returns 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): String

Retrieves the map type name.

Parameter Type Description
opt_short? Boolean

Return the abbreviated name.

getProjection(): IProjection

Retrieves the map type projection.

getRadius(): Number

Returns the radius of the planet for which this map type is defined.

getSpanZoomLevel(center:LatLng, span:LatLng, viewSize:Point): Number

Returns 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(): Number

If controls are textual, returns the appropriate color to display the text. The copyright control uses this color, for example.

getTileLayers(): Array

Gets the list of tile layers for this map type in the z-order they should be displayed. Note that this cannot be used to change the displayed tile layers after construction of a MapType instance. You must create a new MapType if you wish to display a different set of layers.

getTileSize(): Number

Gets 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(): String

Returns a string that may be used as a URL parameter to identify this map type in permalinks to the current map view. This is currently only used internally. Note that if any built-in tile layers are used in constructing a custom map type, the returned value will be based on the set of layers rather than on any developer-supplied value.

setMaxResolutionOverride(maxResolution:Number): void

Sets 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.

Back to top

class MapTypeOptions

MapTypeOptions class specifies a set of parameters for map types.

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

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.

Static Methods

getDefaultOptions(): MapTypeOptions

Retrieves 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.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class MapZoomEvent

A MapMouseEvent object is dispatched into the event flow whenever the map is being zoomed in or out.

Fields Summary

Constructors Summary

Constants

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.

Properties

Name Type Description
zoomLevel Number

Current zoom level for the map.

Constructors

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.

Back to top

class PaneId

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.

Fields Summary

Constants

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.

Back to top

class ProjectionBase

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.

Implements

Constructors Summary

Methods Summary

Constructors

ProjectionBase()

Constructs an instance of ProjectionBase.

Instance Methods

fromLatLngToPixel(latLng:LatLng, zoom:Number): Point

Returns 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): LatLng

Returns 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): Number

Returns 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): Boolean

Tests 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.

Back to top

class StyledMapType

Class StyledMapType defines a styled map type for the map.

Implements

Constructors Summary

Methods Summary

Constructors

StyledMapType(style:Array, options?:StyledMapTypeOptions)

Creates an instance of a StyledMapType object.

Parameter Type Description
style Array

Array of MapTypeStyle elements. Each is applied consecutively. You can also use an array of untyped objects containing the appropriate fields. See setStyle() for details.

options? StyledMapTypeOptions

Options for the styled map.

Instance Methods

getAlt(): String

Returns 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): Number

Returns 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): Array

Returns 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(): String

Returns the text to be displayed if a tile fails to download.

getLinkColor(): Number

If 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(): Number

Returns the max resolution override.

getMaximumResolution(opt_point?:LatLng): Number

Returns 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): Number

Returns 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): String

Retrieves the map type name.

Parameter Type Description
opt_short? Boolean

Return the abbreviated name.

getProjection(): IProjection

Retrieves the map type projection.

getRadius(): Number

Returns the radius of the planet for which this map type is defined.

getSpanZoomLevel(center:LatLng, span:LatLng, viewSize:Point): Number

Returns 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.

getStyle(): Array

Gets the map type style.

getTextColor(): Number

If controls are textual, returns the appropriate color to display the text. The copyright control uses this color, for example.

getTileLayers(): Array

Gets the list of tile layers for this map type in the z-order they should be displayed. Note that this cannot be used to change the displayed tile layers after construction of a MapType instance. You must create a new MapType if you wish to display a different set of layers.

getTileSize(): Number

Gets 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(): String

Returns a string that may be used as a URL parameter to identify this map type in permalinks to the current map view. This is currently only used internally. Note that if any built-in tile layers are used in constructing a custom map type, the returned value will be based on the set of layers rather than on any developer-supplied value.

setMaxResolutionOverride(maxResolution:Number): void

Sets 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.

setStyle(style:Array): void

Sets the map type style.

// Setting the style using an array of MapTypeStyle instance.
styledMapType.setStyle([
    new MapTypeStyle(MapTypeStyleFeatureType.ALL,
                     MapTypeStyleElementType.ALL,
                     [MapTypeStyleRule.saturation(-20)]),
    new MapTypeStyle(MapTypeStyleFeatureType.ROAD,
                     MapTypeStyleElementType.GEOMETRY,
                     [MapTypeStyleRule.hue(0xff0000)])]);
    ]);
// Setting the style using an array of objects.
styledMapType.setStyle([
    {elementType: 'all',
     featureType: 'all',
     stylers: [{saturation: -20}]},
    {elementType: 'geometry',
     featureType: 'road',
     stylers: [{hue: 0xff0000}]}]);
Parameter Type Description
style Array

Array of MapTypeStyle instances. You can also pass in an Array of untyped objects containing the appropriate fields: it is often more concise to specify style as an object literal.

Back to top

class StyledMapTypeOptions

StyledMapTypeOptions class specifies a set of parameters for styled map types.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
alt String

Alternative text.

baseMapType Object

A IStyledMapType instance whose style should be used as a base for defining a StyledMapType instance's style. The MapTypeStyle rules will be appended to the base's styles. This base style is captured when creating a StyledMapType instance: subsequently changing the base style will not affect the derived style.

maxResolution Object

A Number value that specifies the maximum zoom level for this map type.

minResolution Object

A Number value that specifies the minimum zoom level for this map type.

name String

Name to display in the map type control.

Constructors

StyledMapTypeOptions(param?:Object)

Constructs a new StyledMapTypeOptions object, optionally initializing it from an object.

var options:StyledMapTypeOptions = new StyledMapTypeOptions({
  minResolution: 4,
  maxResolution: 16,
  name: "Highlighted roads",
  alt: "Roads"
});
Parameter Type Description
param? Object

An initialization object that contains a set of initial values for the StyledMapTypeOptions instance.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class TileLayerBase

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.

Implements

Constructors Summary

Methods Summary

Constructors

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

Instance Methods

getAlpha(): Number

Returns 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(): ICopyrightCollection

Retrieves the copyright collection responsible for handling copyright for this tile layer.

getMapType(): IMapType

Retrieves the map type for this tile layer.

getMaxResolution(): Number

Returns the finest zoom level.

getMinResolution(): Number

Returns the coarsest zoom level.

loadTile(tilePos:Point, zoom:Number): DisplayObject

Creates 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): void

Sets the map type for this tile layer.

Parameter Type Description
mapType IMapType

Map type.

Back to top

class View

Class View provides constants for use with 3-D maps.

Fields Summary

Constants

Name Value Description
VIEWMODE_2D 0

Conventional 2-D map view.

VIEWMODE_ORTHOGONAL 2

3-D orthogonal map view. This is an alternative to VIEW_PERSPECTIVE that provides limited depth cues but lacks scaling of features with distance. If using Flash 9, VIEW_ORTHOGONAL will result in more rapid rendering.

VIEWMODE_PERSPECTIVE 1

3-D perspective map view. Perspective projection requires significant computation on Flash 9, but is natively supported by Flash 10. If targeting Flash 9 you may wish to consider using VIEW_ORTHOGONAL, which will result in more rapid rendering.

Back to top

class ControlBase

Base class for controls. Sub-class this to provide a custom control for the map.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
map IMap
position ControlPosition

Constructors

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.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves the control's display object (typically, the control itself).

getSize(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Changes control's position.

Parameter Type Description
controlPosition ControlPosition

Control's new position.

Back to top

class ControlPosition

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.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
ANCHOR_BOTTOM_LEFT 0x20

The control will be anchored in the bottom left corner of the map.

ANCHOR_BOTTOM_RIGHT 0x21

The control will be anchored in the bottom right corner of the map.

ANCHOR_TOP_LEFT 0

The control will be anchored in the top left corner of the map.

ANCHOR_TOP_RIGHT 1

The control will be anchored in the top right corner of the map.

AUTO_ALIGN_NONE 0

The control will not be automatically aligned.

AUTO_ALIGN_X 1

The control will be aligned automatically horizontally so as not to overlap with one another.

AUTO_ALIGN_Y 2

The control will be aligned automatically vertically so as not to overlap with one another.

Constructors

ControlPosition(anchor:Number, opt_paddingX?:Number, opt_paddingY?:Number, opt_autoAlign?:uint)

Constructs a ControlPosition from offsets relative to a specified map corner.

// Create a ControlPosition instance to anchor a control 16 pixels
// left of and 10 pixels below the top-right corner of the map.
var position:ControlPosition = new ControlPosition(
  ControlPosition.ANCHOR_TOP_RIGHT, 16, 10);
Parameter Type Description
anchor Number

Anchor type.

opt_paddingX? Number

Horizontal padding (defaults to 0).

opt_paddingY? Number

Vertical padding (if different from horizontal padding).

opt_autoAlign? uint

Sets whether the control should be automatically aligned.

Instance Methods

equals(other:ControlPosition): Boolean

Tests against another ControlPosition for equality.

Parameter Type Description
other ControlPosition

ControlPosition to compare with.

getAnchor(): Number

Retrieves the anchor identifier.

// Test whether a position is anchored to the map's bottom-left
// corner.
if (position.getAnchor()==ControlPosition.ANCHOR_BOTTOM_LEFT)
  trace("Positioned relative to the map's bottom-left corner.");

getAutoAlign(): uint

Retrieves the automatic alignment type.

getOffsetX(): Number

Retrieves the horizontal offset.

getOffsetY(): Number

Retrieves the vertical offset.

toString(): String

String representation of position object.

Back to top

class MapTypeControl

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().

Implements

Constructors Summary

Methods Summary

Constructors

MapTypeControl(options?:MapTypeControlOptions)

Constructs a MapTypeControl object.

Parameter Type Description
options? MapTypeControlOptions

Map type control options.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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.

Back to top

class MapTypeControlOptions

Class MapTypeControlOptions specifies a set of options for the map type control.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
ALIGN_HORIZONTALLY 0

Align buttons horizontally

ALIGN_VERTICALLY 1

Align buttons vertically

Properties

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.

Constructors

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)
}

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

NavigationControl allows the user to change the navigation parameters of the map - zoom, center and attitude (for a 3D map).

Implements

Constructors Summary

Methods Summary

Constructors

Constructs a NavigationControl object.

Parameter Type Description

Instance Methods

Retrieves the control position.

Retrieves 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).

Retrieves the control's size.

Sets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().

Parameter Type Description

Sets the control's position and updates its position on the map.

navigatorControl.setControlPosition(
    new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));
Parameter Type Description

Back to top

Class NavigationControlOptions specifies a set of options for the navigation control.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description

Constructors

Constructs an instance of NavigationControlOptions, optionally initializing it from a generic object.

Parameter Type Description

Instance Methods

Returns a String representation of this object.

Back to top

class OverviewMapControl

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.

Implements

Constructors Summary

Methods Summary

Constructors

OverviewMapControl(options?:OverviewMapControlOptions)

Constructs a OverviewMapControl object.

Parameter Type Description
options? OverviewMapControlOptions

Map overview control options.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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): void

Changes the control's size.

Parameter Type Description
newSize Point

Control's new size in pixels.

Back to top

class OverviewMapControlOptions

Class OverviewMapControlOptions specifies a set of options for the overview map control.

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

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)
}

Instance Methods

toString(): String

toString method.

Back to top

class PositionControl

A PositionControl contains a set of panning buttons to pan the map.

Implements

Constructors Summary

Methods Summary

Constructors

PositionControl(options?:PositionControlOptions)

Constructs a PositionControl object.

Parameter Type Description
options? PositionControlOptions

Position control options.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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.

Back to top

class PositionControlOptions

Class PositionControlOptions specifies a set of options for the position control.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
buttonSize Point

Button size.

buttonSpacing Point

Button spacing.

buttonStyle ButtonStyle

Button style.

position ControlPosition

Control's position on the map.

Constructors

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)
}

Instance Methods

toString(): String

toString method. Returns a String representation of this object.

Back to top

class ScaleControl

A ScaleControl provides a control that shows the scale of the map.

Implements

Constructors Summary

Methods Summary

Constructors

ScaleControl(options?:ScaleControlOptions)

Constructs a ScaleControl object.

Parameter Type Description
options? ScaleControlOptions

Scale control options.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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.

Back to top

class ScaleControlOptions

Class ScaleControlOptions specifies a set of options for the scale control.

Fields Summary

Constructors Summary

Methods Summary

Constants

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.

Properties

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.

Constructors

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
  }
}

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class ZoomControl

A ZoomControl contains buttons for zooming the map in and out and a zoom slider.

Implements

Constructors Summary

Methods Summary

Constructors

ZoomControl(options?:ZoomControlOptions)

Constructs a ZoomControl object, with an optional options setting.

Parameter Type Description
options? ZoomControlOptions

Zoom control options.

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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.

Back to top

class ZoomControlOptions

Class ZoomControlOptions specifies a set of options for the zoom control.

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

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)
}

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class Attitude

Attitude represents the rotation of an object in space.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
pitch Number

roll Number

yaw Number

Constructors

Attitude(yaw:Number, pitch:Number, roll:Number)

Initializes roll, pitch, and yaw. All default to zero, which represents an object looking directly at the ground.

Parameter Type Description
yaw Number

Yaw in degrees.

pitch Number

Pitch in degrees.

roll Number

Roll in degrees.

Instance Methods

equals(other:Attitude): Boolean

Determines whether this attitude is identical to another attitude.

Parameter Type Description
other Attitude

The other attitude.

toString(): String

Generates a string representation of this object. This method returns a string listing, in order, the yaw, pitch and roll angles in degrees, comma-separated and enclosed in parentheses. An example is "(10, 20, 0)".

Back to top

class Point3D

Point3D represents a position in a 3-D coordinate system. It is used to hold x, y, z coordinate values.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
x Number

x coordinate.

y Number

y coordinate.

z Number

z coordinate.

Constructors

Point3D(x:Number, y:Number, z:Number)

Constructs a Point3D instance and initializes x, y and z.

Parameter Type Description
x Number

Initial x value.

y Number

Initial y value.

z Number

Initial z value..

Instance Methods

toString(): String

Returns a string that contains the values of the x, y and z coordinates. The string has the form "(x=x, y=y, z=z)", so calling the toString() method for a point at 12,15,16 would return "(x=12, y=15, z=16)".

Back to top

class TransformationGeometry

TransformationGeometry holds the geometry information necessary to reconstruct the camera projection that transforms world coordinates into viewport coordinates and vice-versa. Point3D instances are used to return values with x, y and z coordinate values.

Fields Summary

Constructors Summary

Properties

Name Type Description
cameraPosition Point3D

Camera position in world coordinates.

cameraXAxis Point3D

Normalized vector that is the projection of the camera x-axis into world coordinates.

cameraYAxis Point3D

Normalized vector that is the projection of the camera y-axis into world coordinates.

cameraZAxis Point3D

Normalized vector that is the projection of the camera z-axis into world coordinates.

focalLength Number

Distance from the camera to the viewport. The units are equal to the height of one screen pixel, but distance is measured along the screen's normal vector (from the screen surface, coming out of the screen). Should you wish to relate the Maps API for Flash 3-D geometry to that used in other 3-D modelling packages, then you can take the relationship between focalLength, the viewport's vertical extent, viewportSize.y, and the viewport's vertical field-of-view, fovy, to be: fovy = 2 x atan(viewportSize.y / (2 focalLength))

viewportSize Point

Size of the viewport in pixels.

Constructors

TransformationGeometry(cameraPosition:Point3D, cameraXAxis:Point3D, cameraYAxis:Point3D, cameraZAxis:Point3D, viewportSize:Point, focalLength:Number)

Constructs a TransformationGeometry instance and initializes its properties.

Parameter Type Description
cameraPosition Point3D

Camera position in world coordinates.

cameraXAxis Point3D

Normalized vector that is the projection of the camera x-axis into world coordinates.

cameraYAxis Point3D

Normalized vector that is the projection of the camera y-axis into world coordinates.

cameraZAxis Point3D

Normalized vector that is the projection of the camera z-axis into world coordinates.

viewportSize Point

Size of the viewport in pixels.

focalLength Number

Distance from the camera to the viewport.

Back to top

interface ICamera

Interface ICamera provides access to viewing geometry and transformation methods needed when using a map with perspective. Use Map3D.camera to return the map's camera as an ICamera instance.

Fields Summary

Methods Summary

Properties

Name Type Description
attitude Attitude

Map attitude.

center LatLng

Map center.

focalLength Number

Camera focal length.

is3D Boolean

Whether we are in 3-D view.

maxPitch Number

Maximum pitch in degrees.

maxRoll Number

Maximum roll in degrees.

maxYaw Number

Maximum yaw in degrees.

minPitch Number

Minimum pitch in degrees.

minRoll Number

Minimum roll in degrees.

minYaw Number

Minimum yaw in degrees.

shadowMatrix Matrix

Transformation matrix to apply to an image drawn on the viewport to generate its shadow (drawn on the viewport, but appears to stretch along the map).

viewport Point

Viewport size.

zoom Number

Map zoom.

zoomScale Number

Map zoom scale.

Instance Methods

getLatLngClosestToCenter(latLng:LatLng): LatLng

This method takes a LatLng and returns a LatLng that either is the same, or is adjusted by a multiple of 360 degrees longitudinally, so as to be as close as possible to the map center. In a 3-D viewing mode the returned LatLng will correspond to the visible region of the map. Mathematically, the given LatLng's longitude will be wrapped into the range [center_longitude-180, center_longitude+180].

Parameter Type Description
latLng LatLng

LatLng to be wrapped.

getTransformationGeometry(): TransformationGeometry

Returns camera transformation geometry information that can be used to construct a 4 x 4 matrix for transforming (x,y,z,w) positions. You can use this function as the basis for performing transformations more advanced than converting between 2-D world position and 2-D viewport position. The Google Maps API for Flash demo gallery contains examples of using these coefficients to perform full 3-D transformations.

getWorldViewPolygon(): Array

Returns the polygon that encloses the region of the map visible within the viewport. The vertices of this polygon are in world coords. This polygon is the boundary of the full map clipped to the viewport.

isAhead(latLng:LatLng): Boolean

Determines whether a point is in front of the camera. All points in front of the focal plane are considered to be in front of the camera. If this method returns true then it is guaranteed that latLngToViewport(latLng) will return a point below the horizon.

Parameter Type Description
latLng LatLng

Location to test.

isOnMap(viewportPoint:Point): Boolean

Determines whether a viewport point is on the displayed map, which in 3-D means whether it is below the horizon.

Parameter Type Description
viewportPoint Point

Viewport point to test.

latLngToViewport(latlng:LatLng): Point

Transforms a lat/lng location to a point on the viewport. This function always returns a point, although if the lat/lng is behind the camera then this point will be above the horizon. Therefore to determine whether a point is visible, users should first call isAhead, then this function. It is also possible for this function to return points that have both coordinates equal to infinity (occurs in the case that the point is on the boundary between the "forwards" and "backwards" parts of the world plane). Once again, querying isAhead first will prevent infinite points from being generated.

Parameter Type Description
latlng LatLng

Location as a LatLng.

latLngToWorld(latlng:LatLng): Point

Transforms a lat/lng location to world coordinates.

Parameter Type Description
latlng LatLng

Location as a LatLng.

viewportToLatLng(viewportPoint:Point): LatLng

Transforms a viewport location to lat/lng. This function always returns a location, although if the point is above the horizon then the lat/lng will be behind the camera. Therefore users should sanitize viewport locations using isOnMap before calling this function.

Parameter Type Description
viewportPoint Point

Location in viewport coordinates.

viewportToWorld(viewportPoint:Point): Point

Transforms viewport coordinate to world coordinates.

Parameter Type Description
viewportPoint Point

Viewport coordinates.

worldDistance(worldPoint:Point): Number

Returns the distance from the camera to a point given in world coordinates.

Parameter Type Description
worldPoint Point

Point in world coordinates.

worldToLatLng(worldPoint:Point): LatLng

Transforms world coordinates to an unwrapped lat/lng location.

Parameter Type Description
worldPoint Point

World coordinates.

worldToViewport(point:Point): Point

Transforms world coordinates to viewport coordinates.

Parameter Type Description
point Point

World coordinates.

Back to top

interface IClientGeocoder

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.

Implementing Classes

Methods Summary

Instance Methods

geocode(address:String): void

Initiates a geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.

Parameter Type Description
address String

Address to geocode.

getOptions(): ClientGeocoderOptions

Retrieves the geocoder object's options. Use the setOptions() method to modify geocoder options.

resetCache(): void

Resets the geocoding cache, clearing all results retrieved by this and other ClientGeocoder objects.

reverseGeocode(latLng:LatLng): void

Initiates 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): void

Updates 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.

Back to top

interface IControl

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.

Implementing Classes

Methods Summary

Instance Methods

getControlPosition(): ControlPosition

Retrieves the control position.

getDisplayObject(): DisplayObject

Retrieves 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(): Point

Retrieves the control's size.

initControlWithMap(map:IMap): void

Sets 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): void

Sets 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.

Back to top

interface ICopyrightCollection

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.

Implementing Classes

Methods Summary

Instance Methods

addCopyright(copyright:Copyright): Boolean

Adds 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): CopyrightNotice

Returns a CopyrightNotice instance for the given viewport.

Parameter Type Description
bounds LatLngBounds

Query bounds.

zoom Number

Zoom level.

getCopyrights(bounds:LatLngBounds, zoom:Number): Array

Retrieves 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): Array

Returns 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.

Back to top

interface IDirections

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.

Implementing Classes

Fields Summary

Methods Summary

Properties

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.

encodedPolylineData EncodedPolylineData

The encoded polyline data for the directions request.

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.

Instance Methods

clear(): void

Clears any existing directions results and cancels any pending load() requests.

createPolyline(options?:PolylineOptions): IPolyline

Create 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): Placemark

Return 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 0 to numGeocodes - 1, inclusive.

getOptions(): DirectionsOptions

Retrieves the directions object's options. Use the setOptions() method to modify directions object's options.

getRoute(i:uint): Route

Return 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 0 to numRoutes - 1, inclusive.

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): void

Updates 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.

Back to top

interface IElevation

IElevation is the interface implemented by an Elevation object. An Elevation object communicates with Google servers to obtain elevation information at one or more locations.

Implementing Classes

Methods Summary

Instance Methods

loadElevationAlongEncodedPath(encodedPolylineData:EncodedPolylineData, numPoints:int): void

Sends a request to Google servers to find the maximum elevation at one or more regularly spaced locations along a path. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
encodedPolylineData EncodedPolylineData

Encoded locations at which the elevations should be found. In contrast to loadElevationForEncodedLocations() you can pass complex encoded polyline data as returned by directions queries directly to this method, as elevation data is found only at the specified number of interpolated locations, rather than at every location defined by the EncodedPolylineData instance. The implementation, however, may internally simplify this data structure before use.

numPoints int

Number of points at which elevation is calculated.

loadElevationAlongPath(locations:Array, numPoints:int): void

Sends a request to Google servers to find the maximum elevation at one or more regularly spaced locations along a path. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
locations Array

Array of LatLng elements defining the path. Interpolation is used to generate the locations at which elevation is calculated.

numPoints int

Number of points at which elevation is calculated.

loadElevationForEncodedLocations(encodedPolylineData:EncodedPolylineData): void

Sends a request to Google servers to find the maximum elevation at one or more lat-lngs. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
encodedPolylineData EncodedPolylineData

Encoded locations at which the elevations should be found. Be aware that the encoded polyline data returned by directions queries can contain many thousands of locations and attempting to obtain elevation data for all of these is likely to exceed your quota. This method is suitable only for use with simplified encoded polyline data.

loadElevationForLocations(locations:Array): void

Sends a request to Google servers to find the maximum elevation at one or more lat-lngs. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
locations Array

Array of LatLng elements containing the locations at which the elevations should be found.

Back to top

interface IGroundOverlay

IGroundOverlay is the interface implemented by ground overlay objects. Ground overlays are images laid out over the map content whose corners are located with latitude/longitude pairs.

Ground overlays dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implementing Classes

Methods Summary

Instance Methods

getOptions(): GroundOverlayOptions

Retrieves 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.

Back to top

interface IInfoWindow

IInfoWindow is the interface implemented by information windows that can display HTML-formatted text.

Fields Summary

Properties

Name Type Description
removed Boolean

Checks whether the infowindow was removed.

Back to top

interface IMap

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.

Implementing Classes

Fields Summary

Methods Summary

Properties

Name Type Description
MERCATOR_PROJECTION IProjection

Retrieves Mercator projection.

overlayRaising Boolean

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

Instance Methods

addControl(control:IControl): void

Registers 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): void

Registers a new map type.

Parameter Type Description
newMapType IMapType

New map type to register.

addOverlay(overlay:IOverlay): void

Adds 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(): void

Removes all controls from the map.

clearOverlays(): void

Removes all overlays from the map.

closeInfoWindow(): Boolean

Closes the information window.

continuousZoomEnabled(): Boolean

Checks whether continuous zoom is enabled.

controlByKeyboardEnabled(): Boolean

Checks whether control by keyboard is enabled.

crosshairsEnabled(): Boolean

Checks whether center crosshairs are enabled.

disableContinuousZoom(): void

Disables continuous smooth zooming.

disableControlByKeyboard(): void

Disables control by keyboard.

disableCrosshairs(): void

Disables the center crosshairs.

disableDragging(): void

Disables dragging of the map.

disableScrollWheelZoom(): void

Disables zooming using a mouse's scroll wheel.

draggingEnabled(): Boolean

Checks whether dragging of the map is enabled.

enableContinuousZoom(): void

Enables continuous smooth zooming.

enableControlByKeyboard(): void

Enables control by keyboard.

enableCrosshairs(): void

Enables the center crosshairs.

enableDragging(): void

Enables dragging of the map.

enableScrollWheelZoom(): void

Enables zooming using a mouse's scroll wheel.

fromLatLngToPoint(latLng:LatLng, opt_zoom?:Number): Point

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

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): Point

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

Parameter Type Description
latLng LatLng

LatLng coordinate of the point on the map.

opt_disablewrap? Boolean

Whether wrapping of the map around +180/-180 degree longtitude is disabled.

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

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

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

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

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

fromPointToLatLng(pos:Point, opt_zoom?:Number, opt_nowrap?:Boolean): LatLng

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

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): LatLng

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

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): Number

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

Parameter Type Description
bounds LatLngBounds

Bounds to show.

getCenter(): LatLng

Retrieves coordinates of the center in the map view control.

getCurrentMapType(): IMapType

Retrieves the current map type.

getDisplayObject(): DisplayObject

Retrieves the display object that represents the map.

getDoubleClickMode(): Number

Get the mouse double click mode.

getImplementationVersion(): String

Gets the version of the implementation library SWF.

getLatLngBounds(): LatLngBounds

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

getMapTypes(): Array

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

getMaxZoomLevel(opt_mapType?:IMapType, opt_point?:LatLng): Number

Retrieves 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): Number

Retrieves 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(): MapOptions

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

getPaneManager(): IPaneManager

Retrieves the pane manager for the map.

getPrintableBitmap(): Bitmap

Returns a Bitmap instance containing a snapshot image of the map for printing.

The map itself may contain content loaded from multiple domains. This method requires that the domain maps.googleapis.com is granted access to any content that appears on the map via a crossdomain.xml file. For example, if your map uses a custom tile layer containing tiles loaded from URLs with the form http://www.thirdpartymap.com/path/tile_x_y_z.png, place a crossdomain.xml file at http://www.thirdpartymap.com/path/crossdomain.xml. Load this file using Security.loadPolicyFile() and when loading the tile images ensure that you use a LoaderContext instance whose checkPolicyFile property is true.

Note that by using path/ in the above URLs you can grant maps.googleapis.com privileged access only to content below http://www.thirdpartymap.com/path/, rather than to all content on www.thirdpartymap.com.

getProjection(): IProjection

Returns the projection being applied to the map.

getSize(): Point

Retrieves the map view size.

getZoom(): Number

Retrieves the map zoom level.

isLoaded(): Boolean

Checks whether the map has been initialized.

openInfoWindow(latlng:LatLng, options?:InfoWindowOptions): IInfoWindow

Opens a simple information window at the given point.

Parameter Type Description
latlng LatLng

Point at which the info window is opened.

options? InfoWindowOptions

Info window options.

panBy(distance:Point, animate?:Boolean): void

Starts a pan animation by the given distance in pixels.

Parameter Type Description
distance Point

Distance in pixels

animate? Boolean

Whether the change may be animated.

panTo(latLng:LatLng): void

Changes the center location of the map to the given location. If the location is already visible in the current map view, changes the center in a smooth animation.

Parameter Type Description
latLng LatLng

Coordinates for the new center.

removeControl(control:IControl): void

Removes 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): void

Removes a registered map type.

Parameter Type Description
oldMapType IMapType

Map type to unregister.

removeOverlay(overlay:IOverlay): void

Removes an overlay from the map.

Parameter Type Description
overlay IOverlay

Overlay to be removed from the map.

returnToSavedPosition(): void

Returns map to the saved position.

savePosition(): void

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

scrollWheelZoomEnabled(): Boolean

Checks whether scroll wheel zooming is enabled.

setCenter(latLng:LatLng, opt_zoom?:Number, opt_mapType?:IMapType): void

Changes the center location of the map.

Parameter Type Description
latLng LatLng

Coordinates for the new center.

opt_zoom? Number

New zoom level.

opt_mapType? IMapType

New map type.

setDoubleClickMode(val:Number): void

Set the mouse double click mode.

Parameter Type Description
val Number

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

setMapType(mapType:IMapType): void

Changes the map type for the map.

Parameter Type Description
mapType IMapType

Map type.

setSize(newSize:Point): void

Sets the size of the map view.

Parameter Type Description
newSize Point

New view size for the map.

setZoom(level:Number, opt_doContinuousZoom?:Boolean): void

Changes 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(): void

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

zoomIn(opt_latlng?:LatLng, opt_doCenter?:Boolean, opt_doContinuousZoom?:Boolean): void

Zooms 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): void

Zooms 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).

Back to top

interface IMap3D

IMap3D is the interface implemented by Map3D. Create an instance of class Map3D to create a map that supports 3-D views.

Implementing Classes

Fields Summary

Methods Summary

Properties

Name Type Description
camera ICamera

The camera that may be used to return information about the viewing geometry and perform transformations between lat-lng, world and viewport coordinates.

dragMode int

The drag mode that is being used on the map. Acceptable values for this property are MapAction.DRAGMODE_LATLNG, MapAction.DRAGMODE_PITCH and MapAction.DRAGMODE_YAW.

By default, the drag mode is updated automatically immediately before dispatching MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP events based on the state of the CTRL and SHIFT keyboard modifier keys. If SHIFT is pressed, the drag mode is set to MapAction.DRAGMODE_MAP_YAW_PITCH, else if CTRL is pressed the drag mode is set to MapAction.DRAGMODE_CAMERA_YAW_PITCH; if neither is pressed the drag mode is set to MapAction.DRAGMODE_LATLNG.

It is recommended that you keep this behavior. It is consistent with that in Google Earth. However, if you need to change it, you should attach listeners both to MapMouseEvent.DRAG_START and MapMouseEvent.DRAG_STEP. Within your handler you then can set an appropriate map dragging mode based on parameters including mouse location and keyboard modifier key state.

Note that since the drag mode can change immediately before, and while handling, MapMouseEvent.DRAG_STEP, a new drag mode can begin without the user having first released the mouse button. If the drag mode is changed in the middle of a drag operation, you will receive DRAG_STOP and DRAG_START events before the drag operation proceeds with the new drag mode.

viewMode int

The view mode that is being applied to map. Acceptable values for this property are View.VIEWMODE_2D, View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL.

Instance Methods

cancelFlyTo(): void

Aborts any map motion initiated by a call to flyTo() and causes MapEvent.FLY_TO_CANCELED and MapEvent.FLY_TO_DONE to be dispatched.

Calling this method has no effect if no flight is occurring.

flyTo(center:LatLng, zoom?:Number, attitude?:Attitude, duration?:Number): void

Changes the center location, zoom and attitude of the map over a given period. You can use a period of 0 if you wish the change to be instantaneous.

You can make repeated calls to flyTo() before animation has completed for a previous call if you wish to fly a complex route. Each flight segment will be queued and performed in sequence. If more than one flight segment is queued then cubic splines will be used to interpolate the camera location and attitude.

By default the user can interact with the map while a flight is occurring and doing so will not terminate the flight (it will continue through the remaining segments from the time the user releases control). However, a method cancelFlyTo() is available if you wish to abort the remaining portion of the flight.

MapEvent.FLY_TO_DONE is dispatched when the flight terminates (whether or not it was canceled).

Parameter Type Description
center LatLng

Coordinates for the new map center.

zoom? Number

New map zoom level.

attitude? Attitude

New map attitude.

duration? Number

Duration in seconds over which the change occurs.

getAttitude(): Attitude

Gets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.

setAttitude(value:Attitude): void

Sets the map attitude. In 3-D modes this controls the orientation of the map seen by the user.

Parameter Type Description
value Attitude

New map attitude.

Back to top

interface IMapType

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.

Implementing Classes

Methods Summary

Instance Methods

getAlt(): String

Returns 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): Number

Returns 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): Array

Returns 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(): String

Returns the text to be displayed if a tile fails to download.

getLinkColor(): Number

If 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(): Number

Returns the max resolution override.

getMaximumResolution(opt_point?:LatLng): Number

Returns 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): Number

Returns 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): String

Retrieves the map type name.

Parameter Type Description
opt_short? Boolean

Return the abbreviated name.

getProjection(): IProjection

Retrieves the map type projection.

getRadius(): Number

Returns the radius of the planet for which this map type is defined.

getSpanZoomLevel(center:LatLng, span:LatLng, viewSize:Point): Number

Returns 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(): Number

If controls are textual, returns the appropriate color to display the text. The copyright control uses this color, for example.

getTileLayers(): Array

Gets the list of tile layers for this map type in the z-order they should be displayed. Note that this cannot be used to change the displayed tile layers after construction of a MapType instance. You must create a new MapType if you wish to display a different set of layers.

getTileSize(): Number

Gets 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(): String

Returns a string that may be used as a URL parameter to identify this map type in permalinks to the current map view. This is currently only used internally. Note that if any built-in tile layers are used in constructing a custom map type, the returned value will be based on the set of layers rather than on any developer-supplied value.

setMaxResolutionOverride(maxResolution:Number): void

Sets 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.

Back to top

interface IMarker

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.

Markers dispatch a number of events as they are moved or the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.DRAG_START
  • MapMouseEvent.DRAG_STEP
  • MapMouseEvent.DRAG_END
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
  • MapMouseEvent.OVERLAY_MOVED
  • MapEvent.OVERLAY_ANIMATE_END
Note that the latLng property on any MapMouseEvent that is dispatched holds the marker's current lat-lng, not the lat-lng of the location immediately underneath the mouse pointer. In this, marker behaves differently from other overlays.

Implementing Classes

Methods Summary

Instance Methods

closeInfoWindow(): void

Closes the info window if it is associated with this marker.

getLatLng(): LatLng

Retrieves the location of the marker.

getOptions(): MarkerOptions

Retrieves the full set of options used by the marker. Use the setOptions method to modify the options on the marker.

openInfoWindow(options?:InfoWindowOptions, useSeparatePane?:Boolean): IInfoWindow

Opens an information window above the marker.

Parameter Type Description
options? InfoWindowOptions

InfoWindow options.

useSeparatePane? Boolean

If true, the information window will be placed on its own pane. When using Map3D, the default behavior is to place the information window on the same pane as this marker, so that it may be positioned at the same depth. Set this parameter true to force the behavior to be the same as when using a 2-D map (information windows are placed on their own pane).

setLatLng(value:LatLng): void

Changes 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.

Back to top

interface IMaxZoom

Implementing Classes

Methods Summary

Instance Methods

load(latLng:LatLng, opt_targetZoom?:Number): void

Sends a request to Google servers to find the maximum zoom level for imagery exists for a given map type at the given lat-lng. A MaxZoomEvent.MAXZOOM_SUCCESS will be dispatched, if successful, containing the given lat-lng and the maximum zoom level at that point. Otherwise MaxZoomEvent.MAXZOOM_FAILURE will be dispatched to indicate that a failure has occurred. If opt_targetZoom is set, only zoom levels up to opt_targetZoom will be considered. Note: this feature is only implemented for satellite imagery, for MapType.SATELLITE_MAP_TYPE and MapType.HYBRID_MAP_TYPE.

Parameter Type Description
latLng LatLng

The lat-lng to use for finding the maximum zoom level.

opt_targetZoom? Number

The highest zoom level that may be returned.

Back to top

interface IOverlay

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().

Implementing Classes

Fields Summary

Methods Summary

Properties

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.

Instance Methods

getDefaultPane(map:IMap): IPane

Retrieves 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): void

Reposition 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.

Back to top

interface IPane

IPane is the interface is implemented by the map panes. Pane is a container for overlays (such as markers, polylines, polygons etc).

Fields Summary

Methods Summary

Properties

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.

Instance Methods

addOverlay(overlay:IOverlay): void

Adds an overlay to the pane.

Parameter Type Description
overlay IOverlay

Overlay to add to this pane.

bringToTop(overlay:IOverlay): void

Brings an overlay to the top of all other overlays on the pane.

Parameter Type Description
overlay IOverlay

Overlay to position at the top.

clear(): void

Removes all overlays added to this pane.

fromLatLngToPaneCoords(latLng:LatLng, closestToCenter?:Boolean): Point

Translates 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 center of the map when multiple map copies are shown; if false, just map the latlng directly.

fromPaneCoordsToLatLng(point:Point, opt_nowrap?:Boolean): LatLng

Translates 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 is set to false (the default), the longtitude will be wrapped to bring it within the range [-180, +180].

fromPaneCoordsToProjectionPoint(point:Point): Point

Converts 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): Point

Converts 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(): Rectangle

Retrieves the bounds of the viewport in the pane's coordinate system.

invalidate(): void

Invalidates all the geometry on the pane causing a delayed update.

removeOverlay(overlay:IOverlay): void

Removes an overlay from the pane.

Parameter Type Description
overlay IOverlay

Overlay to remove from this pane.

updatePosition(force?:Boolean): void

Updates 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.

Back to top

interface IPaneManager

Interface to the pane manager of the map. The pane manager is responsible for creating, removing and re-ordering overlay panes on the map.

Objects that implement this class may manage both system default panes and user-created panes.

The API provides 4 default panes, which are fixed in the following order from bottom to top:

  • PaneId.PANE_MAP
  • PaneId.PANE_OVERLAYS
  • PaneId.PANE_MARKER
  • PaneId.PANE_FLOAT

You may not re-order or remove these default panes. You may, however, add, re-order, or remove user-created panes.

Pane order is specified using a zero-based index parameter, where 0 indicates the bottom-most pane (immediately above the map). Inserting a user-created pane at an index causes the existing indices at or above that value to shift one value up. For example, inserting a new pane at index 2 causes indices at 2, 3, and 4 to take on values of 3, 4, and 5. Inserting a pane at an index of paneCount causes the new pane to be placed on top of all existing panes.

Specifying an index value greater than the maximum valid value will force the index value to the maximum valid value.

Fields Summary

Methods Summary

Properties

Name Type Description
map IMap

Reference to the map.

paneCount int

Total number of panes available. This includes the default panes, which cannot be removed, and any user-created panes.

Instance Methods

clearOverlays(): void

Removes all overlays registered on all panes.

containsPane(pane:IPane): Boolean

Checks whether the pane manager contains the specified pane.

Parameter Type Description
pane IPane

createPane(index?:int): IPane

Creates a new pane and adds it at the specified index, which should lie in the range of 0 .. paneCount.

// Create a new pane lying immediately below the marker pane.
var manager:IPaneManager = map.getPaneManager();
var markerPane:IPane = manager.getPaneById(PaneId.PANE_MARKER);
var markerIndex:int = manager.getPaneIndex(markerPane);
var pane:IPane = manager.createPane(markerIndex);
Parameter Type Description
index? int

Index of the new pane in the pane stack (if not specified, or if negative, the pane is added just below the infowindow pane). The value 0 will place the new pane under all the existing panes. A value of paneCount will place the new pane above all the existing panes. A value larger than paneCount will be clamped: the result will be identical to that had a value of paneCount had been used.

getPaneAt(index:int): IPane

Returns the pane at the given index, or null if the index is out-of-range.

Parameter Type Description
index int

Depth index of the pane.

getPaneById(paneId:int): IPane

Returns the pane with the given id. This method is needed to obtain references to the default panes.

Parameter Type Description
paneId int

Pane id.

getPaneIndex(pane:IPane): int

Returns the depth index of the given pane.

Parameter Type Description
pane IPane

Pane whose index will be returned.

placePaneAt(pane:IPane, index:int): void

Positions a pane at the specified depth. Changing the pane's index allows rearranging the depths of panes in relation to each other. The relative order of the default panes may not be changed.

// Place myPane immediately above the overlays pane.
var manager:IPaneManager = map.getPaneManager();
var overlaysPane:IPane = manager.getPaneById(PaneId.PANE_OVERLAYS);
manager.placePaneAt(myPane, overlaysPane + 1);
Parameter Type Description
pane IPane

Pane whose placement will be changed.

index int

Depth index of the pane.

removeAllPanes(): void

Removes all the user-created panes.

removePane(pane:IPane): void

Removes a pane. This method has no effect if passed a default pane.

Parameter Type Description
pane IPane

Pane to remove.

Back to top

interface IPolygon

IPolygon is the interface implemented by Polygon and equivalent user-created classes. Polygon is a map overlay that represents polygon objects.

Polygons can be simple, made up of multiple disjoint regions, contain holes or be self-intersecting.

Originally a distinction was made between the 'outer' and 'inner' boundaries of a polygon: a polygon could be formed from one outer boundary and zero of more inner boundaries. This distinction is now immaterial: polygons simply comprise one or more boundaries.

Some method names still reflect the original distinction. If a polygon is made up of n boundaries, methods containing the word 'Outer' return information on boundary 0; methods containing the word 'Inner' return information on boundaries 1...n-1, but using indices offset by 1. Methods lacking both these words return information on boundaries 0...n-1.

For example, given a polygon made up of 5 boundaries, the following pairs of expressions provide the same result:

getOuterVertexCount() getVertexCount(0)
getInnerVertexCount(2) getVertexCount(3)
getInnerPolylineCount() getPolylineCount() - 1
getVertex(4, 8) getInnerVertex(3, 8)

Polygons dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implementing Classes

Methods Summary

Instance Methods

getInnerPolylineCount(): int

Returns the number of polylines that make up the inner boundaries of this polygon.

getInnerVertex(line:int, index:int): LatLng

Returns the LatLng of the vertex with the specified index from the specified inner polyline boundary.

Parameter Type Description
line int

Index of the inner polyline.

index int

Index of the target vertex within the specified polyline.

getInnerVertexCount(line:int): int

Returns the number of vertices in a specified inner line.

Parameter Type Description
line int

Index of the inner line.

getLatLngBounds(): LatLngBounds

Returns the LatLngBounds of this polygon, or null if the polygon contains no points.

getOptions(): PolygonOptions

Retrieves the polygon's options. Use the setOptions() method to modify options on the polygon.

getOuterVertex(index:int): LatLng

Returns the vertex from the outer boundary with the specified index.

Parameter Type Description
index int

Index of the target vertex.

getOuterVertexCount(): int

Returns the number of vertices in the outer line.

getPolylineCount(): int

Returns the number of polylines that make up the boundaries of this polygon.

getVertex(line:int, index:int): LatLng

Returns the LatLng of the vertex with the specified index from the specified polyline boundary.

Parameter Type Description
line int

Index of the polyline.

index int

Index of the target vertex within the specified polyline.

getVertexCount(line:int): int

Returns the number of vertices in a specified line.

Parameter Type Description
line int

Index of the line.

removePolyline(line:int): void

Removes one of the polylines that makes up the polygon.

Parameter Type Description
line int

Index of polyline to remove. An exception is thrown if a value is used that does not correspond to an existing polyline. Acceptable values lie in the range [0, getPolylineCount()-1].

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.

setPolyline(line:int, vertices:Array): void

Adds or replaces one of the polylines that makes up the polygon.

Parameter Type Description
line int

Index of polyline to add. Acceptable values lie in the range [0, getPolylineCount()]. If a value is used that corresponds to an existing polyline, then the existing polyline is replaced. If the value getPolylineCount() is used, then a new polyline is added without replacing any existing polyline. If an unacceptable value is used then an exception is thrown.

vertices Array

Array of LatLng elements.

setPolylineFromEncoded(line:int, encoded:EncodedPolylineData): void

Adds or replaces one of the polylines that makes up the polygon using encoded polyline data.

Parameter Type Description
line int

Index of polyline to add. Acceptable values lie in the range [0, getPolylineCount()]. If a value is used that corresponds to an existing polyline, then the existing polyline is replaced. If the value getPolylineCount() is used, then a new polyline is added without replacing any existing polyline. If an unacceptable value is used then an exception is thrown.

encoded EncodedPolylineData

Encoded polyline data.

Back to top

interface IPolyline

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.

Polylines dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implementing Classes

Methods Summary

Instance Methods

getLatLngBounds(): LatLngBounds

Returns the LatLngBounds of this polyline or a subsequence of this polyline. Returns null if this polyline contains no points.

getLength(opt_radius?:Number): Number

Returns 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(): PolylineOptions

Retrieves the polyline's options. Use the setOptions() method to modify polyline's options.

getVertex(index:Number): LatLng

Returns the vertex with the specified index.

Parameter Type Description
index Number

Index of the target vertex.

getVertexCount(): Number

Returns 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.

Back to top

interface IProjection

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.

Implementing Classes

Methods Summary

Instance Methods

fromLatLngToPixel(latLng:LatLng, zoom:Number): Point

Returns 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): LatLng

Returns 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): Number

Returns 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): Boolean

Returns 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.

Back to top

interface IScaleControl

IScaleControl is the interface implemented by ScaleControl. A ScaleControl provides a control that shows the scale of the map.

Back to top

interface IStyledMapType

IStyledMapType is the interface implemented by styled map type objects. A styled map type allows a custom style to be applied to Google's tile layers.

Implementing Classes

Methods Summary

Instance Methods

getStyle(): Array

Gets the map type style.

setStyle(style:Array): void

Sets the map type style.

// Setting the style using an array of MapTypeStyle instance.
styledMapType.setStyle([
    new MapTypeStyle(MapTypeStyleFeatureType.ALL,
                     MapTypeStyleElementType.ALL,
                     [MapTypeStyleRule.saturation(-20)]),
    new MapTypeStyle(MapTypeStyleFeatureType.ROAD,
                     MapTypeStyleElementType.GEOMETRY,
                     [MapTypeStyleRule.hue(0xff0000)])]);
    ]);
// Setting the style using an array of objects.
styledMapType.setStyle([
    {elementType: 'all',
     featureType: 'all',
     stylers: [{saturation: -20}]},
    {elementType: 'geometry',
     featureType: 'road',
     stylers: [{hue: 0xff0000}]}]);
Parameter Type Description
style Array

Array of MapTypeStyle instances. You can also pass in an Array of untyped objects containing the appropriate fields: it is often more concise to specify style as an object literal.

Back to top

interface ITileLayer

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.

Implementing Classes

Methods Summary

Instance Methods

getAlpha(): Number

Returns the opacity/alpha of the movie clip for the tile layer. The range of values for getAlpha() is 0.0 - 1.0.

getCopyrightCollection(): ICopyrightCollection

Retrieves the copyright collection responsible for handling copyright for this tile layer.

getMaxResolution(): Number

Returns the finest zoom level.

getMinResolution(): Number

Returns the coarsest zoom level.

loadTile(tilePos:Point, zoom:Number): DisplayObject

Creates and loads a tile (x, y) at the given zoom level.

Parameter Type Description
tilePos Point

Tile coordinates.

zoom Number

Tile zoom.

Back to top

interface ITileLayerOverlay

Implementing Classes

Fields Summary

Methods Summary

Properties

Name Type Description
projection IProjection

Projection used for calculating positions of tiles.

tileLayer ITileLayer

Tile layer used for the overlay.

tileSize int

Tile size.

Instance Methods

refresh(): void

Refreshes the tile layer overlay forcing a reload of all tiles.

If using this method, you should take care that tiles are not simply reloaded from the browser cache. One approach is to serve tiles with suitable HTTP headers to ensure that they are never cached. Another approach is to modify the URLs from which tiles are reloaded, for example by appending a dummy query parameter, to ensure that the browser sees the new loads as distinct from the original loads.

Back to top

interface IWrappable

IWrappable is the base interface for all objects that provide AS3 cross-domain scripting functionality.

Fields Summary

Properties

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.

Back to top

interface IWrappableEventDispatcher

IWrappableEventDispatcher is the base interface for all objects that provide cross-domain event dispatching functionality.

Methods Summary

Instance Methods

getBaseEventDispatcher(): Object

Retrieves the base event dispatcher object that allows access to event dispatching capability for cross-domain objects.

Back to top

class EncodedPolylineData

Class EncodedPolylineData represents the set of data required for creating an encoded polyline.

Fields Summary

Constructors Summary

Properties

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.

Constructors

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.

Back to top

class GroundOverlay

GroundOverlays are images laid out over the map content whose corners are located with latitude/longitude pairs.

Ground overlays dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

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.

Instance Methods

getDefaultPane(map:IMap): IPane

Retrieves 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(): GroundOverlayOptions

Retrieves the full set of options used by the ground overlay. Use the setOptions method to modify the options on the ground overlay.

hide(): void

isHidden(): Boolean

positionOverlay(zoomChanged:Boolean): void

Reposition 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.

show(): void

Back to top

class GroundOverlayOptions

GroundOverlayOptions class specifies a set of rendering parameters for a GroundOverlay.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
applyProjection Object

A Boolean value that specifies whether the overlay requires projection. If true, the map projection is applied when rendering the overlay. If false, it is assumed that the overlay has already been projected. The default is false.

renderContent Object

A Boolean value that specifies whether we render an image of the ground overlay content or simply attach it to the display list and set appropriate geometry transforms.

Since version 1.11, the default behavior is to render an image of the overlay content. This is a much more powerful approach that simply setting geometry transforms on an element in the display list. It supports many more combinations of 2-D / 3-D display, use of applyProjection and rotation and produces smoothed images of the overlay content.

If you are rendering content from another domain, and you are unable to use a crossdomain.xml file to authorize access, you will need to set this option to false.

You may set this false if you wish to keep using the old implementation. However if you do this:

  • 3-D is not supported.
  • applyProjection is ignored.
  • Smoothing is not applied.
rotation Object

A Number value that specifies the ground overlay rotation (specified in degrees in the clockwise direction). Please note that 3-D viewing modes (maps built against Map3D and using View.VIEWMODE_PERSPECTIVE and View.VIEWMODE_ORTHOGONAL) do not support rotation.

How rotation behaves depends on whether applyProjection is true or false.

If false, the ground overlay content is regarded as having already been projected. Rotation is simply applied in viewport space.

If true, the ground overlay content is mapped onto the surface of a sphere. Rotation is applied around the axis joining the center of the sphere to the point on the surface corresponding to rotationContentCenter. The map projection is then applied to yield the image of the ground overlay on the flat map. Note that straight lines in the original content become curved lines under this sequence of transformations.

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.

Constructors

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,
  applyProjection: true,
  renderContent: true
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Static Methods

getDefaultOptions(): GroundOverlayOptions

Retrieves 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,
  applyProjection: false,
  renderContent: true
}

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.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class Marker

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.

A marker is associated with a lat-lng, which determines the geographical location where its icon is anchored on the map.

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.

Markers dispatch a number of events as they are moved or the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.DRAG_START
  • MapMouseEvent.DRAG_STEP
  • MapMouseEvent.DRAG_END
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
  • MapMouseEvent.OVERLAY_MOVED
  • MapEvent.OVERLAY_ANIMATE_END
Note that the latLng property on any MapMouseEvent that is dispatched holds the marker's current lat-lng, not the lat-lng of the location immediately underneath the mouse pointer. In this, a marker behaves differently from other overlays.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

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.

Instance Methods

closeInfoWindow(): void

Closes the info window if it is associated with this marker.

getDefaultPane(map:IMap): IPane

Retrieves 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.

getLatLng(): LatLng

Retrieves the location of the marker.

getOptions(): MarkerOptions

Retrieves the full set of options used by the marker. Use the setOptions method to modify the options on the marker.

hide(): void

isHidden(): Boolean

openInfoWindow(options?:InfoWindowOptions, useSeparatePane?:Boolean): IInfoWindow

Opens an information window above the marker.

Parameter Type Description
options? InfoWindowOptions

InfoWindow options.

useSeparatePane? Boolean

If true, the information window will be placed on its own pane. When using Map3D, the default behavior is to place the information window on the same pane as this marker, so that it may be positioned at the same depth. Set this parameter true to force the behavior to be the same as when using a 2-D map (information windows are placed on their own pane).

positionOverlay(zoomChanged:Boolean): void

Reposition 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.

setLatLng(value:LatLng): void

Changes 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.

show(): void

Back to top

class MarkerOptions

MarkerOptions class specifies a set of rendering parameters for the Marker.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
ALIGN_BOTTOM 0x20

Align object to the bottom

ALIGN_HORIZONTAL_CENTER 1

Align object to the center (horizontally)

ALIGN_LEFT 0

Align object to the left

ALIGN_RIGHT 2

Align object to the right

ALIGN_TOP 0x00

Align object to the top

ALIGN_VERTICAL_CENTER 0x10

Align object to the center (vertically)

Properties

Name Type Description
clickable Object

A Boolean value that specifies whether the marker is clickable. Markers that are not clickable generate no MapMouseEvent.CLICK or MapMouseEvent.DOUBLE_CLICK events, but may, if draggable, still cause other events. Markers that are not clickable don't cause the hand cursor icon to appear when the cursor hovers over them. This property must explicitly be set to false to make a marker unclickable.

distanceScaling Object

A Boolean value that specifies whether we scale the marker with distance on a 3-D map. Ignored if we are not showing a 3-D map.

draggable Object

A Boolean value that specifies whether the marker can be dragged around the map.

fillStyle FillStyle

Marker fill style.

gravity Object

A Number value that specifies marker gravity factor.

hasShadow Object

A Boolean value that specifies whether the marker has a shadow. In case of markers with custom icons, cross-scripting access to the icon content has to be available in order to generate the shadow (if the domain from which the marker is loaded is different from the source domain of the map application).

icon DisplayObject

Display object used as marker's custom icon. Note that the display object instance specified as the icon can only be used for a single marker (as it will be added to the marker through a call to addChild() and cannot be reused). Adding the same image or movie clip to multiple different markers simultaneously will require creating a separate instance of that image (or movie clip) for each marker.

iconAlignment Object

A Number value that specifies which point on the marker is used for aligning it relative to the LatLng that it represents. Use combinations of MarkerOptions.ALIGN flags to specify the alignment.

iconOffset Point

Marker custom icon offset. When a custom icon is used, this parameter specifies the offset of the marker's target location in relation to the custom icon's alignment point.

iconShadow DisplayObject

Display object used to create the shadow for a custom marker icon.

Please note that in most circumstances shadow generation is automatic and you don't need to set this property. The exception is when a custom icon is loaded from a domain different from that of your map swf or Google's library (maps.googleapis.com) and no crossdomain.xml file authorizes access to the icon pixels from either of these domains.

If you set this property, normal shadow generation is disabled and a shadow filter is instead attached to the display object you pass in.

You cannot use the same object both for icon and iconShadow. If loading external content, load two copies, one for each property.

label String

Marker label text. Setting the label text removes any custom icon and applies standard rendering to draw the marker.

labelFormat TextFormat

Marker label text format.

radius Object

A Number value that specifies the marker radius.

strokeStyle StrokeStyle

Marker stroke style.

tooltip String

Marker tooltip text.

Constructors

MarkerOptions(param?:Object)

Constructs a new MarkerOptions object, optionally initializing it from an object.

var options:MarkerOptions = new MarkerOptions({
  strokeStyle: {
    color: 0x987654
  },
  fillStyle: {
    color: 0x223344,
    alpha: 0.8
  },
  label: "Z",
  labelFormat: {
    bold: true
  },
  tooltip: "This is a marker",
  radius: 12,
  hasShadow: true,
  clickable: false,
  draggable: true,
  gravity: 0.5,
  distanceScaling: false
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Static Methods

getDefaultOptions(): MarkerOptions

Retrieves the MarkerOptions instance that represents the default set of options that applies to all markers.

// Initialization object corresponding to the initial defaults.
{ strokeStyle: {
    thickness: 2,
    alpha: 1.0,
    color:Color.BLACK,
    pixelHinting: false
  },
  fillStyle: {
    color: 0xFF766A,
    alpha: 1.0
  },
  labelFormat: {
    font: "_sans",
    size: 12,
    color: Color.BLACK
  },
  gravity: 0.8,
  radius: 9,
  hasShadow: true,
  draggable: false,
  distanceScaling: false
}

setDefaultOptions(defaults:MarkerOptions): void

Sets the default set of options that applies when new markers are created. These defaults will apply to all markers created after the call to the setDefaultOptions method. Individual markers 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 marker 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 MarkerOptions

The new set of defaults for marker options.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class OverlayBase

Base class for custom overlays. Developers may extend this class to create their own overlay implementations.

OverlayBase represents a visual object that should be used for rendering the overlay's foreground.

The default implementation of OverlayBase defines an overlay that does not have a shadow. If a shadow is needed, a developer will need to create a separate display object and override the get shadow property accessor to enable it.

In addition to rendering the overlay's foreground and shadow (if needed), any custom overlay should define the positionOverlay() method that changes the placement of the overlay upon its pane when the map is panned or zoomed by the user. IPane.fromLatLngToPaneCoords() and IPane.fromProjectionPointToPaneCoords() can be used to determine the position of the overlay's on the pane.

Ideally, a custom overlay should avoid extensive rendering operations in its implementation of the positionOverlay() method. This method will be called frequently by the map and re-rendering the overlay upon each call may negatively affect performance of the application when a large number of overlays are placed on the map.

An implementation of custom overlay may also need to define listeners for MapEvent.OVERLAY_ADDED and MapEvent.OVERLAY_REMOVED events to handle addition and removal of the overlay to/from the map.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
foreground DisplayObject

Display object that represents the overlay's foreground content.

pane IPane

The pane this overlay resides on. The pane is set when the overlay is added to the map.

Developers may override the set pane method to handle addition/removal of the overlay to/from the map.

Alternatively, developers may add listeners for MapEvent.OVERLAY_ADDED and MapEvent.OVERLAY_REMOVED events on the overlay to handle addition and removal of the overlay to/from the map.

shadow DisplayObject

Display object that represents the overlay's shadow. By default returns null (no shadow).

If the overlay needs to have a shadow, this method property should be redefined and the value of shadow set before the overlay is added to the map.

The display object returned by this property should remain unchanged while the overlay is added to a map.

visible Boolean

Visibility of the overlay.

Constructors

OverlayBase()

Constructor.

Instance Methods

getDefaultPane(map:IMap): IPane

Determines the pane that the overlay is placed on when it is added to the map through the Map.addOverlay() call.

This method must be overloaded for the Map.addOverlay() call to function correctly. It is not required if the overlay is always added directly to its pane using a IPane.addOverlay() call.

Parameter Type Description
map IMap

Instance of map that this overlay is added to.

positionOverlay(zoomChanged:Boolean): void

Reposition the overlay on the screen.

This method is called in response to changes in the position (center) 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 center or redraw the overlay completely if it needs to be reconfigured for a different map center/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()).

This method is not implemented in the default implementation and must be overloaded in the derived classes to function properly.

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.

Back to top

class Polygon

Class Polygon defines a polygon displayed over the map.

Polygons can be simple, made up of multiple disjoint regions, contain holes or be self-intersecting.

Originally a distinction was made between the 'outer' and 'inner' boundaries of a polygon: a polygon could be formed from one outer boundary and zero of more inner boundaries. This distinction is now immaterial: polygons simply comprise one or more boundaries.

Some method names still reflect the original distinction. If a polygon is made up of n boundaries, methods containing the word 'Outer' return information on boundary 0; methods containing the word 'Inner' return information on boundaries 1...n-1, but using indices offset by 1. Methods lacking both these words return information on boundaries 0...n-1.

For example, given a polygon made up of 5 boundaries, the following pairs of expressions provide the same result:

getOuterVertexCount() getVertexCount(0)
getInnerVertexCount(2) getVertexCount(3)
getInnerPolylineCount() getPolylineCount() - 1
getVertex(4, 8) getInnerVertex(3, 8)

Polygons dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

Polygon(points:Array, options?:PolygonOptions)

Constructs a new polygon joining the specified lat-lngs, using the specified options.

To create a polygon from encoded data, either use the static method fromEncoded(), or create an empty polygon then call its setPolylineFromEncoded() method.

To create a polygon that is made up of multiple boundaries, you can use combinations of the methods fromEncoded(), setPolyline() and setPolylineFromEncoded().

Parameter Type Description
points Array

Array of LatLng vertex locations, or null if constructing an empty polygon

options? PolygonOptions

Full or partial set of polygon options. When a partial set of options is specified, the polygon's complete set of options will be a combination of partial options and the defaults.

Static Methods

fromEncoded(polylineList:Array, options?:PolygonOptions): Polygon

Constructs a polygon from encoded data.

Note that whilst you can sub-class Polygon, you cannot use the fromEncoded() method to create an instance of your sub-class. If you need such flexibility you should create an instance of your sub-class yourself, then call setPolylineFromEncoded() to set its boundary or boundaries.

Parameter Type Description
polylineList Array

An array of EncodedPolylineData objects for polylines.

options? PolygonOptions

Full or partial set of polygon options. When a partial set of options is specified, the polygon's complete set of options will be a combination of partial options and the existing defaults set using PolygonOptions.setDefaultOptions() call.

Instance Methods

getDefaultPane(map:IMap): IPane

Retrieves 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.

getInnerPolylineCount(): int

Returns the number of polylines that make up the inner boundaries of this polygon.

getInnerVertex(line:int, index:int): LatLng

Returns the LatLng of the vertex with the specified index from the specified inner polyline boundary.

Parameter Type Description
line int

Index of the inner polyline.

index int

Index of the target vertex within the specified polyline.

getInnerVertexCount(line:int): int

Returns the number of vertices in a specified inner line.

Parameter Type Description
line int

Index of the inner line.

getLatLngBounds(): LatLngBounds

Returns the LatLngBounds of this polygon, or null if the polygon contains no points.

getOptions(): PolygonOptions

Retrieves the polygon's options. Use the setOptions() method to modify options on the polygon.

getOuterVertex(index:int): LatLng

Returns the vertex from the outer boundary with the specified index.

Parameter Type Description
index int

Index of the target vertex.

getOuterVertexCount(): int

Returns the number of vertices in the outer line.

getPolylineCount(): int

Returns the number of polylines that make up the boundaries of this polygon.

getVertex(line:int, index:int): LatLng

Returns the LatLng of the vertex with the specified index from the specified polyline boundary.

Parameter Type Description
line int

Index of the polyline.

index int

Index of the target vertex within the specified polyline.

getVertexCount(line:int): int

Returns the number of vertices in a specified line.

Parameter Type Description
line int

Index of the line.

hide(): void

isHidden(): Boolean

positionOverlay(zoomChanged:Boolean): void

Reposition 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.

removePolyline(line:int): void

Removes one of the polylines that makes up the polygon.

Parameter Type Description
line int

Index of polyline to remove. An exception is thrown if a value is used that does not correspond to an existing polyline. Acceptable values lie in the range [0, getPolylineCount()-1].

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.

setPolyline(line:int, vertices:Array): void

Adds or replaces one of the polylines that makes up the polygon.

Parameter Type Description
line int

Index of polyline to add. Acceptable values lie in the range [0, getPolylineCount()]. If a value is used that corresponds to an existing polyline, then the existing polyline is replaced. If the value getPolylineCount() is used, then a new polyline is added without replacing any existing polyline. If an unacceptable value is used then an exception is thrown.

vertices Array

Array of LatLng elements.

setPolylineFromEncoded(line:int, encoded:EncodedPolylineData): void

Adds or replaces one of the polylines that makes up the polygon using encoded polyline data.

Parameter Type Description
line int

Index of polyline to add. Acceptable values lie in the range [0, getPolylineCount()]. If a value is used that corresponds to an existing polyline, then the existing polyline is replaced. If the value getPolylineCount() is used, then a new polyline is added without replacing any existing polyline. If an unacceptable value is used then an exception is thrown.

encoded EncodedPolylineData

Encoded polyline data.

show(): void

Back to top

class PolygonOptions

PolygonOptions class specifies a set of rendering parameters for polygons.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
fillStyle FillStyle

Polygon fill style.

strokeStyle StrokeStyle

Polygon stroke style.

tooltip String

Polygon tooltip text.

Constructors

PolygonOptions(param?:Object)

Constructs a new PolygonOptions object, optionally initializing it from an object.

var options:PolygonOptions = new PolygonOptions({
  strokeStyle: {
    thickness: 3,
    color: 0x123456,
    alpha: 0.5,
    pixelHinting: true
  },
  fillStyle: {
    color: 0xff0080,
    alpha: 0.8
  },
  tooltip: "Some info",
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Static Methods

getDefaultOptions(): PolygonOptions

Retrieves the PolygonOptions instance that represents the default set of options that applies to all polygons.

// Initialization object corresponding to the initial defaults.
{ fillStyle:
  { color: 0x0000FF,  // blue
    alpha: 0.25
  },
  strokeStyle:
  { color: 0x0055FF,  // blue
    alpha: 0.45,
    thickness: 2,
    pixelHinting: false
  }
}

setDefaultOptions(defaults:PolygonOptions): void

Sets the default set of options that applies when new polygons are created. Options may also be set for each individual polygon. If that is the case, options specified for an individual polygon will take precedence over the default options. The defaults parameter may specify a complete or partial set of polygon 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 PolygonOptions

New default full or partial set of polygon options.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class Polyline

Class Polyline defines a map overlay that draws a polyline on the map.

Polylines dispatch a number of events as the user interacts with them:

  • MapMouseEvent.MOUSE_DOWN
  • MapMouseEvent.MOUSE_UP
  • MapMouseEvent.MOUSE_MOVE
  • MapMouseEvent.ROLL_OVER
  • MapMouseEvent.ROLL_OUT
  • MapMouseEvent.CLICK
  • MapMouseEvent.DOUBLE_CLICK
The latLng property on any MapMouseEvent that is dispatched holds the lat-lng of the location immediately underneath the mouse pointer.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

Constructors

Polyline(points:Array, options?:PolylineOptions)

Constructs a new polyline at the specified lat-lng, using the specified options. To create a polyline from a set of encoded points, use the fromEncoded() method.

Parameter Type Description
points Array

Array of LatLng vertex locations.

options? PolylineOptions

Full or partial set of polyline options. When a partial set of options is specified, the polyline's complete set of options will be a combination of this partial set and the defaults.

Static Methods

fromEncoded(info:EncodedPolylineData, options?:PolylineOptions): Polyline

Constructs a polyline from the given set of encoded points and levels assuming the given number of levels and zoom factor between the levels. The encoded format represents the polyline points as a flattened array of latitude/longitude coordinates in E6 representation.

Parameter Type Description
info EncodedPolylineData

EncodedPolylineData object containing polyline data.

options? PolylineOptions

Full or partial set of polyline options. When a partial set of options is specified, the polyline's complete set of options will be a combination of partial options and the existing defaults set using PolylineOptions.setDefaultOptions() call.

Instance Methods

getDefaultPane(map:IMap): IPane

Retrieves 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.

getLatLngBounds(): LatLngBounds

Returns the LatLngBounds of this polyline or a subsequence of this polyline. Returns null if this polyline contains no points.

getLength(opt_radius?:Number): Number

Returns 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(): PolylineOptions

Retrieves the polyline's options. Use the setOptions() method to modify polyline's options.

getVertex(index:Number): LatLng

Returns the vertex with the specified index.

Parameter Type Description
index Number

Index of the target vertex.

getVertexCount(): Number

Returns the number of vertices in this polyline.

hide(): void

isHidden(): Boolean

positionOverlay(zoomChanged:Boolean): void

Reposition 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: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.

show(): void

Back to top

class PolylineOptions

PolylineOptions class specifies a set of rendering parameters for polylines.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
geodesic Object

A Boolean value that specifies whether this is a geodesic polyline.

strokeStyle StrokeStyle

Polyline stroke style.

Constructors

PolylineOptions(param?:Object)

Constructs a new PolylineOptions object, optionally initializing it from an object.

var options:PolylineOptions = new PolylineOptions({
  strokeStyle: {
    thickness: 3,
    color: 0x123456,
    alpha: 0.5,
    pixelHinting: true
  }
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Static Methods

getDefaultOptions(): PolylineOptions

Retrieves the PolylineOptions instance that represents the default set of options that applies to all polylines.

// Initialization object corresponding to the initial defaults.
{ strokeStyle:
  { color: 0x0000FF,  // blue
    alpha: 0.45,
    thickness: 5,
    pixelHinting: false
  }
}

setDefaultOptions(defaults:PolylineOptions): void

Sets the default set of options that applies when new polylines are created. Options may also be set for each individual polyline. If that is the case, options specified for an individual polyline will take precedence over the default options. The defaults parameter may specify a complete or partial set of polyline 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 PolylineOptions

New default full or partial set of polyline options.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class TileLayerOverlay

TileLayerOverlay is a type of overlay that adds a custom layer of tiles to the map on top of the MapType-specific tile layers.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

projection IProjection

Projection used for calculating positions of tiles.

shadow DisplayObject

Display object that represents the overlay's shadow (null if the overlay never has a shadow).

tileLayer ITileLayer

Tile layer used for the overlay.

tileSize int

Tile size.

visible Boolean

Visibility of the overlay.

Constructors

TileLayerOverlay(tileLayer:ITileLayer, tileSize?:int, projection?:IProjection)

TileLayerOverlay constructor.

Parameter Type Description
tileLayer ITileLayer

Tile layer used by the overlay.

tileSize? int

Tile size (256 by default).

projection? IProjection

Projection used by the overlay (If not set, Mercator projection by will be used by default).

Instance Methods

getDefaultPane(map:IMap): IPane

Retrieves 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): void

Reposition 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.

refresh(): void

Refreshes the tile layer overlay forcing a reload of all tiles.

If using this method, you should take care that tiles are not simply reloaded from the browser cache. One approach is to serve tiles with suitable HTTP headers to ensure that they are never cached. Another approach is to modify the URLs from which tiles are reloaded, for example by appending a dummy query parameter, to ensure that the browser sees the new loads as distinct from the original loads.

Back to top

class ClientGeocoder

A ClientGeocoder object 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.

Please note that ClientGeocoder cannot be used until after the MapEvent.MAP_READY event has been received from the map.

Implements

Constructors Summary

Methods Summary

Constructors

ClientGeocoder(options?:ClientGeocoderOptions)

Constructs a ClientGeocoder instance for performing geocoding.

// Deprecated and new-style code for creating a ClientGeocoder.
// Old-style code (prior to version 1.8).
var geocoder:ClientGeocoder = new ClientGeocoder("AU", myLatLngBounds);
   // New-style code
var geocoder:ClientGeocoder = new ClientGeocoder(
    new ClientGeocoderOptions({
      countryCode: "AU",
      viewport: myLatLngBounds
    }));
Parameter Type Description
options? ClientGeocoderOptions

Full or partial set of geocoding options. When a partial set of options is specified, the geocoder object's complete set of options will be a combination of this partial set and the defaults. In API versions prior to 1.8, the ClientGeocoder constructor took a different set of parameters. These parameters are now included within class ClientGeocoderOptions. See the example code for details of how to replace old code with new code. This change makes this class consistent with the majority of other classes in the API.

Instance Methods

geocode(address:String): void

Initiates a geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.

Parameter Type Description
address String

Address to geocode.

getBaseCountryCode(): String

Gets the current base country code from the ClientGeocoder.

getOptions(): ClientGeocoderOptions

Retrieves the geocoder object's options. Use the setOptions() method to modify geocoder options.

getViewport(): LatLngBounds

Gets the current viewport from the ClientGeocoder.

resetCache(): void

Resets the geocoding cache, clearing all results retrieved by this and other ClientGeocoder objects.

reverseGeocode(latLng:LatLng): void

Initiates a reverse geocoding request. Dispatches GeocodingEvent.GEOCODING_SUCCESS or GeocodingEvent.GEOCODING_FAILURE on completion.

Parameter Type Description
latLng LatLng

LatLng to reverse geocode.

setBaseCountryCode(country:String): void

Sets a base country code for the ClientGeocoder. The base country code may bias the search towards results in the specified country. For example, if there is a city named Foo in countries XX and YY, setting base country code to YY causes geocoder to favor "Foo, YY" over "Foo, X". etc., and so on. This is designed to work exactly as if the caller were using the geocoder for the specified country. Specifying a base country code of "ES" will cause the geocoder to behave exactly as the geocoder at maps.google.es.

Parameter Type Description
country String

The base country code to be set.

setOptions(options:ClientGeocoderOptions): void

Updates 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.

setViewport(argViewport:LatLngBounds): void

Sets a viewport for the ClientGeocoder. The geocoder will attempt only to return results which lie within or near the viewport.

Parameter Type Description
argViewport LatLngBounds

The new viewport for the geocoder.

Back to top

class ClientGeocoderOptions

ClientGeocoderOptions specifies properties for configuring ClientGeocoder instances.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
countryCode String

The countryCode for geocoding queries. This is specified as a standard two-letter country code, for example "US", "DE". When omitted, the browser's preferred language setting is used.

language String

The language for geocoding queries. This is specified as a standard two letter language code, for example "en", "fr". When omitted, the browser's preferred language setting is used.

viewport LatLngBounds

The viewport for geocoding queries. The geocoder will attempt only to return results which lie within or near the viewport.

Constructors

ClientGeocoderOptions(param?:Object)

Constructs a new ClientGeocoderOptions object, optionally initializing it from an object.

var options:ClientGeocoderOptions = new ClientGeocoderOptions({
  language: 'en',
  countryCode: 'CA'
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class Directions

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.

Implements

Fields Summary

Constructors Summary

Methods Summary

Properties

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.

encodedPolylineData EncodedPolylineData

The encoded polyline data for the directions request.

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.

Constructors

Directions(options?:DirectionsOptions)

Constructs a Directions instance for performing directions requests and retrieving directions results.

Parameter Type Description
options? DirectionsOptions

Full or partial set of directions options. When a partial set of options is specified, the direction object's complete set of options will be a combination of this partial set and the defaults.

Instance Methods

clear(): void

Clears any existing directions results and cancels any pending load() requests.

createPolyline(options?:PolylineOptions): IPolyline

Create 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): Placemark

Return 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 0 to numGeocodes - 1, inclusive.

getOptions(): DirectionsOptions

Retrieves the directions object's options. Use the setOptions() method to modify directions object's options.

getRoute(i:uint): Route

Return 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 0 to numRoutes - 1, inclusive.

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").

loadFromWaypoints(waypoints:Array): void

Issues a new directions query using an array of waypoints as input instead of a single query string. This array may contain a maximum of 25 waypoint entries. Each entry in the array is a string representation of an input address or lat,lng point.

Parameter Type Description
waypoints Array

An array of waypoints, where each one is either a LatLng or a string address or point.

setOptions(options:DirectionsOptions): void

Updates 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.

Back to top

class DirectionsEvent

A DirectionsEvent object is dispatched into the event flow whenever a directions request completes.

Fields Summary

Constructors Summary

Constants

Name Value Description
DIRECTIONS_ABORTED directionsaborted

Directions abort event ("directionsaborted"). This is dispatched when either a new load() request is made or clear() is called before the previous request finishes. The new request continues as normal.

DIRECTIONS_FAILURE directionsfailure

Directions failure event ("directionsfailure").

DIRECTIONS_SUCCESS directionssuccess

Directions succeeded event ("directionssuccess").

Properties

Name Type Description
directions IDirections

The IDirections object that created this event. Please note that in release versions <= 1.18b this property's return type was Directions, not IDirections. If you need to call methods in Directions that are NOT included in IDirections, you will have to cast the return type yourself.

name String

Directions request text.

request String

Request type ("directions", for directions requests).

status Number

Directions status.

Constructors

DirectionsEvent(type:String, directions:IDirections, bubbles?:Boolean, cancellable?:Boolean)

Creates a DirectionsEvent object to pass as a parameter to event listeners.

Parameter Type Description
type String

The type of the event, accessible as MapEvent.type.

directions IDirections

The Directions object that created this event.

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.

Back to top

class DirectionsOptions

DirectionsOptions specifies properties for configuring Directions instances.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
TRAVEL_MODE_DRIVING 0

Designates driving travel mode for the directions.

TRAVEL_MODE_WALKING 1

Designates walking travel mode for the directions.

Properties

Name Type Description
avoidHighways Object

A Boolean value that determines whether or not to attempt to exclude highways when forming the directions.

countryCode String

The countryCode for directions queries. This is specified as a standard two-letter country code, for example "US", "DE". When omitted, Map.countryCode will be used if set.

language String

The language for directions queries. This is specified as a standard two letter language code, for example "en", "fr". When omitted, Map.language will be used if set; otherwise the browser's preferred language setting is used.

travelMode Object

The travel mode for directions queries. This value affects the directions response, as directions will be modified to fit the requested travel mode. It should be one of {TRAVEL_MODE_DRIVING, TRAVEL_MODE_WALKING}.

Constructors

DirectionsOptions(param?:Object)

Constructs a new DirectionsOptions object, optionally initializing it from an object.

var options:DirectionsOptions = new DirectionsOptions({
  language: 'en',
  countryCode: 'US',
  travelMode: DirectionsOptions.TRAVEL_MODE_DRIVING
});
Parameter Type Description
param? Object

An initialization object containing a set of values that supplement the default set.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class Elevation

An Elevation object communicates with Google servers to obtain elevation information at one or more locations.

Implements

Constructors Summary

Methods Summary

Constructors

Elevation()

Creates an Elevation instance which can be used to query the elevation at one or more locations.

Instance Methods

loadElevationAlongEncodedPath(encodedPolylineData:EncodedPolylineData, numPoints:int): void

Sends a request to Google servers to find the maximum elevation at one or more regularly spaced locations along a path. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
encodedPolylineData EncodedPolylineData

Encoded locations at which the elevations should be found. In contrast to loadElevationForEncodedLocations() you can pass complex encoded polyline data as returned by directions queries directly to this method, as elevation data is found only at the specified number of interpolated locations, rather than at every location defined by the EncodedPolylineData instance. The implementation, however, may internally simplify this data structure before use.

numPoints int

Number of points at which elevation is calculated.

loadElevationAlongPath(locations:Array, numPoints:int): void

Sends a request to Google servers to find the maximum elevation at one or more regularly spaced locations along a path. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
locations Array

Array of LatLng elements defining the path. Interpolation is used to generate the locations at which elevation is calculated.

numPoints int

Number of points at which elevation is calculated.

loadElevationForEncodedLocations(encodedPolylineData:EncodedPolylineData): void

Sends a request to Google servers to find the maximum elevation at one or more lat-lngs. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
encodedPolylineData EncodedPolylineData

Encoded locations at which the elevations should be found. Be aware that the encoded polyline data returned by directions queries can contain many thousands of locations and attempting to obtain elevation data for all of these is likely to exceed your quota. This method is suitable only for use with simplified encoded polyline data.

loadElevationForLocations(locations:Array): void

Sends a request to Google servers to find the maximum elevation at one or more lat-lngs. ElevationEvent.ELEVATION_SUCCESS will be dispatched, if successful, containing the given lat-lng(s) and the elevations at those locations. Otherwise ElevationEvent.ELEVATION_FAILURE will be dispatched to indicate that a failure has occurred. Should this occur, the status property of the ElevationEvent contains a code indicating the nature of the failure.

Parameter Type Description
locations Array

Array of LatLng elements containing the locations at which the elevations should be found.

Back to top

class ElevationEvent

An ElevationEvent object is dispatched into the event flow whenever an elevation request completes.

Fields Summary

Constructors Summary

Constants

Name Value Description
ELEVATION_FAILURE elevationfailure

Elevation failure event.

ELEVATION_SUCCESS elevationsuccess

Elevation success event.

Properties

Name Type Description
elevations Array

Gets the ElevationResponse array associated with this event.

status int

Elevation status code. On success this will have the value ServiceStatus.GEO_SUCCESS. On failure it will have one of the values ServiceStatus.GEO_BAD_REQUEST, ServiceStatus.GEO_TOO_MANY_QUERIES, ServiceStatus.GEO_REQUEST_DENIED, ServiceStatus.GEO_UNKNOWN_ERROR.

Constructors

ElevationEvent(type:String, status:int, elevations:Array, bubbles?:Boolean, cancellable?:Boolean)

Creates an ElevationEvent object to pass as a parameter to event listeners.

Parameter Type Description
type String

The type of the event.

status int

Response status code.

elevations Array

Array of ElevationResponse elements containing locations and their elevations.

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.

Back to top

class ElevationResponse

ElevationResponse defines a location and its corresponding elevation. The elevation service returns an array of ElevationResponse instances in response to each elevation query.

Fields Summary

Constructors Summary

Properties

Name Type Description
elevation Number

Elevation in metres.

location LatLng

Location.

Constructors

ElevationResponse(location:LatLng, elevation:Number)

Constructor for ElevationResponse object.

Parameter Type Description
location LatLng

Location.

elevation Number

Elevation in metres.

Back to top

class GeocodingEvent

A GeocodingEvent object is dispatched into the event flow whenever a geocoding request completes.

Fields Summary

Constructors Summary

Constants

Name Value Description
GEOCODING_FAILURE geocodingfailure

Geocoding failure event ("geocodingfailure").

GEOCODING_SUCCESS geocodingsuccess

Geocoding succeeded event ("geocodingsuccess").

Properties

Name Type Description
name String

Geocoding request text.

request String

Request type ("geocode", for geocoding requests).

response GeocodingResponse

Object containing the result returned by the geocoder in case the request completes successfully or null in case of failure.

status Number

Geocode status.

Constructors

GeocodingEvent(type:String, bubbles?:Boolean, cancellable?:Boolean)

Creates a GeocodingEvent object to pass as a parameter to event listeners.

Parameter Type Description
type String

The type of the event, accessible as MapEvent.type.

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.

Back to top

class GeocodingResponse

A GeocodingResponse object represents the result of a geocoding operation returned by the server.

Fields Summary

Constructors Summary

Properties

Name Type Description
name String

Geocoding request text.

placemarks Array

List of placemarks returned by the geocoder.

Constructors

GeocodingResponse()

Constructor for GeocodingResponse object.

Back to top

class MaxZoom

A MaxZoom instance communicates with Google servers to obtain information on the maximum zoom level available for user-specified locations.

Please note that MaxZoom cannot be used until after the MapEvent.MAP_READY event has been received from the map.

Implements

Constructors Summary

Methods Summary

Constructors

MaxZoom(mapType:IMapType)

Creates a MaxZoom which can be used to query the maximum zoom level at any point on the map for a given map type.

Parameter Type Description
mapType IMapType

A map type to use when finding maximum zoom levels.

Instance Methods

load(latLng:LatLng, opt_targetZoom?:Number): void

Sends a request to Google servers to find the maximum zoom level for imagery exists for a given map type at the given lat-lng. A MaxZoomEvent.MAXZOOM_SUCCESS will be dispatched, if successful, containing the given lat-lng and the maximum zoom level at that point. Otherwise MaxZoomEvent.MAXZOOM_FAILURE will be dispatched to indicate that a failure has occurred. If opt_targetZoom is set, only zoom levels up to opt_targetZoom will be considered. Note: this feature is only implemented for satellite imagery, for MapType.SATELLITE_MAP_TYPE and MapType.HYBRID_MAP_TYPE.

Parameter Type Description
latLng LatLng

The lat-lng to use for finding the maximum zoom level.

opt_targetZoom? Number

The highest zoom level that may be returned.

Back to top

class MaxZoomEvent

A MaxZoomEvent object is dispatched into the event flow whenever a max zoom request completes.

Fields Summary

Constructors Summary

Constants

Name Value Description
MAXZOOM_FAILURE maxzoomfailure

Max zoom failure event.

MAXZOOM_SUCCESS maxzoomsuccess

Max zoom success event.

Properties

Name Type Description
latLng LatLng

Gets the lat-lng associated with this event.

zoom Number

Gets the zoom level associated with this event.

Constructors

MaxZoomEvent(type:String, latLng:LatLng, zoom:Number, bubbles?:Boolean, cancellable?:Boolean)

Creates a MaxZoomEvent object to pass as a parameter to event listeners.

Parameter Type Description
type String

The type of the event.

latLng LatLng

The lat-lng associated with the event.

zoom Number

The zoom level associated with the event.

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.

Back to top

class Placemark

Describes a single result returned by a geocoding request.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
address String

Full address for the placemark.

addressDetails Object

Address details object.

point LatLng

LatLng for the address.

Constructors

Placemark()

Constructor. Creates an empty placemark object.

Instance Methods

toString(): String

Returns a string representation of the placemark of the form "address"

Back to top

class Route

Objects of this class are created by the Directions object to store information about a single route in a directions result. This class does not have a public constructor. Clients should not directly create objects of this class.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
distance Number

The total distance of this route in meters.

distanceHtml String

The total distance of this route 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 route in seconds.

durationHtml String

The total time of this route in a localized string representation.

endGeocode Placemark

The geocode result for the ending point of this route.

endLatLng LatLng

The last point along the polyline for this route. Note that this point may be different from the lat,lng in Route.endGeocode because endLatLng always returns a point that is snapped to the road network. There is no corresponding startLatLng property because that is identical to Route.getStep(0).latLng.

numSteps uint

The number of steps in this route.

startGeocode Placemark

The geocode result for the starting point of this route.

summaryHtml String

An HTML snippet containing a summary of the distance and time for this route.

Constructors

Route()

Constructor. Creates an empty route object.

Instance Methods

getStep(i:uint): Step

The Step object for the ith step in this route.

Parameter Type Description
i uint

The index of the Step to get, starting from 0.

Back to top

class ServiceStatus

This class contains all the service status codes that can be returned in service responses. It should not ever be instantiated since it merely contains constants.

Fields Summary

Constants

Name Value Description
GEO_ABORTED_REQUEST 10101

Status code indicating that the request was aborted due to a newer request.

GEO_BAD_KEY 610

Status code indicating a missing or invalid API key.

GEO_BAD_REQUEST 400

Status code indicating that the request could not be processed properly by the servers.

GEO_BAD_STATUS_START 600

The lower numerical limit of bad status codes.

GEO_MISSING_ADDRESS 601

Status code indicating that the address parameter is missing.

GEO_MISSING_QUERY 601

Status code indicating that the query parameter is missing. This is a generalization of the GEO_MISSING_ADDRESS code introduced in the geocoder.

GEO_REQUEST_DENIED 650

Status code indicating that the request was denied.

GEO_SERVER_ERROR 500

Status code indicating problem with the geocode server. For example, this value may be returned if the geoserver is down.

GEO_SUCCESS 200

Status code indicating a successful geocoding query.

GEO_TOO_MANY_QUERIES 620

Status indicating that we received too many requests in the 24h period.

GEO_UNAVAILABLE_ADDRESS 603

Status indicating that for legal or other reasons we may not return a reply to this particular query.

GEO_UNKNOWN_ADDRESS 602

Status code indicating an unknown or incorrect address.

GEO_UNKNOWN_DIRECTIONS 604

Status code indicating that no directions could be computed.

GEO_UNKNOWN_ERROR 651

Status code indicating an unknown error.

Back to top

class Step

Objects of this class are created by the Directions object to store information about a single step within a route in a directions result. This class does not have a public constructor. Clients should not directly create objects of this class.

Fields Summary

Constructors Summary

Properties

Name Type Description
descriptionHtml String

An HTML string containing the description of this step.

distance Number

The total distance of this step in meters.

distanceHtml String

The total distance of this step 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 step in seconds.

durationHtml String

The total time of this step in a localized string representation.

latLng LatLng

The first point along the polyline for this step.

polylineIndex uint

The index of the first point along the polyline for this step.

Constructors

Step()

Constructor. Creates an empty step object.

Back to top

class BevelStyle

Class BevelStyle specifies a set of parameters for drawing a bevel.

Fields Summary

Constructors Summary

Methods Summary

Constants

Name Value Description
BEVEL_LOWERED 2

Lowered bevel.

BEVEL_NONE 0

No bevel.

BEVEL_RAISED 1

Raised bevel.

Properties

Name Type Description
bevelAlpha Object

A number that specifies the bevel's alpha.

bevelStyle Object

Bevel type (one of BevelStyle.NONE, BevelStyle.RAISED or BevelStyle.LOWERED).

bevelThickness Object

A number that specifies the bevel's thickness.

highlightColor Object

A number that specifies the bevel's highlight color.

shadowColor Object

A number that specifies the bevel's shadow color.

Constructors

BevelStyle(params?:Object)

Constructs a BevelStyle instance, optionally initializing it from an object.

var style:BevelStyle = new BevelStyle({
  bevelStyle: BevelStyle.BEVEL_RAISED,
  bevelThickness: 1,
  bevelAlpha: 0.5,
  highlightColor: 0xff0040,
  shadowColor: 0x000000,
  fillStyle: {
    color: 0xa0a0a0,
    alpha: 1
  },
  strokeStyle: {
    color: 0x000000,
    alpha: 2
  }
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new BevelStyle object.

Static Methods

mergeStyles(styles:Array): BevelStyle

Merges two or more BevelStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of BevelStyle objects to merge.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class ButtonFaceStyle

Class ButtonFaceStyle specifies a set of parameters for drawing a button face in a specific state (up/over/down).

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
labelFormat TextFormat

Button's label format.

Constructors

ButtonFaceStyle(params?:Object)

Constructs a ButtonFaceStyle instance, optionally initializing it from an object.

var style:ButtonFaceStyle = new ButtonFaceStyle({
  bevelStyle: BevelStyle.BEVEL_RAISED,
  bevelThickness: 1,
  bevelAlpha: 0.5,
  highlightColor: 0xff0040,
  shadowColor: 0x000000,
  fillStyle: {
    color: 0xa0a0a0,
    alpha: 1
  },
  strokeStyle: {
    color: 0x000000,
    alpha: 2
  },
  labelFormat: {
    font: "_sans",
    size: 12
  }
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new ButtonFaceStyle object.

Static Methods

mergeStyles(styles:Array): ButtonFaceStyle

Merges two or more ButtonFaceStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of ButtonFaceStyle objects to merge.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class ButtonStyle

Class ButtonStyle specifies a set of parameters for drawing buttons.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
downState ButtonFaceStyle

Style of the button in the "down" state.

overState ButtonFaceStyle

Style of the button in the "over" state.

upState ButtonFaceStyle

Style of the button in the "up" state.

Constructors

ButtonStyle(params?:Object)

Constructs a ButtonStyle instance, optionally initializing it from an object.

var style:ButtonStyle = new ButtonStyle({
  allStates: {
    fillStyle: {
      color: 0xA0A0A0,
      alpha: 1.0
    },
    strokeStyle: {
      color: 0x000000,
      thickness: 2
    },
    labelFormat: {
      size: 12,
      font: "_sans"
    },
    bevelThickness: 1.5,
    bevelAlpha: 0.5,
    highlightColor: 0xffffff,
    shadowColor: 0x000000
  },
  upState: {
    bevelStyle: BevelStyle.BEVEL_RAISED
  },
  overState: {
    bevelStyle: BevelStyle.BEVEL_RAISED
  },
  downState: {
    bevelStyle: BevelStyle.BEVEL_LOWERED,
    labelFormat: {
      bold: true
    }
  }
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new ButtonStyle object.

Static Methods

mergeStyles(styles:Array): ButtonStyle

Merges two or more ButtonStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of ButtonStyle objects to merge.

Instance Methods

setAllStates(shared:ButtonFaceStyle): void

Specified a set of bevel style properties for all button states. This method supplements each of the state styles with the values from the ButtonFaceStyle passed as the parameter.

Parameter Type Description
shared ButtonFaceStyle

Set of ButtonFaceStyle properties to share among all states of the button.

toString(): String

toString method.

Back to top

class FillStyle

Class FillStyle specifies a set of parameters for drawing backgrounds of graphical objects.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
alpha Object

A Number value that specifies the fill alpha. Setting the fill alpha clears the gradient style.

color Object

A Number value that specifies the fill color. Setting the fill color clears the gradient style.

gradient GradientStyle

Gradient fill style. If set, gradient style takes precedence over color and alpha.

Constructors

FillStyle(params?:Object)

Constructs a new FillStyle instance, optionally initializing it from an object.

var gradientStyle:GradientStyle = new GradientStyle({
  type: GradientType.LINEAR,
  colors: [0xFFFF00, 0x800000],
  alphas: [1, 1],
  ratios: [0, 255]
});
gradientStyle.matrix = new Matrix();
gradientStyle.matrix.createGradientBox(14, 14, 0, 0, 0);
var styleA:FillStyle = new FillStyle({
  gradient: gradientStyle
});
var styleB:FillStyle = new FillStyle({
  color: 0xff0040,
  alpha: 0.5
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new FillStyle object.

Static Methods

mergeStyles(styles:Array): FillStyle

Merges two or more FillStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of FillStyle objects to merge.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class GradientStyle

Class GradientStyle specifies a set of parameters for drawing gradient backgrounds of graphical objects.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
alphas Array

An array of type Number, each of which is an alpha value matched with a corresponding element in the colors Array.

colors Array

An array of type Number, each of which is an RGB color value to be used in the gradient style (up to 15 elements).

focalPointRatio Number

Gradient focal point ratio.

interpolationMethod String

Gradient interpolation method.

matrix Matrix

Gradient transformation matrix.

ratios Array

Color distribution ratios corresponding to the elements in the colors Array.

spreadMethod String

Gradient spread method.

type String

A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL.

Constructors

GradientStyle(params?:Object)

Constructs a new GradientStyle instance, optionally initializing it from an object.

var mat:Matrix = new Matrix();
mat.createGradientBox(10, 10, 0, 0, 0);
var style:GradientStyle = new GradientStyle({
  type: GradientType.LINEAR,
  colors: [0xff0000, 0x00ff00, 0x0000ff],
  alphas: [0.3, 0.7, 0.5],
  ratios: [0, 64, 255],
  matrix: mat,
  spreadMethod: SpreadMethod.PAD,
  interpolationMethod: InterpolationMethod.RGB,
  focalPointRatio: 0.3
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new GradientStyle object.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class MapTypeStyle

Class MapTypeStyle specifies the scope and rules for applying a custom style to a map.

Fields Summary

Constructors Summary

Properties

Name Type Description
elementType String

Selects the element type to which a styler should be applied. An element type distinguishes between the different representations of a feature. The class MapTypeStyleElementType defines possible values for this property. Optional; if elementType is not specified, the value is assumed to be 'all'.

featureType String

Selects the feature, or group of features, to which a styler should be applied. Optional; if featureType is not specified, the value is assumed to be 'all'. The class MapTypeStyleFeatureType defines possible values for this property.

stylers Array

The style rules to apply to the selectors. The rules are applied to the map's elements in the order they are listed in this array. Create the elements within this array using the methods in class MapTypeStyleRule.

Constructors

MapTypeStyle(featureType:String, elementType:String, stylers:Array)

Constructs a MapTypeStyle instance.

Parameter Type Description
featureType String

Feature type. Acceptable values are defined by the class <MapTypeStyleFeatureType/code>.

elementType String

Element type. Acceptable values are defined by the class <MapTypeStyleElementType/code>.

stylers Array

An array of styler objects. Create the elements within this array using the methods in class MapTypeStyleRule.

Back to top

class MapTypeStyleElementType

Class MapTypeStyleElementType specifies possible values for element types. These distinguish between the different representations of a feature.

Fields Summary

Constants

Name Value Description
ALL all

Apply the rule to all elements of the specified feature.

GEOMETRY geometry

Apply the rule to the feature's geometry.

LABELS labels

Apply the rule to the feature's labels.

Back to top

class MapTypeStyleFeatureType

Class MapTypeStyleFeatureType specifies possible values for feature types. Stylers applied to a parent feature type automatically apply to all child feature types. Note however that parent features may include some additional features that are not included in one of their child feature types.

Fields Summary

Constants

Name Value Description
ADMINISTRATIVE administrative

Apply the rule to administrative areas.

ADMINISTRATIVE_COUNTRY administrative.country

Apply the rule to countries.

ADMINISTRATIVE_LAND_PARCEL administrative.land_parcel

Apply the rule to land parcels.

ADMINISTRATIVE_LOCALITY administrative.locality

Apply the rule to localities.

ADMINISTRATIVE_NEIGHBORHOOD administrative.neighborhood

Apply the rule to neighborhoods.

ADMINISTRATIVE_PROVINCE administrative.province

Apply the rule to provinces.

ALL all

Apply the rule to all features.

LANDSCAPE landscape

Apply the rule to landscapes.

LANDSCAPE_MAN_MADE landscape.man_made

Apply the rule to man made structures.

LANDSCAPE_NATURAL landscape.natural

Apply the rule to natural features.

POI poi

Apply the rule to points of interest.

POI_ATTRACTION poi.attraction

Apply the rule to attractions for tourists.

POI_GOVERNMENT poi.government

Apply the rule to government buildings.

POI_MEDICAL poi.medical

Apply the rule to emergency services (hospitals, pharmacies, police, doctors, etc.).

POI_PARK poi.park

Apply the rule to parks.

POI_PLACE_OF_WORSHIP poi.place_of_worship

Apply the rule to places of worship, such as churches, temples, or mosques.

POI_SCHOOL poi.school

Apply the rule to schools.

POI_SPORTS_COMPLEX poi.sports_complex

Apply the rule to sports complexes.

ROAD road

Apply the rule to all roads.

ROAD_ARTERIAL road.arterial

Apply the rule to arterial roads.

ROAD_HIGHWAY road.highway

Apply the rule to highways.

ROAD_LOCAL road.local

Apply the rule to local roads.

TRANSIT transit

Apply the rule to all transit stations and lines.

TRANSIT_LINE transit.line

Apply the rule to transit lines.

TRANSIT_STATION transit.station

Apply the rule to all transit stations.

TRANSIT_STATION_AIRPORT transit.station.airport

Apply the rule to airports.

TRANSIT_STATION_BUS transit.station.bus

Apply the rule to bus stations.

TRANSIT_STATION_FERRY transit.station.ferry

Apply the rule to ferry ports.

TRANSIT_STATION_RAIL transit.station.rail

Apply the rule to rail stations.

WATER water

Apply the rule to bodies of water.

Back to top

class MapTypeStyleRule

A styler affects how a map's elements will be styled. Class MapTypeStyleRule provides helper functions to create styler objects for use with MapTypeStyle. Please note that if you choose to create styler objects without using MapTypeStyleRule's functions, you should ensure that each contains one and only one key. If more than one key is specified in a single MapTypeStyleRule, all but one will be ignored.

Methods Summary

Static Methods

gamma(value:Number): Object

Creates a styler object that modifies the gamma by raising the lightness to the given power.

Parameter Type Description
value Number

Gamma: numbers in the range [0.01, 10], with 1.0 representing no change.

hue(color:uint): Object

Creates a styler object that sets the hue of the feature to match the hue of the color supplied. Note that the saturation and lightness of the feature is conserved, which means that the feature will not match the color supplied exactly.

Parameter Type Description
color uint

Color. Only the lower 24 bits are used (i.e. any alpha value is ignored).

invert_lightness(invert:Boolean): Object

Creates a styler object that inverts lightness. This will invert the lightness while preserving the hue and saturation.

Parameter Type Description
invert Boolean

If true, then lightness is inverted.

lightness(value:Number): Object

Creates a styler object that shifts lightness of colors by a percentage of the original value if decreasing and a percentage of the remaining value if increasing.

Parameter Type Description
value Number

Lightness shift: a value in the range [-100, 100].

saturation(value:Number): Object

Creates a styler object that shifts the saturation of colors by a percentage of the original value if decreasing and a percentage of the remaining value if increasing.

Parameter Type Description
value Number

Saturation shift: a value in the range [-100, 100].

visibility(value:String): Object

Creates a styler object that sets the visibility.

Parameter Type Description
value String

Visibility state: 'on', 'off' or 'simplified'.

Back to top

class RectangleStyle

Class RectangleStyle combines a FillStyle and a StrokeStyle to use for rendering a basic rectangle.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
fillStyle FillStyle

Rectangle's fill style.

strokeStyle StrokeStyle

Rectangle's stroke style.

Constructors

RectangleStyle(params?:Object)

Constructs a RectangleStyle instance, optionally initializing it from an object.

var style:RectangleStyle = new RectangleStyle({
  fillStyle: {
    color: 0xa0a0a0,
    alpha: 1
  },
  strokeStyle: {
    color: 0x000000,
    alpha: 2
  }
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new RectangleStyle object.

Static Methods

mergeStyles(styles:Array): RectangleStyle

Merges two or more RectangleStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of RectangleStyle objects to merge.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

class StrokeStyle

StrokeStyle class specifies a set of parameters for drawing outlines of graphical objects.

Fields Summary

Constructors Summary

Methods Summary

Properties

Name Type Description
alpha Object

A Number value that specifies the stroke alpha.

color Object

A Number value that specifies the stroke color.

pixelHinting Object

A Boolean value that specifies whether pixel hinting is applied.

thickness Object

A Number value that specifies the stroke thickness.

Constructors

StrokeStyle(params?:Object)

Constructs a new StrokeStyle object, optionally initializing it from an object.

var style:StrokeStyle = new StrokeStyle({
  thickness: 2,
  color: 0xff8030,
  alpha: 0.7,
  pixelHinting: false
});
Parameter Type Description
params? Object

An initialization object that contains a set of initial values for the new StrokeStyle object.

Static Methods

mergeStyles(styles:Array): StrokeStyle

Merges two or more StrokeStyle objects. Styles are merged in order they come in the array, properties of styles with larger indices in the array overriding values that came earlier.

Parameter Type Description
styles Array

An array of StrokeStyle objects to merge.

Instance Methods

toString(): String

Returns a String representation of this object.

Back to top

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.