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
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
1.3. Query Parameters
| Parameter | Description |
|---|---|
|
index of the page to fetch, counted from 0; 0 by default |
|
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 |
|---|---|---|
|
|
list of lines on the page |
|
|
line identifier |
|
|
line width |
|
|
line z coordinate (z-index) |
|
|
line segments |
|
|
arrow definition of the line beginning |
|
|
arrow definition of the line ending |
|
|
line pattern |
|
|
line color; |
|
|
layer identifier |
|
|
total number of pages |
|
|
total number of elements |
|
|
number of elements on this page |
|
|
page size |
|
|
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
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
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 |
|---|---|---|
|
|
line identifier |
|
|
line width |
|
|
line z coordinate (z-index) |
|
|
line segments |
|
|
arrow definition of the line beginning |
|
|
arrow definition of the line ending |
|
|
line pattern |
|
|
line color; |
|
|
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
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
3.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
arrow at the start of the line. Object with: |
|
|
arrow at the end of the line. Same structure as |
|
|
list of line segments, each with |
|
|
line width (minimum: 1) |
|
|
z-index of the line |
|
|
line color; |
|
|
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 |
|---|---|---|
|
|
line identifier |
|
|
line width |
|
|
line z coordinate (z-index) |
|
|
line segments |
|
|
arrow definition of the line beginning |
|
|
arrow definition of the line ending |
|
|
line pattern |
|
|
line color; |
|
|
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
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
line identifier |
4.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
arrow at the start of the line. Object with: |
|
|
arrow at the end of the line. Same structure as |
|
|
list of line segments, each with |
|
|
line width (minimum: 1) |
|
|
z-index of the line |
|
|
line color; |
|
|
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 |
|---|---|---|
|
|
line identifier |
|
|
line width |
|
|
line z coordinate (z-index) |
|
|
line segments |
|
|
arrow definition of the line beginning |
|
|
arrow definition of the line ending |
|
|
line pattern |
|
|
line color; |
|
|
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
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
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