地图服务

描述

地图服务可提供对托管在服务器上的地图内容的访问。地图服务可以公开不同级别的功能。当地图服务托管在 GeoScene OnlineGeoScene Portal 上时,它将公开一组切片影像,客户端将使用这些影像进行快速地图导航。当地图服务托管在 GeoScene Server 站点上时,它将公开其他功能,如动态绘图、查询和搜索。借助 GeoScene Server,可通过允许网络分析、矢量要素编辑等的地图服务根 URL 获取更多的 web 服务。

REST API 地图服务资源仅与已发布地图文档的默认数据框架一起工作。该资源可提供关于地图的基本信息,包括地图所包含的图层、地图是否被缓存、其空间参考、初始和完整范围、地图单位和版权文本。它还提供了一些与服务相关的元数据,如服务描述、作者和关键字。如果缓存了地图,则会包含关于其切片方案的其他信息,例如缓存切片的原点、详细级别和切片大小。

地图服务不会公开编辑功能。它们提供对要素和属性内容的只读访问。

GeoScene OnlineGeoScene Portal 托管的地图服务

GeoScene OnlineGeoScene Portal 托管的地图服务只能从服务器的缓存返回切片;它们不能动态地绘制图像,也不允许查询地图背后的各个要素。使用要素服务和地图服务,您可以在应用程序中支持查询和信息弹出窗口。

因此,本部分文档中提到的一些资源、操作和属性不适用于 GeoScene OnlineGeoScene Portal 托管的地图服务。

GeoScene Server 托管的地图服务

GeoScene Server 托管的地图服务支持以下一系列操作:

3.0 中的新增功能

2.1 中的新特性

2.0 中的新增功能

1.7.1 中的新特性

1.7 中的新增功能

1.6.1 中的新增内容

1.5 中的新增功能

1.4 中的新增内容

1.3 中的新增内容

1.2 中的新增内容

1.1 SP1 中的新增内容

1.1 中的新增内容

1.0 SP1 中的新增内容

1.0 中的新增内容

请求参数

参数

详细信息

returnUpdates

如果为 true,则此资源将返回更新的时间范围。如果服务不是时间感知型的,则资源将返回一个空响应。

值:true | false

option
旧版本旧版本:

GeoScene Enterprise 4.1 中,已移除了对足迹的支持,并且该参数的 footprints 值已被弃用。

如果 optionfootprints,则地图服务的覆盖区将作为要素集合返回。此要素集合可以在 GeoScene Online 中查看。仅当响应格式为 json 时,才支持此选项。

值:footprints

outSR
旧版本旧版本:

GeoScene Enterprise 4.1 不再支持足迹。

在覆盖范围中返回的几何的空间参考。仅当将 option 指定为 footprints 时,才支持此参数。应将空间参考指定为一个 WKID。如果未指定 outSR,则几何将使用 GCS_WGS_1984 返回。

f

响应格式。默认响应格式为 html

值:html | json | kmz | lyr | nmf | jsapi | ve | gmaps

用法示例

以下是 StateCityHighway_USA 地图服务的示例请求 URL:

https://sampleserver1.geosceneonline.cn/geoscene/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer

JSON 响应语法

示例一

{
  "currentVersion": <currentVersion>, 
  "serviceDescription": "<serviceDescription>",
  "mapName": "<mapName>"
  "description": "<description>",
  "copyrightText": "<copyrightText>",
  "supportsDynamicLayers": <true|false>, 
  "layers": [ //the spatial layers published by this service
    {
      "id": <layerId1>, 
      "name": "<layerName1>", 
      "defaultVisibility": <true|false>, 
      "parentLayerId": <parentLayerId1>,
      "subLayerIds": [<subLayerId11>, <subLayerId12>]
      "minScale": <minScale1>, 
      "maxScale": <maxScale1>
    },
    {
      "id": <layerId2>, 
      "name": "<layerName2>", 
      "defaultVisibility": <true|false>, 
      "parentLayerId": <parentLayerId2>,
      "subLayerIds": [<subLayerId21>, <subLayerId22>]
      "minScale": <minScale1>,
      "maxScale": <maxScale1>
    }
  ],
  "tables": [ //the tables published by this service - from 10 onward
    {
      "id": <tableId1>, 
      "name": "<tableName1>"
    },
    {
      "id": <tableId2>, 
      "name": "<tableName2>"
    }
  ],
  "spatialReference": {<spatialReference>},
  "singleFusedMapCache": <true | false>,
  "tileInfo": {
    "rows": <rows>,
    "cols": <cols>,
    "dpi": <dpi>,
    "format": <format>,
    "compressionQuality": <quality>,
    "origin": {<point>},
    "spatialReference": {<spatialReference>},
    "lods": [
      {
        "level": <level1>,
        "resolution": <resolution1>,
        "scale": <scale1>
      },
      {
        "level": <level2>,
        "resolution": <resolution2>,
        "scale": <scale2>
      }
    ]
  },
  "initialExtent": {<envelope>},
  "fullExtent": {<envelope>},
  "timeInfo": {  //from 10 onward - if the map supports querying and exporting maps based on time
    "timeExtent": [<startTime>, <endTime>],
    "timeReference": {
      "timeZone": "<timeZone>",
      "respectsDaylightSaving": <true | false>
    },
    "timeRelation": "<esriTimeRelationOverlaps | esriTimeRelationOverlapsStartWithinEnd | esriTimeRelationAfterStartOverlapsEnd>",
    "defaultTimeInterval": <time interval>,
    "defaultTimeIntervalUnits": "<esriTimeUnitsCenturies | esriTimeUnitsDays | esriTimeUnitsDecades |
                             esriTimeUnitsHours | esriTimeUnitsMilliseconds | esriTimeUnitsMinutes |
                             esriTimeUnitsMonths | esriTimeUnitsSeconds | esriTimeUnitsWeeks | esriTimeUnitsYears |
                             esriTimeUnitsUnknown>",
    "defaultTimeInterval": <time interval>,
    "defaultTimeWindow": <time window>,
    "hasLiveData": <true | false>,
    "liveModeOffsetDirection": "<pastAndFuture | past | future>"
  },
  "units": "<units>",
  "supportedImageFormatTypes": "<supportedImageFormatTypes>",
  "documentInfo": {
    "<key1>": "<value1>",
    "<key2>": "<value2>"
  },
  "capabilities": "<capabilities>",  //comma separated list of supported capabilities - e.g. "Map,Query,Data"
  "maxRecordCount": <maxRecordCount>, 
  "maxImageHeight": <maxImageHeight>, 
  "maxImageWidth": <maxImageWidth>, 
  "minScale": <minimum map scale>, 
  "maxScale": <maximum map scale>, 
  "tileServers": ["<tileServerUrl1>","<tileServerUrl2>","<tileServerUrl2>"], 
  "supportedQueryFormats": "<query output formats>",
  "exportTilesAllowed": <true | false>,
  "maxExportTilesCount: <export tiles limit>,
  "supportedExtensions": "<FeatureServer,KmlServer,MobileServer,WCSServer,WFSServer,WMSServer,NAServer,SchematicsServer>",
  "resampling": <true | false> // Added at 10.3
}

示例二

以下示例演示了从服务请求更新信息时的响应:

{
  "timeExtent": [
    <startTime>, 
    <endTime>
  ],
  "fullExtent": {
    "xmin": <xmin>,
    "ymin": <ymin>,
    "xmax": <xmax>,
    "ymax": <ymax>,
    "spatialReference": <spatialReference>
  }
}

示例三

以下示例演示了请求服务的覆盖区时的响应:

{
  {
    "featureCollection": {
      "layers": [
        {
          "layerDefinition": {
            "type": "Feature Layer",
            "geometryType": "esriGeometryPoint",
            "extent": {
              <envelope>
            },
            "objectIdField": "id",
            "displayFieldName": "<displayFieldName>",
            "drawingInfo": {
              "renderer": {
                "type": "simple",
                "label": "<label>",
                "description": "",
                "symbol": {
                  "height": 24,
                  "xoffset": 0,
                  "yoffset": 0,
                  "width": 24,
                  "contentType": "image/png",
                  "type": "esriPMS",
                  "imageData": "<imageData>",
                  "url": "<imageUrl>"
                }
              }
            },
            "fields": [
              {
                "name": "id",
                "alias": "ID",
                "type": "esriFieldTypeOID"
              },
              {
                "name": "title",
                "alias": "Title",
                "type": "esriFieldTypeString"
              },
              {
                "name": "summary",
                "alias": "Summary",
                "type": "esriFieldTypeString"
              },
              {
                "name": "description",
                "alias": "Description",
                "type": "esriFieldTypeString"
              },
              {
                "name": "tags",
                "alias": "Tags",
                "type": "esriFieldTypeString"
              },
              {
                "name": "type",
                "alias": "Type",
                "type": "esriFieldTypeString"
              },
              {
                "name": "thumbnail",
                "alias": "Thumbnail",
                "type": "esriFieldTypeString"
              },
              {
                "name": "xmin",
                "alias": "xmin",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "ymin",
                "alias": "ymin",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "xmax",
                "alias": "xmax",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "ymax",
                "alias": "ymax",
                "type": "esriFieldTypeDouble"
              },
              {
                "name": "accessInformation",
                "alias": "Access Information",
                "type": "esriFieldTypeString"
              },
              {
                "name": "licenseInfo",
                "alias": "License Information",
                "type": "esriFieldTypeString"
              },
              {
                "name": "credits",
                "alias": "Credits",
                "type": "esriFieldTypeString"
              },
              {
                "name": "link",
                "alias": "Link",
                "type": "esriFieldTypeString"
              }
            ]
          },
          "featureSet": {
            "geometryType": "esriGeometryPoint",
            "spatialReference": {
              "wkid": <wkid>
            },
            "features": [
              {
                "geometry": {
                  <point>
                },
                "attributes": {
                  "id": 1,
                  "title": "<title>",
                  "summary": "<summary>",
                  "description": "<description>",
                  "tags": "[\"<tag1>\,\"<tag2>\"]",
                  "type": "MapServer",
                  "thumbnail": "<thumbnailUrl>",
                  "xmin": <xmin>,
                  "ymin": <ymin>,
                  "xmax": <xmax>,
                  "ymax": <ymax>,
                  "accessInformation": "<accessInformation>",
                  "licenseInfo": "<licenseInfo>",
                  "credits": "<credits>",
                  "link": "<serviceResourceLink>",
                  "geosceneJslink": "<View in JSAPI Link>"
                }
              }
            ]
          },
          "popupInfo": {
            "title": "{title} ({type})",
            "fieldInfos": [
              {
                "fieldName": "id",
                "label": "ID",
                "visible": false
              },
              {
                "fieldName": "title",
                "label": "Title",
                "visible": true
              },
              {
                "fieldName": "summary",
                "label": "Summary",
                "visible": true
              },
              {
                "fieldName": "description",
                "label": "Description",
                "visible": true
              },
              {
                "fieldName": "tags",
                "label": "Tags",
                "visible": true
              },
              {
                "fieldName": "type",
                "label": "Type",
                "visible": true
              },
              {
                "fieldName": "thumbnail",
                "label": "Thumbnail",
                "visible": false
              },
              {
                "fieldName": "xmin",
                "label": "xmin",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "ymin",
                "label": "ymin",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "xmax",
                "label": "xmax",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "ymax",
                "label": "ymax",
                "format": {
                  "places": 2,
                  "digitSeparator": false
                },
                "visible": false
              },
              {
                "fieldName": "accessInformation",
                "label": "Access Information",
                "visible": true
              },
              {
                "fieldName": "licenseInfo",
                "label": "License Information",
                "visible": true
              },
              {
                "fieldName": "credits",
                "label": "Credits",
                "visible": true
              },
              {
                "fieldName": "link",
                "label": "Link",
                "visible": true
              }
            ],
            "description": null,
            "showAttachments": false,
            "mediaInfos": [
              {
                "type": "image",
                "caption": "Initial Extent: [{xmin}, {ymin}] - [{xmax}, {ymax}]",
                "value": {
                  "sourceURL": "{thumbnail}",
                  "linkURL": "{geosceneJslink}"
                }
              }
            ]
          }
        }
      ]
    }
  }
}

JSON 响应示例

示例一

{
  "currentVersion": 2.0,
  "serviceDescription": "Test Map Service Description",
  "mapName": "Street Map Pro Data",
  "description": "Street Map USA",
  "copyrightText": "GEOSCENE",
  "supportsDynamicLayers": false,
  "layers": [
    {
      "id": 0,
      "name": "Cities",
      "defaultVisibility": true,
      "parentLayerId": -1,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0
    },
    {
      "id": 1,
      "name": "States",
      "defaultVisibility": true,
      "parentLayerId": -1,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0
    },
    {
      "id": 2,
      "name": "Counties",
      "defaultVisibility": false,
      "parentLayerId": -1,
      "subLayerIds": [
        3,
        4
      ],
      "minScale": 0,
      "maxScale": 0
    },
    {
      "id": 3,
      "name": "Large Counties",
      "defaultVisibility": false,
      "parentLayerId": 2,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0
    },
    {
      "id": 4,
      "name": "Small Counties",
      "defaultVisibility": false,
      "parentLayerId": 2,
      "subLayerIds": null,
      "minScale": 0,
      "maxScale": 0
    }
  ],
  "spatialReference": {
    "wkid": 4326
  },
  "singleFusedMapCache": true,
  "tileInfo": {
    "rows": 512,
    "cols": 512,
    "dpi": 96,
    "format": "JPEG",
    "compressionQuality": 75,
    "origin": {
      "x": -130,
      "y": 50
    },
    "spatialReference": {
      "wkid": 4326
    },
    "lods": [
      {
        "level": 0,
        "resolution": 8.46,
        "scale": 32000
      },
      {
        "level": 1,
        "resolution": 4.23,
        "scale": 16000
      },
      {
        "level": 2,
        "resolution": 2.11,
        "scale": 8000
      },
      {
        "level": 3,
        "resolution": 1.05,
        "scale": 4000
      },
      {
        "level": 4,
        "resolution": 0.52,
        "scale": 2000
      }
    ]
  },
  "initialExtent": {
    "xmin": -109.55,
    "ymin": 25.76,
    "xmax": -86.39,
    "ymax": 49.94,
    "spatialReference": {
      "wkid": 4326
    }
  },
  "fullExtent": {
    "xmin": -130,
    "ymin": 24,
    "xmax": -65,
    "ymax": 50,
    "spatialReference": {
      "wkid": 4326
    }
  },
  "units": "esriDecimalDegrees",
  "supportedImageFormatTypes": "PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ",
  "documentInfo": {
    "Title": "StreetMap USA.mxd",
    "Author": "GEOSCENE Data Team",
    "Comments": "GEOSCENE Data and Maps 2004",
    "Subject": "Street level data for the US",
    "Category": "vector",
    "Keywords": "StreetMap USA"
  },
  "capabilities": "Map,Query,Data",
  "maxRecordCount": 1000,
  "maxImageHeight": 2048,
  "maxImageWidth": 2048,
  "minScale": 0,
  "maxScale": 0,
  "tileServers": ["https://myserver/geoscene/rest/services/basemap/MapServer","https://myserver2/geoscene/rest/services/basemap/MapServer"],
  "supportedQueryFormats": "JSON",
  "exportTilesAllowed": true,
  "maxExportTilesCount": 100000,
  "supportedExtensions": "FeatureServer,KmlServer,MobileServer,WCSServer,WFSServer,WMSServer,NAServer,SchematicsServer"
}

示例二

以下示例演示了从服务请求更新信息时的响应:

{
  "timeExtent": [
    1230768000000, 1243814400000
  ],
  "fullExtent": {
    "xmin": -178.21759836192689,
    "ymin": 18.924781799107389,
    "xmax": -66.969271035924393,
    "ymax": 71.406235352841463,
    "spatialReference": {
      "wkid": 4269,
      "latestWkid": 4269
    }
  }
}

示例三

以下示例演示了请求服务的覆盖区时的响应:

注注:

为简洁起见,imageData 的信息已缩短。

{
  "featureCollection": {
    "layers": [
      {
        "layerDefinition":{
          "type":"Feature Layer",
          "geometryType":"esriGeometryPoint",
          "extent":{"xmin":-4254455.8606807785,"ymin":-1273247.593581636,"xmax":-3967497.083911836,"ymax":-1127922.6881048125,"spatialReference":{"wkid":102100}},          
          "objectIdField":"id",
          "displayFieldName":"Maps/BrazilMapServer",
          "drawingInfo": {
            "renderer": {
              "type":"simple",
              "label":"Maps/Brazil",
              "description":"",
              "symbol": {
                "height":24,
                "xoffset":0,
                "yoffset":0,
                "width":24,
                "contentType":"image/png",
                "type":"esriPMS",
                "imageData":"iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAABGdBTUEAALGPC/...=",
                "url":"https://sampleserver/geoscene/rest/static/images/BlueShinyPin.png"
              }
            }
          },
          "fields": [
            {
              "name": "id",
              "alias": "ID",
              "type": "esriFieldTypeOID"
            },
            {
              "name": "title",
              "alias": "Title",
              "type": "esriFieldTypeString"
            },
            {
              "name": "summary",
              "alias": "Summary",
              "type": "esriFieldTypeString"
            },
            {
              "name": "description",
              "alias": "Description",
              "type": "esriFieldTypeString"
            },
            {
              "name": "tags",
              "alias": "Tags",
              "type": "esriFieldTypeString"
            },
            {
              "name": "type",
              "alias": "Type",
              "type": "esriFieldTypeString"
            },
            {
              "name": "thumbnail",
              "alias": "Thumbnail",
              "type": "esriFieldTypeString"
            },
            {
              "name": "xmin",
              "alias": "xmin",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "ymin",
              "alias": "ymin",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "xmax",
              "alias": "xmax",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "ymax",
              "alias": "ymax",
              "type": "esriFieldTypeDouble"
            },
            {
              "name": "accessInformation",
              "alias": "Access Information",
              "type": "esriFieldTypeString"
            },
            {
              "name": "licenseInfo",
              "alias": "License Information",
              "type": "esriFieldTypeString"
            },
            {
              "name": "credits",
              "alias": "Credits",
              "type": "esriFieldTypeString"
            },
            {
              "name": "link",
              "alias": "Link",
              "type": "esriFieldTypeString"
            },
            {
              "name": "geosceneJslink",
              "alias": "GeosceneJsLink",
              "type": "esriFieldTypeString"
            }                  
          ]
        },
        "featureSet": {
          "geometryType":"esriGeometryPoint",
          "spatialReference": {
            "wkid":102100
          },
          "features": [
            {
              "geometry": {
                "x": -4110976.4722963073,
                "y": -1200585.1408432242
              },
              "attributes": {
                "id": 1,
                "title": "Maps/Brazil",
                "summary": "",
                "description": "",
                "tags": "[\"Brazil\"]",
                "type": "MapServer",
                "thumbnail": "https://sampleserver/geoscene/rest/services/Maps/Brazil/MapServer/info/thumbnail",
                "xmin": -4254455.8606807785,
                "ymin": -1273247.593581636,
                "xmax": -3967497.083911836,
                "ymax": -1127922.6881048125,
                "accessInformation": "",
                "licenseInfo": "",
                "credits": "",
                "link": "https://sampleserver/geoscene/rest/services/Maps/Brazil/MapServer",
                "geosceneJslink": "https://sampleserver/geoscene/rest/services/Maps/Brazil/MapServer?f=jsapi"
              }
            }
          ]
        },
        "popupInfo": {
          "title": "{title} ({type})",
          "fieldInfos": [
            {
              "fieldName": "id",
              "label": "ID",
              "visible": false
            },
            {
              "fieldName": "title",
              "label": "Title",
              "visible": true
            },
            {
              "fieldName": "summary",
              "label": "Summary",
              "visible": true
            },
            {
              "fieldName": "description",
              "label": "Description",
              "visible": true
            },
            {
              "fieldName": "tags",
              "label": "Tags",
              "visible": true
            },
            {
              "fieldName": "type",
              "label": "Type",
              "visible": true
            },
            {
              "fieldName": "thumbnail",
              "label": "Thumbnail",
              "visible": false
            },
            {
              "fieldName": "xmin",
              "label": "xmin",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "ymin",
              "label": "ymin",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "xmax",
              "label": "xmax",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "ymax",
              "label": "ymax",
              "format": {
                "places": 2,
                "digitSeparator":  false
              },
              "visible": false
            },
            {
              "fieldName": "accessInformation",
              "label": "Access Information",
              "visible": true
            },
            {
              "fieldName": "licenseInfo",
              "label": "License Information",
              "visible": true
            },
            {
              "fieldName": "credits",
              "label": "Credits",
              "visible": true
            },
            {
              "fieldName": "link",
              "label": "Link",
              "visible": true
            }
          ],
          "description": null,
          "showAttachments": false,
          "mediaInfos": [
            {
              "type": "image",
              "caption": "Initial Extent: [{xmin}, {ymin}] - [{xmax}, {ymax}]",
              "value": {
                "sourceURL": "{thumbnail}",
                "linkURL": "{geosceneJslink}"
              }
            }
          ]
        }
      }
    ]
  }
}