Skip to content

Edit Layer Style API

API Information

  • Request Path: /analysis/task/edit/layer/style
  • Request Method: POST
  • Content-Type: application/json

Request Headers

ParameterTypeRequiredDescription
AuthorizationStringYesUser authentication token
Content-TypeStringYesMust be set to application/json

Request Parameters

ParameterTypeRequiredDescriptionConstraints
layerStringYesLayer Name
styleStyleYeslayer

Style Object

FieldTypeDescription
fillStringfill color
fillOpaFloatfill opacity
strokeStringstroke color
strokeOpaFloatstroke opacity
strokeWtFloatstroke width

Request Body Example

json
{
  "layer": "v2_aiidfzdiazedhzhfghd",
  "style": {
    "fill": "#D62424",
    "fillOpa": 0.8,
    "stroke": "#FFFFFF",
    "strokeOpa": 0.8,
    "strokeWt": 1
  }
}

Response Body Structure

CommonResponse Object

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataBooleanStyle edit result, true indicates success

Response Examples

Success Response

json
{
  "code": 200,
  "message": "success",
  "data": true
}

Failure Response

json
{
  "code": 404,
  "message": "Layer not found",
  "data": false
}

Error Code Description

Error CodeDescription
200Success
400Request parameter error
401Unauthorized
404Layer not found
500Server internal error

Usage Instructions

  1. This API is used to edit layer styling for analysis task results
  2. User authentication is required
  3. Task ID and layer ID must be provided
  4. Returns boolean indicating style edit success

Notes

  • Task ID and layer ID are required
  • Style parameters can include colors, opacity, labels, etc.
  • User authentication token must be included in request headers