GeoCoderCommand

Land Desktop Map 3D Samples

 
GeoCoderCommand
 
 
 

The GeoCoder command activates the GeoCoderCommand entry point method of the Commands class. GeoCoderCommand does the following:

  1. Create a PromptStringOptions object and pass it to the AcadEditor.GetString API method. This will prompt the user to type in a street address, with a default address if the user does not give an input value.
  2. Use the PromptResult.StringResult.Split API method to split the input at each comma into four parts (street, city, state, zip code).
  3. Create a GeoCoder object and call its RequestGeoCode method. This method first creates a string containing the link to the web service, the web service command being called, and the parameters making up the address. The string is passed to the constructer of a XmlTextReader object. The XmlTextReader object is then used to parse the return information from the web service. The latitude and longitude values are extracted, converted from strings to floats, and returned.
  4. Uses the PrintLn utility function to print the latitude and longitude values to the command line.