User Tools

Site Tools


api:dk11:delphi:gisviewer.tgis_viewer.get_string

TGIS_Viewer.Get method

DK11 for Delphi | GisViewer.TGIS_Viewer.Get | Constructors | Fields | Methods | Properties | Events

Retrieve the layer identified by a name.

Available also on: .NET | Java | ActiveX.

Syntax

Implements IGIS_Viewer.Get.

// Delphi
public
  function Get(
    const _name : String
  ) : TGIS_LayerAbstract;
// C++ Builder
public:
  TGIS_LayerAbstract* Get(
    const UnicodeString _name
  );

Parameters

Name Type Description
_name String name of layer found

Result

Type Description
TGIS_LayerAbstract

Example

Delphi

procedure MyClass.GetLayer(_const param : Integer);
var
  ll : TGIS_LayerVector ;
begin
 
  // we get a layer by its name
  ll := TGIS_LayerVector( Gis.Get( 'states' ) );
 
  // if any found, let's change its attributes
  if ll <> nil then begin
    case _param of
      1 : ll.Params.Labels.Field := 'name' ;
      2 : ll.Params.Labels.Field := 'capital' ;
    else  ll.Params.Labels.Field := '' ;
    end ;
  end ;
  GIS.Update ;
end ;
 
function MyClass.DeleteLayer(const _name : String) : Boolean;
begin
  Result:=False;
   try
    GIS.Delete (_name);
    Result:=True;
   except
    ShowMessage ('Layer not found');
   end ;
end ;

References

2020/05/07 01:10