highlightTargetSet


URI

<trackingLayer_uri>/{highlightTargetSetID}[.<format>]

Supported methods

GET, POST, PUT, DELETE, HEAD

Parent resource

trackingLayer

Introduction

A highlightTargetSet resource is a set of highlight targets. It is used for outputing highlight targets. Using this resource, one can get all the highlight targets and continue to add highlight targets. The highlight output includes the following steps:

  1. create a highlight target set and get the URI of the highlight target set resource.

  2. Add highlight targets to the highlight target set.

  3. Implement a GET request on the highlightImage resource, resulting in an image of highlight targets based on their IDs.

Where the creation of a highlight target set is realized via the POST operation of the trackingLayer resource--the parent resouce of highlightTargetSet; and the addition of highlight targets to the highlight target set is realized via the POST operation of the highlightTargetSet resource.

For the life cycle of the resource, please see Life cycle of temporary resources.

Supported methods

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

GIS Services Resource Hierarchy

root maps map trackingLayer highlightTargetSet

HTTP request methods

Below is the implementation of a HTTP request on the following URI, where rjson is the output format, supermapiserver is the name of the server, WorldMap is the name of the map (mapName), and 1 is the ID of the highlightTargetSet resource (i.e. highlightTargetSetID, created through the trackingLayer resource).

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

GET Request

Gets all the highlight targets in the highlight target set.

Request parameters

Field Type Definition
_cache boolean [Optional parameters]
Whether to use cache, the default is True. False means close all the caches.

Response structure

When implementing GET on the highlightTargetSet resource, it returns a set of highlight targets, where each element in the set is a HighlightTarget.

A HighlightTarget has the following structure:

Name Type Description
name String Name of the highlight target.
geometries Geometry[] Array of highlight geometric targets, that is, the content of the highlight target.
geometryIDs int[] Array of the IDs of the highlight geometric targets.
style Style Style of the highlight target. The same highlight target has a consistent style.

 

Example usage

When implementing GET on the example URI--http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson (after the POST request), it returns the following resource representation in rjson format:

[{

    "geometries": [{

        "center": {

            "x": 0,

            "y": 0

        },

        "id": 0,

        "parts": [4],

        "points": [           

           {

                "x": 120,

                "y": 40

            },

            {

                "x": 120,

                "y": 30

            },

            {

                "x": 100,

                "y": 30

            },

            {

                "x": 100,

                "y": 40

            }

        ],

        "style": null,

        "type": "REGION"

    }],

    "geometryIDs": null,

    "name": null,

    "style": {

        "fillBackColor": {

            "blue": 0,

            "green": 255,

            "red": 0

        },

        "fillBackOpaque": false,

        "fillForeColor": {

            "blue": 0,

            "green": 0,

            "red": 255

        },

        "fillGradientAngle": 0,

        "fillGradientMode": null,

        "fillGradientOffsetRatioX": 0,

        "fillGradientOffsetRatioY": 0,

        "fillOpaqueRate": 100,

        "fillSymbolID": 0,

        "lineColor": {

            "blue": 0,

            "green": 0,

            "red": 0

        },

        "lineSymbolID": 0,

        "lineWidth": 0.01,

        "markerAngle": 0,

        "markerSize": 1,

        "markerSymbolID": -1

    }

}]

POST request

Implementing the POST request can add highlight targets to the highlightTargetSet resource and return the representation of the highlight target.

Request parameters

To add highlight targets, the POST request body must include a few parameters. If they are valid, SuperMap iServer will add a highlight tarGET on the highlightTargetSet resource according to the parameters. Because these parameters indicate a highlight target set, the amount of information is often large. So, they are put in the request body when transferring. Particularly, the returnContent parameter must be included in the URI.


Field Type Definition
returnContent boolean This parameter must be included in the URI.
It indicates whether the description of the newly created resource will be returned. If true, the newly added highlight target set content will be returned; if false, it will only return whether or not the addition is successful and the purpose/type of the POST request. The default is false.

One can add multiple highlight targets at once. In the request body is the set of highlight targets to be add included. Each element in the set has the following structure:

Name Type Description
name String Name of the highlight target.
geometries Geometry[] Array of highlight geometric targets, that is, the content of the highlight target.
geometryIDs int[] Array of the IDs of the highlight geometric targets.
style Style Style of the highlight target. The same highlight target has a consistent style.

Response structure

When implementing POST on the highlightTargetSet resource, it returns the representation with the following structure (expressed in the body of the response message):

Name Type Description
succeed boolean Indicates whether or not the addition of the highlight target is successful. If the operation fails, there will be an error message.
postResultType PostResultType

Purpose/type of the POST request.

error HttpError Error message. If the addition is successful, this field will be absent.

Example usage

When implementing POST on the example URI--http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap//trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson, the request body should include the following parameters:

[{"geometries": [{

        "id": 0,

        "parts": [4],

        "points": [           

           {

                "x": 120,

                "y": 40

            },

            {

                "x": 120,

                "y": 30

            },

            {

                "x": 100,

                "y": 30

            },

            {

                "x": 100,

                "y": 40

            }

        ],

        "style": null,

        "type": "REGION"

    }],

    "geometryIDs": null,

    "name": null,

    "style": {

        "fillBackColor": {

            "blue": 0,

            "green": 255,

            "red": 0

        },

        "fillBackOpaque": false,

        "fillForeColor": {

            "blue": 0,

            "green": 0,

            "red": 255

        },

        "fillGradientAngle": 0,

        "fillGradientMode": null,

        "fillGradientOffsetRatioX": 0,

        "fillGradientOffsetRatioY": 0,

        "fillOpaqueRate": 100,

        "fillSymbolID": 0,

        "lineColor": {

            "blue": 0,

            "green": 0,

            "red": 0

        },

        "lineSymbolID": 0,

        "lineWidth": 0.01,

        "markerAngle": 0,

        "markerSize": 1,

        "markerSymbolID": -1

    }

}]

It returns the following representation in rjson format:

{

     "succeed":true,

     "postResultType":"AddContent"

}

Implement the GET request on http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson again now, one will see the number of highlight targets in the highlight target set has increased by one, that means the highlight target passed over by the POST request body has been added.

PUT request

Implementing the PUT request can modify the highlightTargetSet resource.

Request parameters

To modify the highlight target set resource, the PUT request body must include a few parameters. If the parameters are valid, SuperMap iServer will modify the highlightTargetSet resource accordingly.

Here, the parameters in the PUT request body should be desired values after the modification to the highlightTargetSet resource. For the description structure of the highlightTargetSet resource, please refer to the response structure of the GET request.

Response structure

When implementing PUT on the highlightTargetSet resource, it returns the representation in the following structure (expressed in the body of the response message):

Name Type Description
succeed boolean Indicates whether or not the operation is successful. If it fails, there will be an error message.
error HttpError An error message. If successful, the field will be absent.

Example usage

When implementing PUT on the example URI--http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson, the request body should include the following parameters:

[

    {

        "geometries": [{

            "id": 0,

            "parts": [3],

            "points": [

            {

                "x": 101,

                "y": 26

            },

            {

                "x": 78,

                "y": 23

            },

            {

                "x": 103,

                "y": 16

            }

            ],

            "style": null,

            "type": "REGION"

        }],

        "geometryIDs": null,

        "name": null,

        "style": {

            "fillBackColor": {

                "blue": 0,

                "green": 255,

                "red": 0

            },

            "fillBackOpaque": false,

            "fillForeColor": {

                "blue": 0,

                "green": 0,

                "red": 255

            },

            "fillGradientAngle": 0,

            "fillGradientMode": null,

            "fillGradientOffsetRatioX": 0,

            "fillGradientOffsetRatioY": 0,

            "fillOpaqueRate": 100,

            "fillSymbolID": 0,

            "lineColor": {

                "blue": 0,

                "green": 0,

                "red": 0

            },

            "lineSymbolID": 0,

            "lineWidth": 0.01,

            "markerAngle": 0,

            "markerSize": 1,

            "markerSymbolID": -1

        }

    }

]

It returns the following representation in rjson format:

{

    "succeed": true

}

Implement the GET request on http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson again now, one will see the highlight target set has changed (e.g. parts of the coordinates are bolder now).

DELETE

Deletes the highlight target set.

Request parameters

None.

Response structure

When implementing DELETE on the highlightTargetSet resource, it returns the representation in the following structure (expressed in the body of the response message):

Name Type Description
succeed boolean Indicates whether or not the deletion is successful. If it fails, there will be an error message.
error HttpError Error message. If the deletion is successful, this field will be absent.

Example usage

When implementing DELETE to the example URI--http://supermapiserver:8090/iserver/services/map-world/rest/maps/WorldMap/trackingLayer/pcg70k3e_17cacff656b74cca9fce82354cf4b82e.rjson, it returns the following representation in rjson format:

{

    "succeed": true

}

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 highlightTargetSet 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 highlightTargetSet resource supports the representation in <format> or not.

See