English

Bug: Geocoding in pre-9.0 HTML Viewer does not work with ArcIMS 9.0

Description

When using a pre-9.0 HTML Viewer with ArcIMS 9.0, selecting the Locate Address button will freeze the browser and the addmatch.htm file will not be loaded for inputting address elements. The browser application remains unresponsive and must be closed.

Cause

This problem is related to how the SERVICEINFO response that contains geocoding information is parsed by the HTML Viewer. For example, using ArcIMS 4.0.1, the following GCINPUT tag and attributes are returned:

<GCINPUT id="STREET" type="text" label="Street" width="10" description="street number, street name and type" />

In ArcIMS 9.0, the same information is returned as:

<GCINPUT id="STREET" description="street number, street name and type" label="Street" type="text" width="10" />

The HTML Viewer was created to parse GCINPUT attribute values and populate the addmatch.htm document. The order of these attributes is important to the HTML Viewer.

Workaround

To fix this problem in a pre-9.0 HTML Viewer:

  1. Open the aimsGeocode.js file in a text editor and navigate to the parseGeocodeParams() function.
  2. Switch the following lines:

    Code:
    startpos = theReply.indexOf("description=",endpos);
    startpos += 13;

    -with-

    Code:
    startpos = theReply.indexOf("label=",endpos);
    startpos = startpos + 7;


    The block of code that contains these lines should appear as follows:

    Code:
    ...
    startpos += 13;
    endpos = theReply.indexOf(dQuote,startpos);
    GCid[GCidCount] = theReply.substring(startpos,endpos);
    startpos = theReply.indexOf("description=",endpos);
    startpos += 13;
    endpos = theReply.indexOf(dQuote,startpos);
    GClabel[GCidCount] = theReply.substring(startpos,endpos);
    startpos = theReply.indexOf("label=",endpos);
    startpos = startpos + 7;
    endpos = theReply.indexOf(dQuote,startpos);
    GCdesc[GCidCount] = theReply.substring(startpos,endpos);
    GCidCount=GCidCount+1;
    ...