For the complete documentation index, see llms.txt. This page is also available as Markdown.

Map layer

User-supplied KML overlays drawn on top of the Navixy platform's map.

A map layer is a KML file a user uploads to draw their own geometry over the platform's map.

A layer is created by uploading its file and is read back as that same file. The layer object itself is metadata only, an ID and a name, so map_layer/update renames a layer and does nothing else. To replace the geometry, upload a new layer and delete the old one.

Map layer object

API actions

API base path: /map_layer.

Operations that list no errors of their own return only the general error codes.


Read map layer

post
/map_layer/read

Return the body of a map layer.

The response is the KML file itself, served as application/vnd.google-earth.kml+xml; charset=utf-8, not a JSON envelope. Only a failure comes back as JSON.

Reachable from a geo-link session as well as an ordinary one.

Also accepts GET with the same parameters as query-string values.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
idinteger · min: 1Required

ID of the map layer.

Responses
200

The layer body as KML

application/vnd.google-earth.kml+xml
stringOptional

The KML document.

post/map_layer/read
POST /v2/map_layer/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 8

{
  "id": 1
}
text

Errors

These errors come in addition to the general error codes:

  • 201 - Not found in the database, when the current user has no map layer with the given ID.


List map layers

post
/map_layer/list

Return the metadata of every map layer belonging to the account. Bodies are not included; read them one at a time with map_layer/read.

Callable with an empty body. Reachable from a geo-link session as well as an ordinary one. Also accepts GET.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
objectOptional
Responses
200

The map layers

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/map_layer/list
POST /v2/map_layer/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "success": true,
  "list": [
    {
      "id": 1,
      "label": "text"
    }
  ]
}

Upload map layer

post
/map_layer/upload

Create a map layer from a KML file.

This is a multipart request, not JSON: multipart/form-data with the KML in a part named file. The file is validated against the KML 2.0 and 2.2 schemas and rejected if it does not conform.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
filestring · binaryRequired

The KML file to import.

labelstring · min: 1Required

Name for the new layer. Trimmed, and cannot be empty.

redirect_targetstringOptional

Optional. URL to redirect to after the upload. When given, the response is a redirect to <redirect_target>?response=<urlencoded_response_json> instead of a JSON body.

Responses
200

The created layer

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
idintegerOptional

ID of the new map layer.

post/map_layer/upload
POST /v2/map_layer/upload HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 57

{
  "file": "binary",
  "label": "text",
  "redirect_target": "text"
}
{
  "success": true,
  "id": 1
}

Errors

These errors come in addition to the general error codes:

  • 233 - No data file, when the file part is missing.

  • 234 - Invalid data format, when the file has the wrong MIME type.

  • 242 - Validation error, when the uploaded file is not valid KML.

  • 268 - Over quota, when the user's quota for map layers is exceeded.


Update map layer

post
/map_layer/update

Rename a map layer.

Only the metadata changes. To replace the KML body, upload a new layer and delete the old one.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
Responses
200

Layer updated

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/map_layer/update
POST /v2/map_layer/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 33

{
  "layer": {
    "id": 1,
    "label": "text"
  }
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - Not found in the database, when the current user has no map layer with the given ID.


Delete map layer

post
/map_layer/delete

Delete a map layer and its body.

Also accepts GET with the same parameters as query-string values.

Authorizations
AuthorizationstringRequired

Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.

Body
idinteger · min: 1Required

ID of the map layer.

Responses
200

Layer deleted

application/json
successbooleanRead-onlyOptional

true if request finished successfully.

Example: true
post/map_layer/delete
POST /v2/map_layer/delete HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 8

{
  "id": 1
}
{
  "success": true
}

Errors

These errors come in addition to the general error codes:

  • 201 - Not found in the database, when the current user has no map layer with the given ID.

Last updated

Was this helpful?