URI
<mapService_uri>/{layerID} [.<format>]
支持的方法
父资源
子资源
介绍
图层资源表示地图服务的地图中的单个图层/表。它提供有关图层/表的基本信息,例如其名称,类型和字段等。
(注:ArcGIS REST 地图服务通过 iServer 再次发布为 ArcGIS REST 地图服务后,不支持此资源。)
支持的方法:
资源层次
HTTP 请求方法
对如下 URI 执行 HTTP 请求,其中,supermapiserver 是服务器名,{layerID} 是图层号,{component}是服务组件名,{mapName}是地图名。
http://supermapiserver:8090/iserver/services/{component}/arcgisrest/{mapName}/MapServer/{layerID}
GET 请求
获取图层的基本信息
名称 | 类型 | 含义 |
f |
String | 响应格式,支持 json、pjson |
响应结构
对 layer 资源执行 GET 请求返回的是图层的基本信息。
字段 | 类型 | 说明 |
extent | ArcGISMapExtend | 图层的范围 |
supportsStatistics | boolean | 是否支持统计信息 |
capabilities | String | 支持的功能,以逗号分隔,如 Map,Query,Data |
maxScale | double | 地图的最大显示比例尺。该值为0时,表示没有比例尺显示限制。 |
maxRecordCount | int | 最大记录数 |
supportsAdvancedQueries | boolean | 是否支持高级查询 |
parentLayer | LayerSummary | 父图层ID |
defaultVisibility | boolean | 默认是否可见。 |
subLayers | LayerSummary | 子图层 ID |
type |
String |
查询的类型,可为 Layer、Table |
currentVersion | String | 当前版本 |
supportedQueryFormats | String | 支持的查询输出格式,如 JSON,RJSON |
name | String | 当前地图的名称。 |
id | int | 图层 ID |
minScale | double | 地图的最小显示比例尺。该值为0时,表示没有比例尺显示限制。 |
fields |
ArcGISFieldInfo[] |
字段信息 |
objectIdField |
String |
ObjectID字段名 |
geometryType |
ArcGISGeometryType |
ArcGISGeometryType |
allowGeometryUpdates |
boolean |
要素是否可编辑 |
advancedQueryCapabilities |
AdvancedQueryCapabilities |
高级查询能力。包含supportsStatistics,supportsReturningQueryExtent,supportsOrderBy, supportsQueryWithDistance,supportsPagination |
drawingInfo |
ArcGISDrawingInfo |
绘画信息
注:iServer当前仅支持返回普通矢量图层(点、线、面)、面单值专题图和点、面标签专题图的绘图信息 |
响应示例
对 ArcGIS layer 资源:http://localhost:8090/iserver/services/map-BeijingAddress/arcgisrest/county_R/MapServer/3 执行 GET 请求,返回 pjson 格式的资源表述如下:
{
"extent": {
"ymin": 4810440.45035733,
"xmin": 1.290897502682726E7,
"ymax": 4919039.794963364,
"xmax": 1.303677253460951E7,
"spatialReference": {
"latestWKID": 3857,
"wkid": 3857
}
},
"supportsStatistics": false,
"capabilities": "Map,Query,Data",
"maxScale": 0,
"maxRecordCount": 2000,
"supportsAdvancedQueries": true,
"parentLayer": {
"name": "county_R",
"id": 0
},
"defaultVisibility": true,
"subLayers": [],
"type": "Feature Layer",
"currentVersion": "10.2",
"supportedQueryFormats": "JSON",
"name": "company@BeijingAddress",
"drawingInfo": {
"renderer": {
"symbol": {
"outline": {
"color": [
0,
128,
0,
255
],
"width": 0.1
},
"color": [
208,
255,
240,
255
],
"size": 4,
"yoffset": 0,
"xoffset": 0,
"angle": 0,
"style": "esriSMSCircle",
"type": "esriSMS"
},
"description": "",
"label": "",
"type": "simple"
},
"scaleSymbols": true,
"transparency": 0,
"labelingInfo": null
},
"id": 3,
"minScale": 0,
"fields": [
{
"nullable": false,
"editable": false,
"name": "SmID",
"alias": "SmID",
"type": "esriFieldTypeOID"
},
{
"nullable": false,
"editable": false,
"name": "SmX",
"alias": "SmX",
"type": "esriFieldTypeDouble"
},
{
"nullable": false,
"editable": false,
"name": "SmY",
"alias": "SmY",
"type": "esriFieldTypeDouble"
},
{
"nullable": false,
"editable": false,
"name": "SmLibTileID",
"alias": "SmLibTileID",
"type": "esriFieldTypeInteger"
},
{
"nullable": false,
"editable": false,
"name": "SmUserID",
"alias": "SmUserID",
"type": "esriFieldTypeInteger"
},
{
"nullable": false,
"editable": false,
"name": "SmGeometrySize",
"alias": "SmGeometrySize",
"type": "esriFieldTypeInteger"
},
{
"nullable": false,
"editable": false,
"name": "SmGeoPosition",
"alias": "SmGeoPosition",
"type": "esriFieldTypeInteger"
},
{
"nullable": false,
"editable": false,
"name": "ID",
"alias": "ID",
"type": "esriFieldTypeDouble"
},
{
"nullable": false,
"editable": false,
"name": "序号",
"alias": "序号",
"type": "esriFieldTypeDouble"
},
{
"nullable": false,
"editable": false,
"name": "法人代码",
"alias": "法人代码",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "园区名称",
"alias": "园区名称",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "一级分类",
"alias": "一级分类",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "二级分类",
"alias": "二级分类",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "区县",
"alias": "区县",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "名称",
"alias": "名称",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "地址",
"alias": "地址",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "城市",
"alias": "城市",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "city",
"alias": "city",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "county",
"alias": "county",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "ADDRESS",
"alias": "ADDRESS",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "NAME",
"alias": "NAME",
"type": "esriFieldTypeString"
},
{
"nullable": false,
"editable": false,
"name": "Shape",
"alias": "Shape",
"type": "esriFieldTypeGeometry"
}
],
"geometryType": "esriGeometryPoint",
"advancedQueryCapabilities": {
"supportsStatistics": true,
"supportsReturningQueryExtent": true,
"supportsOrderBy": true,
"supportsQueryWithDistance": true,
"supportsPagination": true
}
}
HEAD 请求
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 layer 资源是否存在,或者客户端是否有权限访问 layer 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 layer 资源是否支持<format>格式的表述。
请参见