AddDataBaseLayer
AddDataBaseLayer adds a new data base layer to a specified MapFrame object.
Syntax
object.AddDataBaseLayer(Map,ImportFileName, ImportOptions)
Parameter |
Type |
Default |
Description |
Map |
MapFrame |
Required; This provides the path and file name of the map. |
|
ImportFileName |
String |
|
Required; This provides the path and file name including the file extension. An error is returned if a raster image is specified. |
ImportOptions |
String |
"" |
Optional; This provides the import options string to specify the data import options as well as Base from Data layer specific import options. See Remarks section for more information. |
Remarks
In addition to the data import options, the ImportOptions string includes five additional optional parameters when creating a base map from data.
Parameter |
Type |
Default |
Description |
DataBaseFirst |
Integer |
First row of worksheet |
Optional; specifies the first row of data to include in the base layer |
DataBaseLast |
Integer |
Last row of worksheet |
Optional; specifies the last row of data to include in the base layer |
DataBaseFrequency |
Integer |
1 |
Optional; specifies which rows included between the first and last row |
DataBaseXCol |
String |
First column |
Optional; specifies the column containing the X coordinates |
DataBaseYCol |
String |
Second column |
Optional; specifies the column containing the Y coordinates |
Example
This example demonstrates how to create a map with vector graphics and overlap data points from the data base layer.
Sub Main
Dim Surfer As Object
Set Surfer = GetObject(,"Surfer.Application")
Surfer.Visible = True
Set doc = Surfer.Documents.Add
Set map = doc.Shapes.AddBaseMap(Surfer.Path+"\samples\demoslice.bln")
Set dataLayer = doc.Shapes.AddDataBaseLayer(Map:=map, ImportFileName:=Surfer.Path+"\samples\demoslice.bln")
dataLayer.Name = "demoslice.bln layer as points"
End Sub
Used by: Shapes collection