AddVectorBaseLayer
AddVectorBaseLayer adds a new base (vector) layer to the specified MapFrame object. Returns a BaseLayer object. The AddVectorBaseLayer method creates a base (vector) layer. To create a base map from a raster image, use AddRasterBaseLayer.
Syntax
object. AddVectorBaseLayer( Map, ImportFileName, ImportOptions )
Parameter |
Type |
Default |
Description |
Map |
required; It specifies the MapFrame object in which the base layer is added. |
||
ImportFileName |
String |
required; It provides the path and file name including the file extension. An error is returned if a raster image file is specified. |
|
ImportOptions |
String |
"" |
optional; It provides the import options string. See below for specific options for the various file types. |
Remarks
ImportFileName must include a file extension. See the following links for more details on ImportOptions.
Extension |
File Type |
BLN |
|
BNA |
|
DICOM3 |
|
DDF SDTS |
|
DLG USGS |
|
DXF |
|
E00 |
|
EMF |
|
GSB |
|
GSI |
|
MIF |
|
|
Adobe Portable Document Format [.PDF] |
PLT |
|
PLY |
Stanford [.PLY] |
SHP |
|
VTK |
Visualization Toolkit [.VTK] |
WMF |
Example 1
This example demonstrates how to create a contour map coordinate system named MapFrame followed by its corresponding contour map named ContourLayer from the grid file named Diablo.grd. It then adds the base layer in the same map frame with the AddBaseLayer method.
'declare the MapFrame object and create a new map frame
Dim MapFrame As Object
Set MapFrame = Shapes. AddContourMap(GridFileName:=SurferApp.Path+"\Samples\Demogrid.grd")
'declare the ContourLayer object and set the reference to the contour layer
Dim ContourLayer As Object
Set ContourLayer = MapFrame.Overlays(1)
'declare the VectorBaseLayer object and create a new base layer
Dim VectorBaseLayer As Object
Set VectorBaseLayer = Shapes.AddVectorBaseLayer(Map:= MapFrame, _
ImportFileName:=SurferApp.Path+"\Samples\DemoRect.bln")
Example 2
This example demonstrates how to add a base layer to a map while specifying file import options.
'create a new base layer
Plot.Shapes.AddVectorBaseLayer(Map:= MapFrame, _
ImportFileName:=SurferApp.Path+"\Samples\CO2010.GSB",ImportOptions:="AreasToCurves=1")
Example 3
This script displays all the methods and properties in the Shapes collection.
Used by: Shapes collection