AddPolygon2

The AddPolygon2 method adds a new simple area or spline area. Returns an Area object. This method is the same as the AddPolygon method, except it takes the pointer to the array. VB users may want to call this method instead of AddPolygon. Note: Golden Software does not officially support VB.

 

Syntax

object.AddPolygon2( bSpline, Vertices, UnitType )

 

Parameter

Type

Description

bSpline

Boolean

required; true to add a spline area

Vertices

Array of Doubles

required; array containing each vertex in the area

UnitType

MVCoordDisplayUnits

optional; unit type, default is mvCoordDisplayUnitPageUnits

 

Remarks

Use page units in the array. Vertices is an array containing alternating XY page coordinates. This assumes the entire array is used. VB users can use ReDim to set the array size to the used size if necessary. See Coordinate Arrays for more information about creating arrays in MapViewer.

 

Example

This example demonstrates how to create a area using an array of doubles named Coordinates. The even numbered elements within the Coordinates array represent X values, while the odd numbered elements represent their corresponding Y values.

 

Dim Polygon As Object

Dim Coordinates(5) As Double

Coordinates(0) = 4: Coordinates(1) = 1

Coordinates(2) = 7: Coordinates(3) = 3

Coordinates(4) = 2: Coordinates(5) = 6

 

Set Polygon = MapShapes.AddPolygon2(bSpline:=False, Vertices:=Coordinates)

 

Used by: Shapes collection