highlightImage


URI

<map_uri>/highlightimage[.<format>]

Supported methods

GET, HEAD

Parent resource

ERROR: Variable (map_link) is undefined.

Introduction

The highlightImage resource can be used to highlight a specific target set or a query result. It returns an image either with the highlighted objects alone, or with the highlighted objects overlaying on a certain base map. Specifically, the highlighted image is retrieved by GET, which provides the SuperMap iServer with information about the target set, the query result, and other layers to be overlaid, through including corresponding parameters in the URI for the GET request. If a query result is to be highlighted in an image, the highlighting style can also be specified by passing the style parameter style.

Supported Methods:

Supported output formats: PNG, RJSON, JSON, HTML, XML.

Resource hierarchy

根资源 maps 资源 map 资源 highlightImage 资源

HTTP request methods

Implement an HTTP request on the following URI and return the response in rjsonformat. In the URI, supermapiserver is the name of the server, and WorldMap is the map name (mapName). The URI represents the highlightImage resource, which can be used to retrieve the highlighted image given proper parameters.

http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/highlightimage.rjson

GET request

Gets a specific highlighted image. Parameters such as the target set or the query result to be highlighted are all included in a URI.

Request parameter

The request parameters of the highlightImage resource must be included in the URI. The following is a list of all the parameters. Each request can have either a highlightTargetsID or a queryResultID, indicating that the output image is either highlighting a specific target set, or a query result.

Name Type Description
redirect boolean Whether to redirect. If true, the request would be redirected to the real address of the image; if false, the byte stream of the image would be in the response body. The default is true.
highlightTargetSetID String [Required parameter]
Not compatible with queryResultID.
The target set resource to be highlighted in the output image, i.e., the ID of the highlightTargetSet resource.
queryResultID String [Required parameter]
Not compatible with highlightTargetSetID.
The query result resource to be highlighted in the output image, i.e., the ID of the queryResult resource.
style Style The style of highlighting query results.
center Point2D Specifies the center point of the map display.
scale double Specify the scale of the map. See definition of scale.
width int Specifies the width of the display window/the output image. Must be used together with height. Priority is higher than viewer.
height int Specifies the height of the display window/the output image. Must be used together with width. Priority is higher than viewer.
viewer Rectangle Specifies the size of the display window/the output image. The default size is 256*256 pixels.

viewBounds

Rectangle2D Specifies the geographic extent of the map view.
layersID String The ID of the temporary layers to be mapped in the output image. The temeporary layers are created by temLayersSet resource.
dynamicProjection boolean Whether to allow dynamic projection while displaying the map.
prjCoordSys PrjCoordSys The coordinate system requested.
The system will perform dynamic projection if the coordinate system be set is different from the original coordinate system, the map image will be returned at the same time.
Parameter usage example:
_cache boolean

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

customParams String

Custom parameters

They can be strings with any combination of characters. This is for users to pass any custom parameters.

rectifyType RectifyType The rectification method .
clipRegion Geometry The clipped region on the map for display. This is an areal 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 Custom map boundary. Valid when customEntireBoundsEnabled is 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 to display the objects when the map object is in the same extent. The default is False.
If it is true, the objects in the same extent will be directly overlapped; If it is False, it doesn't display through overlapDisplayedOptions.
overlapDisplayedOptions OverlapDisplayedOptions Avoid the map object overlapping the filter options. When the overlapDisplayed is false, it is used to enhance the processing when map objects overlap.
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.

Response structure

If the highlighted image is directly retrieved, the output format can be set to PNG. An image will then be returned.

If information about the highlighted image is retrieved, the output format can be set as RJSON, JSON, HTML, or XML. The returned representation structure 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.

Example usage

As an example, output a highlight target set (See highlightTargetSetresource), the ID is 損cg70k3e_17cacff656b74cca9fce82354cf4b82e? the output result of the PNG format can be got through the two URIs below, the former is the result of the original coordinate system, and the latter is the result after projected to {"epsgCode":3857}.

http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/highlightimage.png?highlightTargetSetID=pcg70k3e_17cacff656b74cca9fce82354cf4b82e&center={"x":110.0,"y":35.0}&scale=0.00000003

http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/highlightImage.png?highlightTargetSetID=pcg70k3e_17cacff656b74cca9fce82354cf4b82e&center=center={"x":12245143.99,"y":4160330.24}&scale=0.00000003&prjCoordSys={"epsgCode":3857}

Output result 1 Output result 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.

The HEAD request helps check the existence of the highlightImage resource and whether it can be accessed by the client. By implementing the HEAD request on the URI, with .<format> appended to the end, we can quickly get to know whether the highlightImage resource supports the representation in <format> or not.

See