tileImage


URI

<map_uri>/tileimage[.<format>]

Supported methods

GET, HEAD

Parent resource

ERROR: Variable (map_link) is undefined.

Introduction

After an entire map is split into square grids with the same sizes, the map can be formed by piecing together those small tiles. The tileImage resource represents geographic features corresponding to these pieces. By executing a GET request on the tileImage resource, you can get the related grid pictures of the map({mapName}). The URI can contain a few customized output picture parameters, for example, setting the layer to output, the size of tile, the number of column and row, whether the map is transparent, the dynamic projected target projection, etc. The parameters must be included in the URI and cannot be put inside the request body.

The rule to divide the grids is as follows: clip the overview map from the upper left corner to the lower right. The clip unit size is 256*256 pixel by default. The row number and column number of the grid on the upper left corner are both 0, and increase gradually to the lower right corner. The grid size and map scale can be specified in the request.

Supported Methods:

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

Resource hierarchy

根资源 maps 资源 map 资源 tileImage 资源

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name and WorldMap is the map name {mapName}, with png being the output format for example.

http://supermapiserver:8090/iserver/services/map-world/rest/maps/worldmap/tileImage.png

GET request

gets the grid picture, the parameter in URL determines the location of the grid.

Request parameter

Implement GET request on tileImage resource to get the grid picture, it is needed to contain related parameters in URI, if not, it will output the map based on the current map status. The parameters are:

Name Type Description
redirect boolean Whether to redirect the request. This is a concept regarding HTTP transport. If the value is true, the request will be redirected to the real address of the image; if the value is false, the response body will then include the byte stream of the image. The default value is false, the request is not redirected.
x int The column number of the grid in the map, increasing from left to right. The tiles begin from the upper left corner by default and the grid column number is 0.
y int The row number of the grid in the map, increasing from up to down. The tiles begin from the upper left corner and the row number is 0.
scale double The map scale. E.g., 0.0001 means 1:10000. See the definition of the map scale.
width int Tile width in pixel, the default is 256 pixels.
height int Tile width in pixel, the default is 256 pixels.
transparent boolean Whether the grid image is transparent or not.
origin Point2D The origin point of the tiles, the default it the upper left corner of the map. If specified as the other point, it will calculate the tile column and row number based on that.
E.g, for the worldmap sample data, it sets the origin point to origin={"x":-200,"y":45} which means that the origin locates the upper left of (0,0) and the lower right of (-1,-1).
layersID String Gets the cached layer ID, which can be a temporary layer set, or a group of layers in the current map. The default is all layers.
layersID can be the ID of the temporary layers templayers such as layersID=382139acf0, or ID of the layers in the current map.
The definition rule for the ID of the layers in the current map is as follows:
1. Layers are numbered starting from 0 with the order from top to bottom;
2. The one before the colon(:) is the top layer;
3. The English period(.) represents the dependency relation between layers.
4. The English comma(,) separates the layers.
Possible use case:
1. [0:0,1,2.0] means sub layers under the top layer 0: 0, 1 and its sub layers, and the sub layer 0 under layer 2;
2. [1:1.2,2] means sub layers under the top layer 1: the sub layer 2 under layer 1, and the layer 2 and all sub layers under layer 2;
3. The combination of above two examples is:[0:0,1,2.0,1:1.2,2]
[0,1,2,3] means layers 0, 1, 2, 3 under the top layer 0 and all sub layers, [0:,1:,2:] means the top layers 0, 1, 2 and all sub layers.
dynamicProjection boolean Whether to allow dynamic projection while displaying the map.
prjCoordSys PrjCoordSys The spatial reference of the requested map.
When this coordinate system is different with the original one, it will make dynamic projection and return the dynamically projected map tiles.

To construct the parameter according to the field structure in PrjCoordSys, but also support passing the reference system by epsgCode as follows:

prjCoordSys={"epsgCode":3857}。
random boolean Whether to output the map with random numbers way, the default is false.
If true, not specified parameters among scale, x and y will be assigned randomly within the valid range.
_cache boolean

Whether to use cache, the default is True. False means close all the cache.

customParams String

Custom parameters

It can be any form of string. The user can pass the customized parameter by this property.

rectifyType RectifyType The rectification method .
clipRegion Geometry The clipped region on the map for display. This is an area object, and is supported only when clipRegionEnabled = true, indicating that only the part of the map covered by clipRegion will be displayed.
clipRegionEnabled boolean Whether clipRegion is enabled.
customEntireBounds Rectangle2D Cumtom map boundary. Supported only when customEntireBoundsEnabled = true.
customEntireBoundsEnabled boolean Whether customEntireBounds is enabled.
angle double The rotation angle of the map.
antialias boolean Whether the map is anti-alias.
backgroundStyle Style The background style of the map.
colorMode MapColorMode The color mode of the map.
markerAngleFixed boolean Whether the angle of marker symbols is fixed.
maxVisibleTextSize double The maximum visible size (in pixels) of the text.
maxVisibleVertex int

The maximum visible vertices of the geometric object.

If a geometric feature has more than maxVisibleVertex vertices, the extra vertices will not be displayed.

minVisibleTextSize double The minimum visible size (in pixels) of the text.
overlapDisplayed boolean Whether the overlapped features in the same area are all displayed, the default is false.
If true, the object in the same area will not be displayed; if false, it will make the object not overlapped and then be displayed by overlapDisplayedOptions.
overlapDisplayedOptions OverlapDisplayedOptions A filtering parameter to set the objects not overlapped. Valid when overlapDisplayed is false. It can enhance processing the overlapping of the objects.
paintBackground boolean Whether to render the background of the map.
textAngleFixed boolean Whether the angles of the text are fixed.
textOrientationFixed boolean Whether the orientations of the text are fixed.
tileversion String

Cache version name, valid when _cache is true.

Get through GET request for tileset resource, which is the name field in the response result tileVersions, such as tileversion=51de5c76-c994-4207-94a7-d31f948f56e3; if not to set the tileversion parameter, and there are multiple cache versions, it will use the latest updated version.

Response structure

An image will be returned if the output format is specified as PNG, BMP, GIF or JPG if you want to get the map image directly.

If you want to get the image information, you can specify the output format as RJSON, JSON, HTML or XML. The structure of the response will be as follows:

Field Type Description
customResponse String The custom response.
imageData byte[] The binary stream of the map image.
lastModified long The last modified time of the map.
imageUrl String A URI directed to the map image in PNG format.
mapParam MapParameter Map parameters.

Sample 1

Compare the output effects between requesting all layers for tileImage resource and specifying layersID=[0:0,1,7,10,11], the latter is to only make cache for the layers in the following table when specifying layersID.

Father layer The sublayers name
WorldMap(0) ContinentLabel@World@@worldMap(0)
WorldMap(0) ContinentLabel@World@@worldMap(1)
WorldMap(0) Capitals@World@@worldMap(7)
WorldMap(0) ContinentLabel@World@@worldMap(10)
WorldMap(0) Uniquevaluemap@@worldMap(11)

As follows:

Output all layers when not specifying layersID Output when specifying layersID

 

Left: if not specifying layersID, it will return the map with all layers by default, that is, it will implement GET request: http://supermapiserver:8090/iserver/services/map-world/rest/maps/worldMap/tileImage.png?scale=0.00000002&x=9&y=2&width=256&height=256.

Right: if specifying layersID=[0:0,1,7,10,11], it will only output the specific layers, that is, it will implement GET request: http://supermapiserver:8090/iserver/services/map-world/rest/maps/worldMap/tileImage.png?scale=0.00000002&x=9&y=2&width=256&height=256&layersID=[0:0,1,7,10,11].

Sample 2

If it makes a dynamic projection to the requested imaged in sample 1, which is to request the output effect after setting its coordinate system to WebMercator dynamically, it will implement GET request: http://supermapiserver:8090/iserver/services/map-world/rest/maps/Worldmap/tileImage.png?scale=0.00000002&x=9&y=2&width=256&height=256&prjCoordSys={"epsgCode":3857}, and will return the following PNG format images. After the dynamic projection, the map shape, size and scale will all change. To get the original location, it needs to set the appropriate scale and image index. After changing the index to x=9&t=6, the output will be like this.

Dynamic projection output effect 1 Dynamic projection output effect 2

 

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

Gets the metadata information of tileImage resource. Check the existence of the tileImage resource and whether it can be accessed. By implementing the HEAD request on the URI, with .<format> appended to the end, we can quickly get to know whether the tileImage resource supports the representation in <format> or not.

See