作者:MR.
SuperMap iServer 8C(2017),即iServer 8.1.0版本新增了很多服务接口类型,比如:ArcGISREST、BaiduREST、GoogleREST、OSMREST、TMSREST。
这里就相对使用较多的BaiduREST接口的使用做下相关介绍。
###一、服务发布方式
iServer管理页面快速发布:
选择需要的服务类型:
**注意:**该服务类型首先需要SuperMap iServer分发服务许可模块,其次需要数据来源支持该服务类型。
另外:BaiduREST接口只支持墨卡托投影(EPSG Code:3857或相近投影)
已有服务添加支持该服务接口,在服务组件配置:
或者:
###二、BaiduREST服务接口使用说明
支持的操作及参数如下表:
百度资源 | iServer资源 | URL | 支持参数 | 不支持的参数 |
---|---|---|---|---|
- | maps | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest | - | - |
- | map | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest/China | - | - |
静态图 | staticimage | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest/China/staticimage/v2 | width, height, center, zoom, scale, bbox | ak, mcode, copyright, markers, markerStyles, labels, labelStyles, paths, pathStyle |
瓦片地图 | tile | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest/China/tile | qt, x, y, z, scaler | styles, udt, p |
Place | place | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest/China/place/v2/search | query(q), scope, coord_type, page_size, output, bounds(bds), location, radius® | tag, filter, page_num, ak, sn, timestamp, region, city_limit |
Place Suggestion | suggestion | http://192.168.17.22:9999/iserver/services/map-arcgis-China400/baidurest/China/place/v2/suggestion | query(q), location, output | region, ak, sn, timestamp |
另:googleREST服务接口支持的操作和参数
注:{output}取值为json或xml
###三、BaiduREST服务接口使用示例
以iServer自带的map-chian400为例,添加BaiduREST服务接口后,可以找到该REST资源的地图列表及地图描述信息:
接下来以获取瓦片为例,验证该服务的可用性:
服务地址 | 操作 | 参数 | 结果 |
---|---|---|---|
http://192.168.15.90:8090/iserver/services/map-china400/baidurest/China/tile | GET | qt=tile&x=10000&y=10000&z=10&scaler=1 | 256x256(像素)瓦片 |
http://192.168.15.90:8090/iserver/services/map-china400/baidurest/China/tile | GET | qt=tile&x=10000&y=10000&z=10&scaler=2 | 512x512(像素)瓦片 |
我们可以自己按照瓦片行列号、比例尺级别将瓦片拼接成一张地图,比如扩展一个图层,使之可以在SuperMap iClient for JavaScript上显示。不过既然是BaiduREST服务,那么自然可以在BaiduSDK里使用,可以参考Baidu Android SDk帮助文档:
http://lbsyun.baidu.com/index.php?title=androidsdk/guide/basicmap#.E7.93.A6.E7.89.87.E5.9B.BE.E5.B1.82