Provides access to members that allow interaction with an existing XY Event Layer.
| Description | ||
|---|---|---|
![]() |
EventProperties | Property object used to define the X, Y and Z location fields. |
![]() |
EventTable | Table used to initialize the XYEventSource. |
![]() |
RefreshExtent | Resets the extent of the XYEventSource layer. |
| CoClasses and Classes | Description |
|---|---|
| XYEventSource | XY event source object. |
The IXYEventSource Interface provides information about an existing XYEventSource. It provides access to the table and the names of the fields in the table that were used to define the XYEventSource.
An XYEventSource is a dynamic point feature class which generates features based on X and Y coordinates in a table.
The following code shows how to create a new XYEventSource from an XYEventSourceName.
Dim pXYEvent2FieldsProperties As IXYEvent2FieldsProperties
Set pXYEvent2FieldsProperties = New XYEvent2FieldsProperties
With pXYEvent2FieldsProperties
.XFieldName = "longitude"
.YFieldName = "latitude"
.ZFieldName = ""
End With
Dim pSpatialReferenceFactory As ISpatialReferenceFactory
Dim pProjectedCoordinateSystem As IProjectedCoordinateSystem
Set pSpatialReferenceFactory = New SpatialReferenceEnvironment
Set pProjectedCoordinateSystem = pSpatialReferenceFactory._
CreateProjectedCoordinateSystem (esriSRProjCS_NAD1983UTM_11N)
Dim pXYEventSourceName As IXYEventSourceName
Set pXYEventSourceName = New XYEventSourceName
With pXYEventSourceName
Set .EventProperties = pXYEvent2FieldsProperties
Set .SpatialReference = pProjectedCoordinateSystem
Set .EventTableName = pTableName
End With
Dim pname As IName
Dim pXYEventSource As IXYEventSource
Set pname = pXYEventSourceName
Set pXYEventSource = pname.Open
IXYEvent2FieldsProperties Interface