Layers ====== .. _layers-show_layers: List the layers in a viewer --------------------------- .. http:get:: /maps_api/v2/server/viewers/(string:identifier)/layers Get a list of layers in a viewer. :param string identifier: Identifier of the viewer. **Example request:** .. sourcecode:: http GET /maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae/layers HTTP/1.1 Host: planviewer.nl Accept: application/json **Example response:** .. sourcecode:: json { "error": false, "layers": [ { "self_url": "https://www.planviewer.nl/maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae/layers/24", "id": 24, "viewer": { "self_url": "https://www.planviewer.nl/maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "name": "Testkaart", "identifier": "138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "created_at": "2018-04-03T11:30:44+02:00", "updated_at": "2018-04-03T11:36:03+02:00" }, "name": "OSM", "type": "osm", "base": true, "consultable": false, "sort_order": 0, "created_at": "2017-03-20T11:34:30+01:00", "updated_at": "2017-03-20T11:34:30+01:00" }, { "self_url": "https://www.planviewer.nl/maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae/layers/26", "id": 26, "viewer": { "self_url": "https://www.planviewer.nl/maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "name": "Testkaart", "identifier": "138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "created_at": "2018-04-03T11:30:44+02:00", "updated_at": "2018-04-03T11:36:03+02:00" }, "name": "Luchtfoto", "type": "aerial", "base": true, "consultable": false, "sort_order": 1, "created_at": "2017-03-20T11:34:37+01:00", "updated_at": "2017-03-20T11:34:37+01:00" }, { "self_url": "https://www.planviewer.nl/maps_api/v2/server/viewers/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae/layers/198", "id": 198, "viewer": { "self_url": "https://www.planviewer.nl/maps_api/v2/server/vieweshop/payment/overview.html.twigrs/138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "name": "Testkaart", "identifier": "138230fef76a818207720794e9a5c7db1ac243e9f42471737ccae5becfd7a2ae", "created_at": "2018-04-03T11:30:44+02:00", "updated_at": "2018-04-03T11:36:03+02:00" }, "name": "testkaart", "type": "vector", "base": false, "consultable": true, "sort_order": 2, "vector_source": { "has_sld": false, "type": "polygon", "uploadable": true, "drawable": true, "created_at": "2018-04-03T11:31:12+02:00", "updated_at": "2018-04-03T11:31:12+02:00" }, "created_at": "2018-04-03T11:31:12+02:00", "updated_at": "2018-04-03T11:31:12+02:00" } ] } Sort the layers in a viewer --------------------------- .. http:post:: /maps_api/v2/server/viewers/(string:identifier)/sort_layers Sort one or more layers of a viewer. You may either position a single layer to a new position, or send multiple sorting locations in one go. When sorting layers, it is not required to sort all at once, layers not sent with the request will be re-ordered according to the layers that have been sent. This call will return a list of all layers to indicate the new state of all layers in the viewer. This request may either be sent with a JSON body or a form url-encoded body. You must specify the ``Content-Type`` header.shop/payment/overview.html.twig .. note:: Default the layers are sorted as followed: Starting from 1 the base layers are numbered. The next layer (usually the outline layer (Dossiergrens)) will have number 5 And so on. You can find the current sorting by using `List the layers in a viewer`_ :param string identifier: Identifier of the viewer. : false, "message" => "feature information updated"} Import a shapefile to vector layer ---------------------------------- .. _shapefile_import: For uploading a shapefile , a valid shapefile must be created with programs like QGis. See definition: https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf. .. note:: This function replaces the upload and update endpoints for creating and updating Vector layers with shapefiles .. http:post:: /maps_api/v2/server/viewers/(string:identifier)/layers/(int:layer)/import Upload a shapefile and use the data from that shapefile to create a new vector layer. :param string identifier: Identifier of the viewer. :param int layer: Identifier of the vector layer. :