Packagecom.esri.aws.awx.geom
Classpublic class PolygonShape
Implementscom.esri.aws.awx.geom.IShape

A polygon shape described by an array of GeoPoints.

Custom shapes can be created by extending this class and changing the constructor arguments.

Default MXML PropertygeoPoints

View the examples.



Public Properties
 PropertyDefined by
  extent : Extent
[read-only] Retrieves the bounding box (maxX, maxY, minX, minY) of this polygon.
PolygonShape
  geoPoints : Array
The array lat/lon locations.
PolygonShape
Public Methods
 MethodDefined by
  
PolygonShape(geoPoints:Array = null)
Creates a new PolygonShape.
PolygonShape
  
contains(px:Number, py:Number):Boolean
PolygonShape
  
containsPoint(pt:GeoPoint):Boolean
PolygonShape
  
deepClone():IShape
Creates a deep copy of the shape.
PolygonShape
Property detail
extentproperty
extent:Extent  [read-only]

Retrieves the bounding box (maxX, maxY, minX, minY) of this polygon.

Implementation
    public function get extent():Extent
geoPointsproperty 
geoPoints:Array  [read-write]

The array lat/lon locations.

Implementation
    public function get geoPoints():Array
    public function set geoPoints(value:Array):void
Constructor detail
PolygonShape()constructor
public function PolygonShape(geoPoints:Array = null)

Creates a new PolygonShape.

Parameters
geoPoints:Array (default = null) — an array of GeoPoints.
Method detail
contains()method
public function contains(px:Number, py:Number):BooleanParameters
px:Number
 
py:Number

Returns
Boolean
containsPoint()method 
public function containsPoint(pt:GeoPoint):BooleanParameters
pt:GeoPoint

Returns
Boolean
deepClone()method 
public function deepClone():IShape

Creates a deep copy of the shape.

Returns
IShape — A copy of the shape.
Examples

This is a basic sample showing how you can manipulate the constuctor of PolygonShape or PolylineShape to create a new shape.
package com.esri.aws.awx.geom
{
    import com.esri.aws.awx.geom.PolygonShape;
    import com.esri.aws.services.Envelope;

    public class CustomPolygonShape extends PolygonShape
    {
        public function CustomPolygonShape(envelope:Envelope)
        {
            var geoPoint1:GeoPoint = new GeoPoint(envelope.minX, envelope.maxY);
            var geoPoint2:GeoPoint = new GeoPoint(envelope.maxX, envelope.maxY);
            var geoPoint3:GeoPoint = new GeoPoint(envelope.maxX, envelope.minY);
            var geoPoint4:GeoPoint = new GeoPoint(envelope.minX, envelope.minY);

            super([geoPoint1, geoPoint2, geoPoint3, geoPoint4]);
        }

    }
}