AddVectorLayer

AddVectorLayer adds a new vector map layer to a specified MapFrame object. Returns a VectorLayer Object.

Syntax

object. AddVectorLayer( Map, GridFileName1, GridFileName2, CoordSys, AngleSys, AngleUnits )

Parameter

Type

Default

Description

Map

MapFrame

 

required; This specifies the MapFrame object to which the vector map layer is added.

GridFileName1

String

 

required; This provides the 1-grid vector map grid file name, or a two-grid X component (angle) grid file name.

GridFileName2

String

""

optional; This provides the two-grid vector map Y component (length) grid file name.

CoordSys

SrfVecCoordSys

srfVecCartesian

optional; This provides the two-grid vector map coordinate system.

AngleSys

SrfVecAngleSys

srfVecBearing

optional; This provides the two-grid vector map angle system for polar coordinates

AngleUnits

SrfVecAngleUnits

srfVecDegrees

optional; This provides the two-grid vector map unit type for polar coordinates

Example 1

This example demonstrates how to create a contour map and coordinate system named MapFrame followed by its corresponding contour map layer named ContourLayer from the grid file named "demogrid.grd." It then creates a vector map layer within the MapFrame with AddVectorLayer and names the layer VectorLayer.

'declares MapFrame object and creates a new contour map

Dim MapFrame As Object

Set MapFrame = Shapes.AddContourMap(GridFileName1:=SurferApp.Path+"\Samples\demogrid.grd")

 

'declares ContourLayer object and sets the reference to the contour layer

Dim ContourLayer As Object

Set ContourLayer = MapFrame.Overlays(1)

 

'declares VectorLayer object and adds a 1-grid vector layer to the map

Dim VectorLayer As Object

Set Vector Layer = Shapes.AddVectorLayer(Map:=MapFrame, _

GridFileName1:=SurferApp.Path+"\Samples\demogrid.grd")

Example 2

This script displays all the methods and properties in the Shapes collection.

Used by: Shapes collection

See Also

VectorLayer Object

1-Grid Vector Map

2-Grid Vector Map