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
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
<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.
Popularity: 2% [?]




No user commented in " Use Yahoo Maps Geocoder webservice with coldfusion pt. 1 "
Follow-up comment rss or Leave a TrackbackLeave A Reply