DK11 for Delphi | GisViewer.TGIS_Viewer.Get | Constructors | Fields | Methods | Properties | Events
Retrieve the layer identified by a name. Sublayer or compund layers can be found by do notation like 'name.sublyer'
Implements IGIS_Viewer.Get.
// Delphi public function Get( const _name : String ) : TGIS_LayerAbstract;
// C++ Builder public: TGIS_LayerAbstract* Get( const UnicodeString _name );
Name | Type | Description |
---|---|---|
_name | String | name of layer to be found |
Type | Description |
---|---|
TGIS_LayerAbstract | Found layer or nil if not found. |
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 ;