Lines (polylines) drawn on a layer of a map. The endpoints are served from /new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/.

1. List lines

Returns a page of all polylines belonging to the given layer, each with its segments, width, color, line pattern and arrow heads.

Note
The result is paged - use the page and size query parameters to walk through it.

1.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/388/layers/195/lines/ HTTP/1.1

1.2. Path Parameters

Table 1. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

1.3. Query Parameters

Parameter Description

page

index of the page to fetch, counted from 0; 0 by default

size

number of entries on a page; 20 by default, 10000 at most

1.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/388/layers/195/lines/' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

1.5. HTTP response

HTTP/1.1 200 OK

1.6. Response Fields

Path Type Description

content

Array

list of lines on the page

content[].id

Number

line identifier

content[].width

Number

line width

content[].z

Number

line z coordinate (z-index)

content[].segments

Array

line segments

content[].startArrow

Object

arrow definition of the line beginning

content[].endArrow

Object

arrow definition of the line ending

content[].lineType

String

line pattern

content[].color

String

line color; #RRGGBBAA string

content[].layer

Number

layer identifier

totalPages

Number

total number of pages

totalElements

Number

total number of elements

numberOfElements

Number

number of elements on this page

size

Number

page size

number

Number

page number

1.7. Sample Response

{
  "content" : [ {
    "id" : 1528,
    "width" : 1.0,
    "color" : "#000000ff",
    "z" : 0,
    "segments" : [ {
      "x1" : 102030.0,
      "y1" : 421.0,
      "x2" : 3210.0,
      "y2" : 99.0
    } ],
    "startArrow" : {
      "arrowType" : "NONE",
      "angle" : 2.748893571891069,
      "lineType" : "SOLID",
      "length" : 15.0
    },
    "endArrow" : {
      "arrowType" : "NONE",
      "angle" : 2.748893571891069,
      "lineType" : "SOLID",
      "length" : 15.0
    },
    "lineType" : "SOLID",
    "layer" : 195
  } ],
  "totalPages" : 1,
  "totalElements" : 1,
  "numberOfElements" : 1,
  "size" : 20,
  "number" : 0
}

2. Get line

Returns a single polyline identified by its id: the ordered list of segments that define its shape, the width, color and pattern used to draw it, the arrows at both ends and the z-index that decides what it is drawn over.

2.1. HTTP request

GET /minerva/new_api/projects/test_project/maps/386/layers/194/lines/1519 HTTP/1.1

2.2. Path Parameters

Table 2. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/{lineId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

lineId

line identifier

2.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/386/layers/194/lines/1519' -X GET \
    -H 'Authorization: Bearer xxxxxxxx'

2.4. HTTP response

HTTP/1.1 200 OK

2.5. Response Fields

Path Type Description

id

Number

line identifier

width

Number

line width

z

Number

line z coordinate (z-index)

segments

Array

line segments

startArrow

Object

arrow definition of the line beginning

endArrow

Object

arrow definition of the line ending

lineType

String

line pattern

color

String

line color; #RRGGBBAA string

layer

Number

layer identifier

2.6. Sample Response

{
  "id" : 1519,
  "width" : 1.0,
  "color" : "#000000ff",
  "z" : 0,
  "segments" : [ {
    "x1" : 102030.0,
    "y1" : 421.0,
    "x2" : 3210.0,
    "y2" : 99.0
  } ],
  "startArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "endArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "lineType" : "SOLID",
  "layer" : 194
}

3. Add line

Draws a new polyline on the layer from a list of x1,y1,x2,y2 segments. Apart from the geometry the request sets the stroke (width, color, lineType) and, optionally, an arrow head at the start and at the end of the line. lineType is an enum selecting the dash pattern (SOLID, DASHED, DOTTED, …​) - see List line types for the values and the pattern each one draws.

3.1. HTTP request

POST /minerva/new_api/projects/test_project/maps/384/layers/193/lines/ HTTP/1.1

3.2. Path Parameters

Table 3. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

3.3. Request Fields

Path Type Description

startArrow

Object

arrow at the start of the line. Object with: arrowType (one of: NONE, FULL, OPEN, BLANK, CIRCLE, CROSSBAR, DIAMOND, BLANK_CROSSBAR, FULL_CROSSBAR), length (number), angle (number)

endArrow

Object

arrow at the end of the line. Same structure as startArrow

segments

Array

list of line segments, each with x1, y1, x2, y2

width

Number

line width (minimum: 1)

z

Number

z-index of the line

color

String

line color; #RRGGBBAA string

lineType

String

line pattern, one of: SOLID, DASHED, DOTTED, DASH_DOT, DASH_DOT_DOT

3.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/384/layers/193/lines/' -X POST \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"startArrow":{"arrowType":"NONE","angle":2.748893571891069,"lineType":"SOLID","length":15.0},"endArrow":{"arrowType":"NONE","angle":2.748893571891069,"lineType":"SOLID","length":15.0},"segments":[{"x1":1.0,"y1":2.0,"x2":12.0,"y2":23.0}],"width":2.0,"z":77,"color":"#ffff00ff","lineType":"DOTTED"}' \
    -H 'Content-Type: application/json'

3.5. HTTP response

HTTP/1.1 201 Created

3.6. Response Fields

Path Type Description

id

Number

line identifier

width

Number

line width

z

Number

line z coordinate (z-index)

segments

Array

line segments

startArrow

Object

arrow definition of the line beginning

endArrow

Object

arrow definition of the line ending

lineType

String

line pattern

color

String

line color; #RRGGBBAA string

layer

Number

layer identifier

3.7. Sample Response

{
  "id" : 1518,
  "width" : 2.0,
  "color" : "#ffff00ff",
  "z" : 77,
  "segments" : [ {
    "x1" : 1.0,
    "y1" : 2.0,
    "x2" : 12.0,
    "y2" : 23.0
  } ],
  "startArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "endArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "lineType" : "DOTTED",
  "layer" : 193
}

4. Update line

Replaces the polyline as a whole - its segments, z, width, color, lineType and both arrowheads - so the complete set of values has to be sent.

Note
Supports optimistic locking via the If-Match header.

4.1. HTTP request

PUT /minerva/new_api/projects/test_project/maps/392/layers/197/lines/1546 HTTP/1.1

4.2. Path Parameters

Table 4. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/{lineId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

lineId

line identifier

4.3. Request Fields

Path Type Description

startArrow

Object

arrow at the start of the line. Object with: arrowType (one of: NONE, FULL, OPEN, BLANK, CIRCLE, CROSSBAR, DIAMOND, BLANK_CROSSBAR, FULL_CROSSBAR), length (number), angle (number)

endArrow

Object

arrow at the end of the line. Same structure as startArrow

segments

Array

list of line segments, each with x1, y1, x2, y2

width

Number

line width (minimum: 1)

z

Number

z-index of the line

color

String

line color; #RRGGBBAA string

lineType

String

line pattern, one of: SOLID, DASHED, DOTTED, DASH_DOT, DASH_DOT_DOT

4.4. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/392/layers/197/lines/1546' -X PUT \
    -H 'Authorization: Bearer xxxxxxxx' \
    -d '{"startArrow":{"arrowType":"NONE","angle":2.748893571891069,"lineType":"SOLID","length":15.0},"endArrow":{"arrowType":"NONE","angle":2.748893571891069,"lineType":"SOLID","length":15.0},"segments":[{"x1":1.0,"y1":2.0,"x2":12.0,"y2":23.0}],"width":2.0,"z":40,"color":"#ffff00ff","lineType":"DOTTED"}' \
    -H 'Content-Type: application/json'

4.5. HTTP response

HTTP/1.1 200 OK

4.6. Response Fields

Path Type Description

id

Number

line identifier

width

Number

line width

z

Number

line z coordinate (z-index)

segments

Array

line segments

startArrow

Object

arrow definition of the line beginning

endArrow

Object

arrow definition of the line ending

lineType

String

line pattern

color

String

line color; #RRGGBBAA string

layer

Number

layer identifier

4.7. Sample Response

{
  "id" : 1546,
  "width" : 2.0,
  "color" : "#ffff00ff",
  "z" : 40,
  "segments" : [ {
    "x1" : 1.0,
    "y1" : 2.0,
    "x2" : 12.0,
    "y2" : 23.0
  } ],
  "startArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "endArrow" : {
    "arrowType" : "NONE",
    "angle" : 2.748893571891069,
    "lineType" : "SOLID",
    "length" : 15.0
  },
  "lineType" : "DOTTED",
  "layer" : 197
}

5. Delete line

Removes the polyline from the layer; the rest of the layer content is left untouched.

Note
Supports optimistic locking via the If-Match header.

5.1. HTTP request

DELETE /minerva/new_api/projects/test_project/maps/390/layers/196/lines/1537 HTTP/1.1

5.2. Path Parameters

Table 5. /minerva/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/lines/{lineId}
Parameter Description

projectId

project identifier

mapId

map identifier

layerId

layer identifier

lineId

line identifier

5.3. CURL sample

$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/390/layers/196/lines/1537' -X DELETE \
    -H 'Authorization: Bearer xxxxxxxx'

5.4. HTTP response

HTTP/1.1 200 OK