Rectangles drawn on a layer of a map.
The endpoints are served from
/new_api/projects/{projectId}/maps/{mapId}/layers/{layerId}/rects/.
1. List rectangles
Returns a page of all rectangles belonging to the given layer, each with its position, size, fill
and border. The response is paginated (content, totalPages, totalElements, size,
number).
|
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/408/layers/205/rects/ 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/408/layers/205/rects/' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
1.5. HTTP response
HTTP/1.1 200 OK
1.6. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
list of rectangles on the page |
|
|
unique shape identifier |
|
|
layer identifier |
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
|
|
size (area) of the shape |
|
|
total number of pages |
|
|
total number of elements |
|
|
number of elements on this page |
|
|
page size |
|
|
page number |
1.7. Sample Response
{
"content" : [ {
"id" : 181,
"borderColor" : "#000000ff",
"borderThickness" : 1.0,
"fillColor" : "#ffffffff",
"x" : 1.0,
"y" : 2.0,
"z" : 12,
"width" : 3.0,
"height" : 4.0,
"layer" : 205,
"size" : 12.0,
"elementId" : "x=1.0;y=2.0; w=3.0, h=4.0"
} ],
"totalPages" : 1,
"totalElements" : 1,
"numberOfElements" : 1,
"size" : 20,
"number" : 0
}
2. Get rectangle
Returns a single rectangle identified by its id: the top left corner (x, y), its
width/height, the fill color, the border color and thickness, and size, the area it covers.
2.1. HTTP request
GET /minerva/new_api/projects/test_project/maps/406/layers/204/rects/180 HTTP/1.1
2.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
rectangle identifier |
2.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/406/layers/204/rects/180' -X GET \
-H 'Authorization: Bearer xxxxxxxx'
2.4. HTTP response
HTTP/1.1 200 OK
2.5. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
unique shape identifier |
|
|
layer identifier |
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
|
|
size (area) of the shape |
2.6. Sample Response
{
"id" : 180,
"borderColor" : "#000000ff",
"borderThickness" : 1.0,
"fillColor" : "#ffffffff",
"x" : 1.0,
"y" : 2.0,
"z" : 12,
"width" : 3.0,
"height" : 4.0,
"layer" : 204,
"size" : 12.0,
"elementId" : "x=1.0;y=2.0; w=3.0, h=4.0"
}
3. Add rectangle
Draws a new rectangle on the layer, spanning from the top left corner (x, y) over
width/height, filled with fillColor and outlined with borderColor of borderThickness.
3.1. HTTP request
POST /minerva/new_api/projects/test_project/maps/404/layers/203/rects/ HTTP/1.1
3.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
3.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
3.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/404/layers/203/rects/' -X POST \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"fillColor":"#0000ffff","borderColor":"#c0c0c0ff","borderThickness":3.0,"x":2.2,"y":3.3,"width":12.1,"height":11.1,"z":5}' \
-H 'Content-Type: application/json'
3.5. HTTP response
HTTP/1.1 201 Created
3.6. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
unique shape identifier |
|
|
layer identifier |
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
|
|
size (area) of the shape |
3.7. Sample Response
{
"id" : 179,
"borderColor" : "#c0c0c0ff",
"borderThickness" : 3.0,
"fillColor" : "#0000ffff",
"x" : 2.2,
"y" : 3.3,
"z" : 5,
"width" : 12.1,
"height" : 11.1,
"layer" : 203,
"size" : 134.31,
"elementId" : "x=2.2;y=3.3; w=12.1, h=11.1"
}
4. Update rectangle
Replaces the geometry and the style of the rectangle - its x, y, z, width, height,
fillColor, borderColor and borderThickness - 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/412/layers/207/rects/183 HTTP/1.1
4.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
rectangle identifier |
4.3. Request Fields
| Path | Type | Description |
|---|---|---|
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
4.4. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/412/layers/207/rects/183' -X PUT \
-H 'Authorization: Bearer xxxxxxxx' \
-d '{"fillColor":"#0000ffff","borderColor":"#c0c0c0ff","borderThickness":1.0,"x":2.2,"y":3.3,"width":12.1,"height":11.1,"z":5}' \
-H 'Content-Type: application/json'
4.5. HTTP response
HTTP/1.1 200 OK
4.6. Response Fields
| Path | Type | Description |
|---|---|---|
|
|
unique shape identifier |
|
|
layer identifier |
|
|
x coordinate of the top left corner |
|
|
y coordinate of the top left corner |
|
|
z coordinate (z-index) |
|
|
width of the shape |
|
|
height of the shape |
|
|
thickness of the border |
|
|
color used to fill the interior of the shape; |
|
|
color used to draw the outline of the shape; |
|
|
size (area) of the shape |
4.7. Sample Response
{
"id" : 183,
"borderColor" : "#c0c0c0ff",
"borderThickness" : 1.0,
"fillColor" : "#0000ffff",
"x" : 2.2,
"y" : 3.3,
"z" : 5,
"width" : 12.1,
"height" : 11.1,
"layer" : 207,
"size" : 134.31,
"elementId" : "x=2.2;y=3.3; w=12.1, h=11.1"
}
5. Delete rectangle
Removes the rectangle 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/410/layers/206/rects/182 HTTP/1.1
5.2. Path Parameters
| Parameter | Description |
|---|---|
|
project identifier |
|
map identifier |
|
layer identifier |
|
rectangle identifier |
5.3. CURL sample
$ curl 'https://minerva-dev.lcsb.uni.lu/minerva/new_api/projects/test_project/maps/410/layers/206/rects/182' -X DELETE \
-H 'Authorization: Bearer xxxxxxxx'
5.4. HTTP response
HTTP/1.1 200 OK