Methods:

createVectorLayer(options)

Creates a new vector layer. This function is an asynchronous function.

Parameters:

options (Object)

Name Description
options.name
String
Name of new vector layer.
options.layer_type
String
Type of new vector layer.  Choices are: ‘Polygon’ | ‘Polyline’ | ‘Point’ | ‘MultiPoint’.
options.display_name
String?
Display name of new vector layer. This parameter is helpful in identifying vector layers easily.
options.description
String?
Description of vector layer.
options.user_id
Number?
If the admin wants to create a new vector layer for a certain user, this parameter determines which user is the target user.
options.has_z
bolean
default: false
If true, geometry has z value.
options.fields
Array?
[{
      'name': 'string',
      'datatype': 'string', //Choices are: 'String' | 'Integer' | 'Long' | 'Float' | 'Date' | 'Time' | 'DateTime'
      'width': 'number',
      'display_name': 'string'
}]

Returns:

Vector layer: Returns itself to allow for method chaining.

Example:

const newVectorLayer = await Server.createVectorLayer({
   'name': 'string',
   'layer_type': 'Polygon',
   'display_name': 'string',
   'description': 'string',
   'has_z': false,
   'user_id' :0,
   'fields': [
      {
         'name': 'string',
         'datatype': 'String',
         'width': 250,
         'display_name': 'Parcel Name'
      }
   ]
});

updateVectorLayer(layer_uuid, options)

Updates the existing vector layer. Geometry type is not editable. This function is an asynchronous function.

Parameters:

layer_uuid is the available vector layer uuid.

options (Object)

Name Description
options.name
String
Name of vector layer.
options.display_name
String?
Display name of vector layer. This parameter is helpful in identifying vector layers easily.
options.description
String?
Description of vector layer.

Returns:

Vector layer: Returns itself to allow for method chaining.

Example:

const vectorLayer = await Server.updateVectorLayer('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{
   'name': 'string',
   'display_name': 'string',
   'description': 'string'
});

deleteVectorLayer(layer_uuid)

Deletes the existing vector layer. This function is an asynchronous function.

Parameters:

layer_uuid is the available vector layer uuid.

Returns:

String: Returns a message that shows deleting was successful or not. Null message means deleting was successful.

Example:

const result = await Server.deleteVectorLayer('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

getVectorLayer(layer_uuid)

Returns the desired existing vector layer. This function is an asynchronous function.

Parameters:

layer_uuid is the available vector layer uuid.

Returns:

Vector layer: Returns itself to allow for method chaining.

Example:

const vectorLayer = await Server.getVectorLayer('4f9f3e4b-4dc1-469b-83ab-00ae00f02581');

getVectorLayersByIds(options)

Returns the desired existing vector layers. This function is an asynchronous function.

Parameters:

options (Object)

Name Description
options.ids
Number| Array
Ids of vector layers. If you want a single vector layer, insert id as a string.
options.user_id
Number?
If the admin wants to fetch vector layers of a certain user, this parameter determines which user is the target user.

Returns:

Array: Returns an array of vector layers.

Example:

const vectorLayers = await Server.getVectorLayersByIds({
   'ids': [25,125],
   'user_id' :0
});

getVectorLayerByName(name, user_id)

Returns the desired existing vector layer. This function is an asynchronous function.

Parameters:

name is the available vector layer name.

user_id is the id of the user that the vector layer belongs to.

Returns:

Vector layer: Returns itself to allow for method chaining.

Example:

const vectorLayer = await Server.getVectorLayerByName('city',2);

getVectorLayers(options)

Returns the desired existing vector layers. This function is an asynchronous function.

Parameters:

options (Object)

Name Description
options.include_settings
Bolean
Default: false
If true, returns layer setting in layer_settings property.
options.f
String
Default: ‘json’
Output format. Choices are: ‘json’ | ‘html’
options.q
String?
Query filter based on OGC CQL standard.
e.g. “field1 LIKE ‘%GIS%’ AND created_at > ‘2021-01-01′”
options.search
String?
Search term for keyword-based searching among search_fields or all textual fields if search_fields does not have value.
NOTE: if q param is defined this param will be ignored.
options.search_fields
String?
Comma separated list of fields for searching
options.order_by
String?
Comma separated list of fields for sorting results [field1 A|D, field2 A|D, …]. e.g. name A, type D
NOTE: “A” denotes ascending order and “D” denotes descending order.
options.skip
Number?
Default: 0
Number of skipped vector layers.
options.limit
Number?
Default:10
Maximum number for result vector layers.
options.user_id
Number?
If the admin wants to fetch vector layers of a certain user, this parameter determines which user is the target user.
options.shared
Bolean
default: false
If true, returns only the vector layers that are shared.
options.page
Number?
Default:1
The minimum number of pages is 1.
options.page_size
Number?
Default:10
The minimum number of vector layers on each page is 1.

Returns:

Array: Returns an array of vector layers.

Example:

const vectorLayers= await Server.getVectorLayers({q:`name = 'string'`,user_id :0});

Leave a comment

Your email address will not be published. Required fields are marked *