I ran into the issue when querying this service, and hit the whole “Connection Failure” Problem, this confused me, and after about an hour of my own trouble shooting i hit the search engines and found that there is some known issue with formating…. you must include charset=”utf-8″ in the tag… there are a number of links out there on this issue… The big task was for starters, just getting the information out of what was being returned to the page. It seemed simple to tear apart yahoo’s xml that was returning, but for some reason it took me a couple of hours after the connection failure issues.


What needs to happen:
=========================
1. Get a list of States to query 2. Query the Yahoo service 3. Write the XML File 4. Work with flex in importing that xml into a tree

Sound simple enough?

In this *Pt. 1* section of the yahoo maps geocoder, i’m going to go through how to simply query and put the data into variables, and DUMP them….

First, at the top of the page declare your tag

<cfhttp
url=http://api.local.yahoo.com/MapsService/V1/geocode
method=“post”
throwonerror=“yes”
charset=“utf-8”
>

<cfhttpparam
type=“url” name=“appid”
value=“MapToolsV1” />
<cfhttpparam
type=“url” name=“state”
value=“IA” />

</cfhttp>

Next, create your variables, notice you have to Parse the xml from the cfhttp.filecontent

<cfset xmlObject =
XmlParse(cfhttp.FileContent)>
<cfset Lat =
xmlObject.XMLRoot.XmlChildren[1].XmlChildren[1]>

<cfset Lng =
xmlObject.XMLRoot.XmlChildren[1].XmlChildren[2]>

<cfset State =
xmlObject.XMLRoot.XmlChildren[1].XmlChildren[5]>

Now, just dump the variables

<cfoutput>
#Lat#<br />
#Lng#<br />
#State#<br />
</cfoutput>

i’ll continue on this at a later date with example files… it requires quite a bit more complexity as we move through this.