![]() ![]() |
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer | |
GetAddressFields Method | |
See Also Example Send Feedback |
ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer Namespace > GeocodeFunctionality Class : GetAddressFields Method |
Visual Basic (Declaration) | |
---|---|
Public Function GetAddressFields() As List(Of Field) |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As GeocodeFunctionality Dim value As List(Of Field) value = instance.GetAddressFields() |
C# | |
---|---|
public List<Field> GetAddressFields() |
This example prints out several properties of each address field in the geocoding service.
C# | ![]() |
---|---|
private void DisplayAddressFields( ESRI.ArcGIS.ADF.Web.UI.WebControls.GeocodeResourceManager resourceManager, System.Web.UI.WebControls.Label lblControl) { ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeResource geoRes = resourceManager.GetResource(0); if (!geoRes.Initialized) geoRes.Initialize(); ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality geoFunct = (ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality) geoRes.CreateFunctionality( typeof(ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality), "geoFunct"); if (!geoFunct.Initialized) geoFunct.Initialize(); System.Text.StringBuilder sb = new System.Text.StringBuilder( "Fields:"); List<ESRI.ArcGIS.ADF.Web.Geocode.Field> flds = geoFunct.GetAddressFields(); foreach (ESRI.ArcGIS.ADF.Web.Geocode.Field field in flds) { sb.AppendFormat("<br/>Name: {0}, type: {1}, required: {2}", field.Name, field.Type, field.Required); } lblControl.Text = sb.ToString(); } |
Visual Basic | ![]() |
---|---|
Private Sub DisplayAddressFields(ByVal resourceManager As _ ESRI.ArcGIS.ADF.Web.UI.WebControls.GeocodeResourceManager, _ ByVal lblControl As System.Web.UI.WebControls.Label Dim geoRes As ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeResource = _ resourceManager.GetResource(0) If Not geoRes.Initialized Then geoRes.Initialize() End If ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality geoFunct = _ CType(geoRes.CreateFunctionality( _ GetType(ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality), "geoFunct"), _ ESRI.ArcGIS.ADF.Web.DataSources.IGeocodeFunctionality) If Not geoFunct.Initialized Then geoFunct.Initialize() End If Dim sb As New System.Text.StringBuilder("Fields:") Dim flds As List(Of ESRI.ArcGIS.ADF.Web.Geocode.Field) = geoFunct.GetAddressFields() Dim field As ESRI.ArcGIS.ADF.Web.Geocode.Field For Each field In flds sb.AppendFormat("<br/>Name: {0}, type: {1}, required: {2}", field.Name, _ field.Type, field.Required) Next lblControl.Text = sb.ToString() End Function |
Each item in the returned list is a Field that has the field name, data type, whether required, etc. This information guides the information that should be provided when performing geocoding with GeocodeAddress or FindAddressCandidates. For each field (or at least required fields), an AddressValue object should be created and added to the list to pass to the geocoding method. The Field's Name may be used as the AddressValue's FieldID.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
Reference
GeocodeFunctionality ClassGeocodeFunctionality Members
T:ESRI.ArcGIS.ADF.Web.Geocode.Field