User Tools

Site Tools


api:dk11:delphi:gisshortestpath.tgis_shortestpath.create_igis_viewer

Table of Contents

TGIS_ShortestPath.Create constructor

DK11 for Delphi | GisShortestPath.TGIS_ShortestPath.Create | Constructors | Methods | Properties | Events

Create an instance.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
public
  constructor Create(
    const _viewer : IGIS_Viewer
  );
// C++ Builder
Create (
  IGIS_Viewer* const _viewer
);

Parameters

Name Type Description
_viewer IGIS_Viewer viewer on which class will be operating.

Example

This is a simple example to create a TGIS_ShortestPath object.

Delphi

var
  rtrObj : TGIS_ShortestPath ;
  layerSrc : TGIS_LayerVector ;
  GIS: TGIS_ViewerWnd;
begin
  // let's get a source layer
  layerSrc := TGIS_LayerVector( TGIS_LayerSHP( GIS.Items[0] ) ) ;
  if not Assigned( layerSrc ) then exit ;
 
  // create a TGIS_ShortestPath object and attatch data from the source layer
  rtrObj := TGIS_ShortestPath.Create( GIS ) ;
  rtrObj.LoadTheData( layerSrc ) ;
  rtrObj.RoadName := 'NAME';
end ;
2022/11/30 19:18

Page Tools