Platform: Not Platform Related
Category: API Functions
Retrieving candidate Zip+4 information via MapMarker API.
The OLE/OCX/VBScript methods for retrieving a ZIP+4 value from a candidate address all look something like this:
ZipPlus4Value = GetCandidatePlusForAt(Index)
But, the MapMarker API doesn't have a similar method. How can this information be retrieved?
The extended ZIP code information is returned in the CandidateAddress structure, as one of the four components of the "lastLine" delimited string. The simplest way to separate the four components is to call GeoEngParseLastLine on the lastLine structure, and then access the four properties of the lastLine variable that was passed into the function by reference.
Lines that must be added to the VB API sample code shown in this document ->:
Dim parsedLastLine As lastLine
Dim FinishPlus4 As String
' after 'FinishZip = ...'
rs = GeoEngParseLastLine(hEngine, CandidateAddress.lastLine, parsedLastLine)
FinishPlus4 = parsedLastLine.postalAddOnCode
' print FinishPlus4 somewhere to see the result:
CompleteAddress = Finishstreet & " " & Finishcity & " " & FinishState & " " & FinishZip _
& " " & addrPoint.xCoord & " " & addrPoint.yCoord & " " & strPrec & " " & FinishPlus4