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). |
IMap3D is the interface implemented by Map3D. Create an instance of class Map3D to create a map that supports 3-D views.
| Name | Type | Description |
|---|---|---|
camera |
ICamera |
The camera that may be used to return information about the viewing geometry and perform transformations between lat-lng, world and viewport coordinates. |
dragMode |
int |
The drag mode that is being used on the map. Acceptable values for
this property are By default, the drag mode is updated automatically immediately
before dispatching 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
Note that since the drag mode can change immediately before, and
while handling, |
viewMode |
int |
The view mode that is being applied to map. Acceptable values for this
property are |
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. |
IMapType is the interface implemented by map type objects. A map type is a set of tile layers, a map projection, a tile size, and assorted other settings, such as link colors and copyrights. Google provides a set of predefined map types. You can also use com.google.maps.MapType class to define a custom map type. Map types can be added to the map using the Map.addMapType() method.
getAlt(): 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. |
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
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.
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 |
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. |
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. |
This interface is implemented by the overlay objects, such as markers, polylines, polygons, ground overlays and info windows. An instance of IOverlay can be put on the map with the method Map.addOverlay().
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
getDefaultPane(map:IMap): 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. |
IPane is the interface is implemented by the map panes. Pane is a container for overlays (such as markers, polylines, polygons etc).
| Name | Type | Description |
|---|---|---|
id |
uint |
Pane's id. |
map |
IMap |
The instance of map this pane is added to. Null if the pane is removed from the map. |
paneManager |
IPaneManager |
The instance of pane manager this pane is added to. Null if the pane is removed from the map. |
visible |
Boolean |
Visibility of the pane. |
addOverlay(overlay:IOverlay): 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. |
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.
| 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. |
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. |
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.  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
latLng
property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately
underneath the mouse pointer.
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
|
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
|
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
|
encoded |
EncodedPolylineData |
Encoded polyline data. |
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
latLng
property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately
underneath the mouse pointer.
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. |
IProjection is the interface for map projections. A map projection implementor is passed to the constructor of MapType. This interface is implemented by MercatorProjection, which is used by all predefined map types. You can implement this interface if you want to define map types with different map projections. Use class ProjectionBase for your custom projections.
fromLatLngToPixel(latLng:LatLng, zoom:Number): 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. |
IScaleControl is the interface implemented by ScaleControl. A ScaleControl provides a control that shows the scale of the map.
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.
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. |
This interface is defined by tile layer implementations that are used by different map types. In order to define a custom tile layer, use class TileLayerBase.
getAlpha(): 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. |
| Name | Type | Description |
|---|---|---|
projection |
IProjection |
Projection used for calculating positions of tiles. |
tileLayer |
ITileLayer |
Tile layer used for the overlay. |
tileSize |
int |
Tile size. |
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.
IWrappable is the base interface for all objects that provide AS3 cross-domain scripting functionality.
| Name | Type | Description |
|---|---|---|
interfaceChain |
Array |
List of interfaces for wrapping this object. Used in cross-domain communication. |
wrapper |
Object |
Instance of the cross-domain wrapper for this object. |
IWrappableEventDispatcher is the base interface for all objects that provide cross-domain event dispatching functionality.
getBaseEventDispatcher(): Object
Retrieves the base event dispatcher object that allows access to event dispatching capability for cross-domain objects.
Class EncodedPolylineData represents the set of data required for creating an encoded polyline.
| Name | Type | Description |
|---|---|---|
levels |
String |
String containing encoded polyline zoom level groups. |
numLevels |
Number |
Number of zoom levels contained in the encoded levels string. |
points |
String |
String containing encoded latitude and longitude coordinates. |
zoomFactor |
Number |
Magnification between adjacent sets of zoom levels in the encoded levels string. |
EncodedPolylineData(points:String, zoomFactor:Number, levels:String, numLevels:Number)
Constructor.
| Parameter | Type | Description |
|---|---|---|
points |
String |
String containing encoded latitude and longitude coordinates. |
zoomFactor |
Number |
Magnification between adjacent sets of zoom levels in the encoded levels string. |
levels |
String |
String containing encoded polyline zoom level groups. |
numLevels |
Number |
Number of zoom levels contained in the encoded levels string. |
GroundOverlays are images laid out over the map content whose corners are located with latitude/longitude pairs.
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
latLng
property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately
underneath the mouse pointer.
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
GroundOverlay(content:DisplayObject, bounds:LatLngBounds, options?:GroundOverlayOptions)
Constructs a new GroundOverlay instance, using the specified options.
| Parameter | Type | Description |
|---|---|---|
content |
DisplayObject |
Content to display. |
bounds |
LatLngBounds |
Latitude and longitude bounds over which the image extends. |
options? |
GroundOverlayOptions |
Ground overlay options. |
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
GroundOverlayOptions class specifies a set of rendering parameters for a GroundOverlay.
| 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. You may set this
|
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 How rotation behaves depends on whether applyProjection is
If If |
rotationContentCenter |
Point |
Ground overlay rotation center in content coordinates. This is the point, in the coordinates of the GroundOverlay's content, around which rotation occurs. If not set, then rotation occurs around the content center. |
strokeStyle |
StrokeStyle |
Ground overlay stroke style. |
GroundOverlayOptions(param?:Object)
Constructs a new GroundOverlayOptions object, optionally initializing it from an object.
var options:GroundOverlayOptions = new GroundOverlayOptions({ strokeStyle: { color: 0x987654, alpha: 0.8, thickness: 3, pixelHinting: true }, rotation: 90, applyProjection: true, renderContent: true });
| Parameter | Type | Description |
|---|---|---|
param? |
Object |
An initialization object containing a set of values that supplement the default set. |
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. |
toString(): String
Returns a String representation of this object.
A Marker
object marks a position on the map. It
implements the IOverlay
interface and can be added to
the map using the Map.addOverlay()
method.
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
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.
| Name | Type | Description |
|---|---|---|
foreground |
DisplayObject |
Display object that represents the overlay's content. |
pane |
IPane |
Pane this overlay resides on (null if the overlay is not added to the map). This property value is set by the map when the overlay is added to or removed from the map and should not be modified by the developers. |
shadow |
DisplayObject |
Display object that represents the overlay's shadow (null if the overlay never has a shadow). |
visible |
Boolean |
Visibility of the overlay. |
Marker(latLng:LatLng, options?:MarkerOptions)
Constructs a new marker at the specified lat-lng, with the specified options.
| Parameter | Type | Description |
|---|---|---|
latLng |
LatLng |
Marker location. |
options? |
MarkerOptions |
Full or partial set of marker options. When a partial set of options is specified, the marker's complete set of options will be a combination of partial options and the existing defaults set using MarkerOptions.setDefaultOptions() call. |
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 |
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
MarkerOptions class specifies a set of rendering parameters for the Marker.
| 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) |
| 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 ( 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 |
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. |
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. |
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. |
toString(): String
Returns a String representation of this object.
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.
| 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 Alternatively, developers may add listeners for
|
shadow |
DisplayObject |
Display object that represents the overlay's shadow.
By default returns If the overlay needs to have a shadow, this method property should be
redefined and the value of The display object returned by this property should remain unchanged while the overlay is added to a map. |
visible |
Boolean |
Visibility of the overlay. |
OverlayBase()
Constructor.
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. |
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.  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
latLng
property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately
underneath the mouse pointer.
| 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. |
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. |
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. |
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
|
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
|
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
|
encoded |
EncodedPolylineData |
Encoded polyline data. |
show(): void
PolygonOptions class specifies a set of rendering parameters for polygons.
| Name | Type | Description |
|---|---|---|
fillStyle |
FillStyle |
Polygon fill style. |
strokeStyle |
StrokeStyle |
Polygon stroke style. |
tooltip |
String |
Polygon tooltip text. |
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. |
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. |
toString(): String
Returns a String representation of this object.
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
latLng
property on any MapMouseEvent
that is dispatched holds the lat-lng of the location immediately
underneath the mouse pointer.
| 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. |
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. |
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. |
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
PolylineOptions class specifies a set of rendering parameters for polylines.
| Name | Type | Description |
|---|---|---|
geodesic |
Object |
A Boolean value that specifies whether this is a geodesic polyline. |
strokeStyle |
StrokeStyle |
Polyline stroke style. |
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. |
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. |
toString(): String
Returns a String representation of this object.
TileLayerOverlay is a type of overlay that adds a custom layer of tiles to the map on top of the MapType-specific tile layers.
| 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. |
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). |
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.
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.
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. |
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. |
ClientGeocoderOptions specifies properties for configuring ClientGeocoder instances.
| 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. |
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. |
toString(): String
Returns a String representation of this object.
A Directions object communicates with Google servers to obtain directions between two or more waypoints. Responses to such requests contain an encoded polyline representing the directions, and HTML-formatted steps to take.
| Name | Type | Description |
|---|---|---|
bounds |
LatLngBounds |
The bounding box for the result of this directions query. This is will be null if no successful result is available. |
copyrightsHtml |
String |
An HTML string containing the copyright information for this result. |
distance |
Number |
The total distance of this entire directions request in meters. |
distanceHtml |
String |
The total distance of this entire directions request in a localized string representation in the units that are predominant in the starting country of this set of directions. |
duration |
Number |
The total time of this entire directions request in seconds. |
durationHtml |
String |
The total time of this entire directions request in a localized string representation. |
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. |
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. |
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 |
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
|
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. |
A DirectionsEvent object is dispatched into the event flow whenever a directions request completes.
| Name | Value | Description |
|---|---|---|
DIRECTIONS_ABORTED |
directionsaborted |
Directions abort event ("directionsaborted"). This is dispatched when
either a new |
DIRECTIONS_FAILURE |
directionsfailure |
Directions failure event ("directionsfailure"). |
DIRECTIONS_SUCCESS |
directionssuccess |
Directions succeeded event ("directionssuccess"). |
| 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. |
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. |
DirectionsOptions specifies properties for configuring Directions instances.
| 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. |
| 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}. |
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. |
toString(): String
Returns a String representation of this object.
An Elevation object communicates with Google servers to obtain elevation information at one or more locations.
Elevation()
Creates an Elevation instance which can be used to query the elevation at one or more locations.
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. |
An ElevationEvent object is dispatched into the event flow whenever an elevation request completes.
| Name | Value | Description |
|---|---|---|
ELEVATION_FAILURE |
elevationfailure |
Elevation failure event. |
ELEVATION_SUCCESS |
elevationsuccess |
Elevation success event. |
| 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. |
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. |
ElevationResponse defines a location and its corresponding elevation. The elevation service returns an array of ElevationResponse instances in response to each elevation query.
| Name | Type | Description |
|---|---|---|
elevation |
Number |
Elevation in metres. |
location |
LatLng |
Location. |
ElevationResponse(location:LatLng, elevation:Number)
Constructor for ElevationResponse object.
| Parameter | Type | Description |
|---|---|---|
location |
LatLng |
Location. |
elevation |
Number |
Elevation in metres. |
A GeocodingEvent object is dispatched into the event flow whenever a geocoding request completes.
| Name | Value | Description |
|---|---|---|
GEOCODING_FAILURE |
geocodingfailure |
Geocoding failure event ("geocodingfailure"). |
GEOCODING_SUCCESS |
geocodingsuccess |
Geocoding succeeded event ("geocodingsuccess"). |
| 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. |
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. |
A GeocodingResponse object represents the result of a geocoding operation returned by the server.
| Name | Type | Description |
|---|---|---|
name |
String |
Geocoding request text. |
placemarks |
Array |
List of placemarks returned by the geocoder. |
GeocodingResponse()
Constructor for GeocodingResponse object.
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.
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. |
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. |
A MaxZoomEvent object is dispatched into the event flow whenever a max zoom request completes.
| Name | Value | Description |
|---|---|---|
MAXZOOM_FAILURE |
maxzoomfailure |
Max zoom failure event. |
MAXZOOM_SUCCESS |
maxzoomsuccess |
Max zoom success event. |
| Name | Type | Description |
|---|---|---|
latLng |
LatLng |
Gets the lat-lng associated with this event. |
zoom |
Number |
Gets the zoom level associated with this event. |
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. |
Describes a single result returned by a geocoding request.
| Name | Type | Description |
|---|---|---|
address |
String |
Full address for the placemark. |
addressDetails |
Object |
Address details object. |
point |
LatLng |
LatLng for the address. |
Placemark()
Constructor. Creates an empty placemark object.
toString(): String
Returns a string representation of the placemark of the form "address"
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.
| 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 |
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. |
Route()
Constructor. Creates an empty route object.
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. |
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.
| 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. |
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.
| 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. |
Step()
Constructor. Creates an empty step object.
Class BevelStyle specifies a set of parameters for drawing a bevel.
| Name | Value | Description |
|---|---|---|
BEVEL_LOWERED |
2 |
Lowered bevel. |
BEVEL_NONE |
0 |
No bevel. |
BEVEL_RAISED |
1 |
Raised bevel. |
| 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. |
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. |
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. |
toString(): String
Returns a String representation of this object.
Class ButtonFaceStyle specifies a set of parameters for drawing a button face in a specific state (up/over/down).
| Name | Type | Description |
|---|---|---|
labelFormat |
TextFormat |
Button's label format. |
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. |
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. |
toString(): String
Returns a String representation of this object.
Class ButtonStyle specifies a set of parameters for drawing buttons.
| 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. |
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. |
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. |
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.
Class FillStyle specifies a set of parameters for drawing backgrounds of graphical objects.
| 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. |
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. |
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. |
toString(): String
Returns a String representation of this object.
Class GradientStyle specifies a set of parameters for drawing gradient backgrounds of graphical objects.
| 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. |
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. |
toString(): String
Returns a String representation of this object.
Class MapTypeStyle specifies the scope and rules for applying a custom style to a map.
| 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 |
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 |
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
|
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
|
elementType |
String |
Element type. Acceptable values are defined by the class
|
stylers |
Array |
An array of styler objects. Create the elements within
this array using the methods in class |
Class MapTypeStyleElementType specifies possible values for element types. These distinguish between the different representations of a feature.
| 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. |
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.
| 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. |
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.
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'. |
Class RectangleStyle combines a FillStyle and a StrokeStyle to use for rendering a basic rectangle.
| Name | Type | Description |
|---|---|---|
fillStyle |
FillStyle |
Rectangle's fill style. |
strokeStyle |
StrokeStyle |
Rectangle's stroke style. |
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. |
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. |
toString(): String
Returns a String representation of this object.
StrokeStyle class specifies a set of parameters for drawing outlines of graphical objects.
| 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. |
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. |
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. |
toString(): String
Returns a String representation of this object.