Gazing into my crystal ball I observed tamaker <
[email protected]>
writing in (e-mail address removed):
Anyone have an example or knowledge of a .ASP tutorial that will show
me how to take the CSV response from googles geocoding service and use
the lat and long values individually? (i.e. var1= that lattitude and
var 2 = the longitude?)
Thanks
It comes in as an XML response that you can put into an array and get the
values from the array.
Dim objXMLHTTP, xml
Dim myaddress, mycity, mystate_abbr, mygeokey
Dim longitude, latitude
Dim
' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
' Opens the connection to the remote server.
xml.Open "GET", "
http://maps.google.com/maps/geo?q=" & server.urlencode
(myaddress) & ",+" & server.urlencode(mycity) & ",+" & server.urlencode
(mystate_abbr) & "&output=csv&sensor=false&key=" & mygeokey, False
' Actually Sends the request and returns the data:
xml.Send
'Display the HTML both as HTML and as text
Response.Write "<h1>The HTML text</h1><xmp>"
Response.Write xml.responseText & "<br />"
geoarr = split(xml.responseText,",")
latitude = geoarr(2)
longitude = geoarr(3)
response.write "latitude: " & geoarr(2) & " longitude: " & geoarr(3)
Response.Write "</xmp><p><hr><p><h1>The HTML Output</h1>"
Response.Write xml.responseText
Set xml = Nothing