User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.importstructure_tgis_layervector

TGIS_LayerVector.ImportStructure method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.ImportStructure | Constructors | Fields | Methods | Properties | Events

Imports the field structure from another layer

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  procedure ImportStructure(
    const _layer : TGIS_LayerVector
  ); virtual;
// C++ Builder
public:
  virtual void ImportStructure(
    TGIS_LayerVector* const _layer
  );

Parameters

Name Type Description
_layer TGIS_LayerVector layer to be imported

Remarks

Use this method to import the existing field structure from another layer. To do this, simply create a new layer (or use existing layer), choose another layer to import from, and use ImportStructure method passing the chosen layer as a param.

Example

Here is a simple procedure to import the field structure from another layer.

Delphi

procedure MyClass.GetFieldStructure();
var
  ll : TGIS_LayerVector ;
  lv : TGIS_LayerVector ;
begin
  // check whether GIS object has any layers
  if GIS.IsEmpty then
    exit ;
 
  // Get first layer from the viewer
  ll:= TGIS_LayerVector (GIS.Items[0]) ;
 
  // Create a new layer and set the layer name.
  lv:=TGIS_LayerVector.Create;
  lv.Name:='MyLayer';
 
  // Add layer to the viewer.
  GIS.Add(lv);
 
  // Import the field structure from a given layer
  lv.ImportStructure (ll);
end;

References

2020/05/07 01:09