首页 / 浏览问题 / 云GIS / 问题详情
如何根据经纬度获取位置
13EXP 2019年01月03日
使用产品:iserver9.1.0 操作系统:win10 x64
数据类型: 文件型
问题详细描述:需要根据经纬度获取地理位置,比如:“北京市”、“天津市”。超图有提供方法吗

2 个回答

我用的是这样的一个方法

步骤一:先用在地图上获取到的坐标通过api转换成百度坐标(以下是转换api)

 var urlzuobiao = "http://www.supermapol.com/iserver/services/coordconvert/rest/coordinate/convert.json?points=[{x:"+lonlat.lon+",y:"+lonlat.lat+"}]&from=910113&to=910102&key=你的key"

可以参考:

https://www.supermapol.com/developer/webapi.html#convert

步骤二:用获取到的百度坐标用百度地图api生成了数据

String urlurl = "http://api.map.baidu.com/geocoder/v2/?ak=你的ak&callback=renderReverse&location=36.00821118020924,104.2681987359927&output=json&pois=1"; 
 

获取到的数据是这样子的(如图)

23EXP 2019年01月03日
我也打算用这个,可惜json不能跨域,还得自己搭个代理

就是因为跨域的问题我也卡了好久,解决方法看

https://blog.csdn.net/weixin_44268320/article/details/85719096

有可以现在iserver发布地址匹配服务 

然后用接口: 

var addressUrl = "http://support.supermap.com.cn:8090/iserver/services/addressmatch-Address/restjsr/v1/address",

addressMatchService = new ol.supermap.AddressMatchService(addressUrl);

附上示例地址

http://iclient.supermapol.com/examples/openlayers/editor.html#addressMatchService

3,352EXP 2019年01月03日
这个方法对我来说有些麻烦了,不过还是谢谢了
...