zxyTileImage


URI

  1. <map_uri>/zxyTileImage[.<format>]
  2. <map_uri>/zxyTileImage/z/x/y.[.<format>]

Supported methods

GET, HEAD

Parent resource

ERROR: Variable (map_link) is undefined.

Introduction

The full map image is cut into multiple grids of the same size in pixels as a unit, then the map can be made by a number of small pieces together. The zxyTileImage resource represents small pieces of the map that is partitioned by the ZXY specification. For details please see: Map tiles in ZXY specification.

Supported Methods:

Supported expressions: PNG, BMP, GIF, JPG, RJSON, JSON, HTML, XML.

Resource hierarchy

HTTP request methods

Execute an HTTP request with the following URI, where supermapiserver is the server name, with png as the output format.

  1. http://supermapiserver:8090/iserver/services/map-China400/rest/maps/China/zxyTileImage.png

  2. http://supermapiserver:8090/iserver/services/map-China400/rest/maps/China/zxyTileImage/0/0/0.png

GET request

Gets the grid image of the map, the parameters in URI determine the position of the grid.

Request parameter

To execute a GET request on zxyTileImage resource to get the grid image of the map, the relevant parameters should be included in the URI. If no parameters are specified, then it will get the entire image of the map. The parameters are:

Name Type Definition
z int Map scale.
x long Grid column number in the map, increasing from left to right. The grid column number starts from the upper left corner by default, which is 0.
y long Grid row number in the map, increasing from up to bottom. The grid row number starts from the upper left corner by default, which is 0.
width int The width of the grid, unit: Pixel. The default is 256 pixels.
height int The height of the grid, unit: Pixel. The default is 256 pixels.
layersID String

Used to specify the IDs of layers of the current map for generating the corresponding map tiles. If this parameter is not set, the system will generating the tiles based on all the layers.

layersID can be the ID of templayers when the temporary layer was created, such as layersID=382139acf0; or it can be the ID number of the layers in current map.

Below shows the rules about how to define the layer ID of the current map:

1. The layers of each level are numbered from 0 in the order of the layers from top to bottom;

2. Before colon (:) is the top layer;

3. The English period (.) indicates the affiliation between layers;

4. The English comma (,) indicates the separation between layers.

E.g:

1. [0:0,1,2.0] indicates sublayer 0 and all its sublayers, sublayer 1 and all its sublayers, and the layer 0 under sublayer 2 under the top level layer 0;

2. [1:1.2,2] indicates the layer 2 under sublayer 1, and sublayer 2 and all its sublayers under the top level layer 1;

3. The merged format of the above two examples is [0:0,1,2.0,1:1.2,2]

In addition, [0,1,2,3] indicates the sublayer 0, 1, 2 and 3 under the top level layer 0; [0:,1:,2:] indicates the top level layer 0, 1, 2 and all their sublayers.

Response structure

To get a map image directly, you can specify the format to PNG, BMP, GIF, or JPG, and it will return a map image.

To get the map image information, you can specify the representation format to RJSON, JSON, HTML, or XML, and the representation structure is as follows:

Field Type Description
lastModified long The last modified time of the map.
imageUrl String URI to indicate the map image, the format is PNG.
mapParam MapParameter Map parameters.

Response example

After performing the GET request: http://supermapiserver:8090/iserver/services/map-China400/rest/maps/China/zxyTileImage.png?z=6&x=52&y=24&width=256&height=256, or http://supermapiserver:8090/iserver/services/map-China400/rest/maps/China/zxyTileImage/6/52/24.png?width=256&height=256, it will return the image in PNG format shown as follows.

HEAD request

Returns the same HTTP response header as the GET request, but no response entity, which can be used to retrieve the meta data contained in response message header without having to transmit the entire response content. Meta data information includes media type, character coding, compression coding, entity content length, etc.

HEAD request is used to determine whether the zxyTileImage resource exists, or if the user has the authority to access it. By executing an HEAD request with a .<format> URI, you can quickly determine whether the zxyTileImage resource supports the <format> representation.

 

See