Vector layer views

Methods:

createVectorLayerView(layer_uuid, options)

Creates a new vector layer view from the existing vector layer. This function is an asynchronous function.

Parameters:

layer_uuid is the available vector layer uuid that you want to create vector layer view from.

options (Object)

Name Description
options.name
String
Name of new vector layer view.
options.display_name
String?
Display name of new vector layer view. This parameter is helpful in identifying vector layer views easily.
options.description
String?
Description of vector layer view.
options.view_filter
String?
Query filter based on OGC CQL standard.
e.g. “field1 LIKE ‘%GIS%’ AND created_at > ‘2021-01-01′”
options.view_extent
Array?
Coordinates should be on the web mercator coordinate system.
[[‘south west’][‘x’], [‘south west’][‘y’], [‘north east’][‘x’],[‘north east’][‘y’]]
options.view_cols
String | Array?
‘[ALL]’ | Comma separated list of fields name.
options.user_id
Number?
If the admin wants to create new vector layer view for a certain user, this parameter determines which user is the target user.

Returns:

vector layer view: Returns itself to allow for method chaining.

Example:

const newVectorLayerView = await Server.createVectorLayerView('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{
   'name': 'string',
   'display_name': 'string',
   'description': 'string',
   'user_id' :0,
   'view_filter': "province_name = 'Tehran'",
   'view_extent': [
      5667477,
      4234242,
      5762609,
      4319221
   ],
  'view_cols': '[ALL]'
});

updateVectorLayerView(layer_uuid, options)

Updates the existing vector layer view. This function is an asynchronous function.

Parameters:

layer_uuid is the available vector layer view uuid.

options (Object)

Name Description
options.name
String
Name of vector layer view.
options.display_name
String?
Display name of vector layer view. This parameter is helpful in identifying vector layer views easily.
options.description
String?
Description of vector layer view.
options.view_filter
String?
Query filter based on OGC CQL standard.
e.g. “field1 LIKE ‘%GIS%’ AND created_at > ‘2021-01-01′”
options.view_extent
Array?
Coordinates should be on the web mercator coordinate system.
[[‘south west’][‘x’], [‘south west’][‘y’], [‘north east’][‘x’],[‘north east’][‘y’]]
options.view_cols
String | Array?
‘[ALL]’ | Comma separated list of fields name.
options.user_id
Number?
If the admin wants to create new vector layer view for a certain user, this parameter determines which user is the target user.

Returns:

vector layer view: Returns itself to allow for method chaining.

Example:

const vectorLayerView = await Server.updateVectorLayerView('4f9f3e4b-4dc1-469b-83ab-00ae00f02581',{
   'name': 'string',
   'display_name': 'string',
   'description': 'string',
   'user_id' :0,
   'view_filter': "province_name = 'Tehran'",
   'view_extent': [
      5667477,
      4234242,
      5762609,
      4319221
   ],
  'view_cols': '[ALL]'
});

deleteVectorLayerView(layer_uuid)

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

Parameters:

layer_uuid is the available vector layer view uuid.

Returns:

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

Example:

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

getVectorLayerView(layer_uuid)

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

Parameters:

layer_uuid is the available vector layer view uuid.

Returns:

vector layer view: Returns itself to allow for method chaining.

Example:

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

getVectorLayerViewsByIds(options)

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

Parameters:

options (Object)

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

Returns:

Array: Returns an array of vector layer views.

Example:

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

getVectorLayerViewByName(name, user_id)

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

Parameters:

name is the available vector layer view name.

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

Returns:

vector layer view: Returns itself to allow for method chaining.

Example:

const vectorLayerView = await Server.getVectorLayerViewByName('city',2);

getVectorLayerViews(options)

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

Parameters:

options (Object)

Name Description
options.include_settings
Bolean
defult: false
If true, returns layer setting in layer_settings property.
options.f
String
defult: ‘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 seperated 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 layer views.
options.limit
Number?
Default:10
Maximum number for result vector layer views..
options.user_id
Number?
If the admin wants to fetch vector layer views of a certain user, this parameter determines which user is the target user.
options.shared
Bolean
default: false
If true, returns only the vector layer views 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 layer views on each page is 1.

Returns:

Array: Returns an array of vector layer views.

Example:

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

Leave a comment

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