tile接口

URL:

http:// <MapServer-URL> / <tileSets>

父资源:

MapServer

[ 服务说明 ]

tile接口规定了MapServer瓦片资源的请求方式,调用tile接口时,根据请求参数的不同,服务器端会返回tile的capability信息或地图瓦片。

[ 参数说明 ]

参数 参数说明
format 参数作用:当需要获取tile的capabilities信息时,该参数用于指定capability信息的返回格式
取值范围:html | xml,该参数默认值为html
参数说明:请求瓦片的capabilities信息时请求地址中只可设置format参数,不能包含z,x,y参数。
z 参数作用:指定请求瓦片的级别
参数说明:请求地图瓦片时,请求地址中至少应包含z,x,y三个参数
计算方式:根据Capabilities信息中标签的href属性进行设置
x 参数作用:指定请求瓦片的横向坐标值
参数说明:请求地图瓦片时,请求地址中至少应包含z,x,y三个参数
计算方式:x = floor((XCoords - XOrigin)/(resolution * tileWidth));
        XCoords为地图瓦片中心点所对应的X方向地理坐标
        XOrigin为Capabilities信息中<Origin>标签的x属性所代表的切片起算点X坐标
        resolution为所请求瓦片所对应的地图分辨率
        tileWidth为Capabilities信息中<TileFormat>标签的width属性所代表的切片像素宽度
y 参数作用:指定请求瓦片的纵向坐标值
参数说明:请求地图瓦片时,请求地址中至少应包含z,x,y三个参数
计算方式:y = floor((YCoords - YOrigin)/(resolution * tileHeight));
        YCoords为地图瓦片中心点所对应的Y方向地理坐标
        YOrigin为Capabilities信息中<Origin>标签的y属性所代表的切片起算点Y坐标
        resolution为所请求瓦片所对应的地图分辨率
        tileHeight为Capabilities信息中<TileFormat>标签的height属性所代表的切片像素高度

[ 示例 ]

获取Capabilitiy信息的URL地址示例:
http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?format=xml
获取地图瓦片的URL地址示例:
http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?z=0&x=4&y=1

[ 返回结果 ]

    XML格式的Capability信息示例 :

<TileMap version="1.0.0" tilemapservice="http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile"> <TMSRequestUri> http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile </TMSRequestUri> <SRS>EPSG:4326</SRS> <BoundingBox minx="47" miny="-6" maxx="163" maxy="72"/> <Origin x="-180" y="90"/> <TileFormat width="256" height="256" mime-type="image/png" extension="png"/> <TileSets profile="global-geodetic"> <TileSet href="http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?z=3" units-per-pixel="0.087890625" order="0"/> <TileSet href="http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?z=4" units-per-pixel="0.0439453125" order="1"/> <TileSet href="http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?z=5" units-per-pixel="0.02197265625" order="2"/> <TileSet href="http://127.0.0.1:8099/newmap/rest/services/samples/chinatile2/MapServer/tile?z=6" units-per-pixel="0.010986328125" order="3"/> </TileSets> </TileMap>

    地图瓦片 :