mark 百度地图Api
参考文档 http://developer.baidu.com/map/index.php?title=webapi/guide/webservice-geocoding
你去申请成为开发者,红色的替换成你自己key
http://api.map.baidu.com/geocoder/v2/?ak=hAaa2NLELKdAIfMhMjnuEgi1&output=json&location=39.91064,116.39925
做个简单的例子,如下
dim 纬度 as double = 39.91064
dim 经度 as double = 116.39925
Dim rqst As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://api.map.baidu.com/geocoder/v2/?ak=hAaa2NLELKdAIfMhMjnuEgi1&output=json&location=" & 纬度 & "," & 经度)
Dim rsps As System.Net.HttpWebResponse = rqst.GetResponse
Dim stm As System.IO.Stream = rsps.GetResponseStream()
Dim reader As New System.IO.StreamReader(stm)
Dim json As String = reader.ReadToEnd
msgbox(json)
Dim ScriptControl As Object, data As Object, JscriptCode As String
JscriptCode = "function toObject(json) {eval(""var o=""+json);return o;}"
ScriptControl = CreateObject("MSScriptControl.ScriptControl")
With ScriptControl
.Language = "Javascript"
.Timeout = -1
.AddCode(JscriptCode)
data = .Run("toObject", json)
End With
msgbox(data.status)
msgbox(data.result.formatted_address)