Package | com.google.maps.overlays |
Class | public class Polygon |
Implements | flash.events.IEventDispatcher, IPolygon |
Property | Defined by | ||
---|---|---|---|
foreground : DisplayObject [read-only]
Display object that represents the overlay's content.
| Polygon | ||
pane : IPane
Pane this overlay resides on (null if the overlay is not added to the map).
| Polygon | ||
shadow : DisplayObject [read-only]
Display object that represents the overlay's shadow (null if the overlay
never has a shadow).
| Polygon | ||
visible : Boolean
Visibility of the overlay.
| Polygon |
Method | Defined by | ||
---|---|---|---|
Polygon(points:Array, options:PolygonOptions = null)
Constructs a new polygon at the specified lat-lng, using the specified
options.
| Polygon | ||
[static]
Constructs a polygon from encoded data.
| Polygon | ||
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).
| Polygon | ||
getInnerPolylineCount():Number
Returns the number of polylines that make up the inner boundaries of
this polygon.
| Polygon | ||
getInnerVertex(line:Number, index:Number):LatLng
Returns the LatLng of the vertex with the specified index from the
specified inner polyline boundary.
| Polygon | ||
getInnerVertexCount(line:Number):Number
Returns the number of vertices in a specified inner line.
| Polygon | ||
Returns the LatLngBounds of this polygon, or null if the polygon
contains no points.
| Polygon | ||
Retrieves the polygon's options.
| Polygon | ||
getOuterVertex(index:Number):LatLng
Returns the vertex from the outer boundary with the specified index.
| Polygon | ||
getOuterVertexCount():Number
Returns the number of vertices in the outer line.
| Polygon | ||
positionOverlay(zoomChanged:Boolean):void
Reposition the overlay on the screen.
| Polygon | ||
setOptions(options:PolygonOptions):void
Updates the polygon's options.
| Polygon |
Method | Defined by | ||
---|---|---|---|
clearWrapper():void
Remove all event listeners and clear the wrapper.
| Polygon |
foreground | property |
foreground:DisplayObject
[read-only]Display object that represents the overlay's content.
Implementation public function get foreground():DisplayObject
pane | property |
pane:IPane
[read-write]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.
Implementation public function get pane():IPane
public function set pane(value:IPane):void
shadow | property |
shadow:DisplayObject
[read-only]Display object that represents the overlay's shadow (null if the overlay never has a shadow).
Implementation public function get shadow():DisplayObject
visible | property |
visible:Boolean
[read-write]Visibility of the overlay.
Implementation public function get visible():Boolean
public function set visible(value:Boolean):void
Polygon | () | constructor |
public function Polygon(points:Array, options:PolygonOptions = null)
Constructs a new polygon at the specified lat-lng, using the specified
options. To create a polygon from encoded data,
use the fromEncoded
method.
points:Array — Array of LatLng vertex locations.
|
|
options:PolygonOptions (default = null ) — 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.
|
See also
clearWrapper | () | method |
protected function clearWrapper():void
Remove all event listeners and clear the wrapper.
fromEncoded | () | method |
public static function fromEncoded(polylineList:Array, options:PolygonOptions = null):Polygon
Constructs a polygon from encoded data.
ParameterspolylineList:Array — An array of EncodedPolylineData objects for polylines.
|
|
options:PolygonOptions (default = null ) — 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.
|
Polygon —
Newly constructed polygon.
|
getDefaultPane | () | method |
public function 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).
Parametersmap:IMap — Instance of map that this overlay is added to.
|
IPane —
Instance of IPane to which the overlay will be added by default.
|
getInnerPolylineCount | () | method |
public function getInnerPolylineCount():Number
Returns the number of polylines that make up the inner boundaries of this polygon.
ReturnsNumber — Number of polylines making up the inner polygon boundaries.
|
getInnerVertex | () | method |
public function getInnerVertex(line:Number, index:Number):LatLng
Returns the LatLng of the vertex with the specified index from the specified inner polyline boundary.
Parametersline:Number — Index of the inner polyline.
|
|
index:Number — Index of the target vertex within the specified polyline.
|
LatLng —
Lat-lng of the specified vertex.
|
getInnerVertexCount | () | method |
public function getInnerVertexCount(line:Number):Number
Returns the number of vertices in a specified inner line.
Parametersline:Number — Index of the inner line.
|
Number — Number of vertices.
|
getLatLngBounds | () | method |
public function getLatLngBounds():LatLngBounds
Returns the LatLngBounds of this polygon, or null if the polygon contains no points.
ReturnsLatLngBounds |
getOptions | () | method |
public function getOptions():PolygonOptions
Retrieves the polygon's options. Use the setOptions() method to modify options on the polygon.
ReturnsPolygonOptions —
Full set of options on the polygon.
|
See also
getOuterVertex | () | method |
public function getOuterVertex(index:Number):LatLng
Returns the vertex from the outer boundary with the specified index.
Parametersindex:Number — Index of the target vertex.
|
LatLng —
Lat-lng of the specified vertex.
|
getOuterVertexCount | () | method |
public function getOuterVertexCount():Number
Returns the number of vertices in the outer line.
ReturnsNumber — Number of vertices.
|
positionOverlay | () | method |
public function 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).
ParameterszoomChanged:Boolean — Whether the zoom level of the map has changed
or the call was invoked just as a result of a map pan.
|
setOptions | () | method |
public function 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);
options:PolygonOptions — New full or partial set of options for the polygon.
|