Skip to main content

TdxMapItemFileLayer.LoadFromFile(string) Method

Loads vector data from a specified file.

Declaration

procedure LoadFromFile(const AFileName: string = '');

Parameters

Name Type
AFileName string

Remarks

If the AFileName parameter is not specified or an empty string is passed as this parameter, the file referenced by the FileName property is loaded instead. The LoadFromFile method switches the Active property to False and creates map items from file data based on the file format specified via the FileType property:

  • For the KML file, the LoadFromFile method opens it as a stream and passes this stream as a parameter to the LoadFromStream method.

  • For the Esri shapefile, the LoadFromFile method locates SHP and DBF files by the path and file name included in the AFileName or FileName string, opens these files as streams, and passes the streams as parameters to the LoadShapeFileFromStream method. It is assumed that the SHP and DBF files are stored in the same folder, under the same file name, but with different extensions.

See Also