A Feature Layer is a complex TerraExplorer object designed to display feature datasets from different sources. An XML standard is used to define connections to various layer source file formats and servers. A minimal information set must be included in an XML string to create a new layer using IInformationTree5::CreateLayer.
See: “Feature Layers” chapter in the User Manual for additional information.
The XML string should be in the following format (bold fields are mandatory):
<PlugData>
<PlugType></PlugType>
<LayerName></LayerName>
<Server></Server>
<user></user>
<password></password>
<TableName></TableName>
<AttributesToLoad></AttributesToLoad >
<Feature></Feature >Must use Feature and/or Annotation
<Annotation></Annotation> Must use Feature and/or Annotation
<SaveItems></SaveItems>
<GroupKey></GroupKey>
<SysKey></SysKey>
<DatumKey></DatumKey>
<UnitKey></UnitKey>
<UseZValue></UseZValue>
<AltitudeUnit></AltitudeUnit>
<Reproject></Reproject>
<StreamedLayer></StreamedLayer>
</PlugData >
For example, this XML loads the shape file “C:\sample.shp” as a layer:
<PlugData>
<LayerName>C:\country.shp</LayerName>
<PlugType>shape</PlugType>
</PlugData>
Parameters:
PlugType – The type of layer to load. The tag should include one of the following values:
“shape” – For loading a shape file.
“geodatabase” – For loading a GeoDatabase file.
“wfs” – For loading a layer from a WFS server.
“oracle” – For loading a layer from an Oracle server.
“arcsde” – For loading a layer from an ArcSDE server.
LayerName – Full path of a layer file or the layer name when the layer is loaded from a server.
Server – The server URL address. If the URL address is set, enter the server layer name in the LayerName node.
User – User name when loading from a server.
Password – Password when loading from a server.
LayerName – The full path of a layer file or the layer name when loading from a server.
TableName – The table name in a GeoDatabase file when the file is loaded as a layer. Used only when PlugType is set to “geodatabase”.
AttributesToLoad – A comma delimited list of attribute field names to be read from the layer (e.g., “STNAME, STTYPE”).
Feature – Use 1 to create features, 0 to hide features.
Annotation – Use 1 to create annotations, 0 to hide annotations.
SaveItems – Use 1 to save the layer objects in the FLY file, 0 to not save layer objects.
GroupKey – Defines the layer projection group.
SysKey – Defines the layer projection system.
DatumKey – Defines the layer projection datum.
UnitKey – Defines the layer projection units.
UseZValue – Use 1 to use the Geometry Z value, 0 to ignore.
AltitudeUnit – Defines the layer Z units. The tag should include one of the following values:
“Meters” – Meters
“Feet” – Feet
“Centimeters” – Centimeters
“Decimeters” – Decimeters
“Inches” – Inches
“Yards” – Yards
Reproject – Use 1 to reproject the source, 0 to leave as is.
StreamedLayer – Use 1 to stream the layer, 0 to read the layer entirely.
An existing layer can be manipulated and controlled using the ILayer5 interface. This includes controlling appearance of the feature and annotation information, managing the streaming behavior, and adding and removing individual items.