Vertices property
Returns or sets the array of Location objects that comprise the beginning and ending points for line shapes and the points where angles meet for freeform shapes. The shape must have a Type property of geoLine or geoFreeform. Read/write Variant.
Applies to
Objects: Shape
Syntax
object.Vertices
Parameters
Part | Description |
---|---|
object | Required. An expression that returns a Shape object. |
Remarks
To add a closed polygon, assign the same coordinates to the first and last vertices. Similarly, if the distance between the first and last location is 0
, then the freeform is closed.
The vertices for freeform shapes are in order around the perimeter of the shape.
Example
Sub CreateTwoShapes()
Dim objApp As New MapPoint.Application
Dim objMap As MapPoint.Map
Dim objLoc(1 To 3) As MapPoint.Location
'Set up the application
Set objMap = objApp.ActiveMap
objApp.Visible = True
objApp.UserControl = True
'Get three locations and zoom in, and then create a shape
Set objLoc(1) = objMap.FindResults("Seattle, WA").Item(1)
Set objLoc(2) = objMap.FindResults("Redmond, WA").Item(1)
Set objLoc(3) = objMap.FindResults("Tacoma, WA").Item(1)
Set objMap.Location = objLoc(1)
objMap.Shapes.AddPolyline objLoc
'Use the vertices of this shape to create another shape
objMap.Shapes.AddPolyline objMap.Shapes.Item(1).Vertices
MsgBox "There are now " + CStr(objMap.Shapes.Count) + " shapes."
End Sub
Note This sample code is specific for use in MapPoint North America; it is for illustration purposes only.