我知道我可以通过用纬度和经度替换[A]和[B]来获取从该URL返回地理信息的XML文件 .
http://maps.googleapis.com/maps/api/geocode/xml?latlng=[A],[B]&sensor=true
现在我想知道的是如何从我的.xqy文件中调用此URL,并简单地获取XML文件中的地址和城镇属性的值 . 任何的想法 ?
尝试使用带有反向地理编码的地理编码服务API .
https://developers.google.com/maps/documentation/javascript/geocoding#ReverseGeocoding
您可以使用expath HTTP客户端来查询此API:
import module namespace http = "http://expath.org/ns/http-client"; http:send-request(<http:request method="get" href="http://maps.googleapis.com/maps/api/geocode/xml?latlng=[A],[B]&sensor=true" />)
你可以试试这个例子http://www.zorba-xquery.com/html/demo#SYTRRzV6oopDKuEs3hxUdj4lUts=
2 回答
尝试使用带有反向地理编码的地理编码服务API .
https://developers.google.com/maps/documentation/javascript/geocoding#ReverseGeocoding
您可以使用expath HTTP客户端来查询此API:
你可以试试这个例子http://www.zorba-xquery.com/html/demo#SYTRRzV6oopDKuEs3hxUdj4lUts=