Project settings object is used to define project specific features. It references only datasets. Also, apart from other metadata objects, there can be only one project settings object in a project.
Syntax
This is the project settings object of the Retail Solution Demo. This demo covers only a part of the Birmingham area, so we use the code for the Great Britain - GB.
Project settings object syntax
Code Block |
---|
{
"name": "project_settings_gb",
"type": "projectSettings",
"content": {
"defaultViews": [
"/rest/projects/$projectId/md/views?name=catchment_area_view",
"/rest/projects/$projectId/md/views?name=restaurants_rating_view"
],
"geoSearchCountries": [
"GB"
],
"geoSearchProviders": [
"Mapbox"
]
}
}
|
Example of a dumped project settings
Code Block |
---|
{
"url": "/rest/projects/kt3hz932v53vabh8/md/projectSettings/qr0kekodkijcuhev",
"dumpTime": "2018-06-27T19:42:27Z",
"version": "1",
"content": {
"id": "qr0kekodkijcuhev",
"name": "project_settings_gb",
"type": "projectSettings",
"content": {
"geoSearchCountries": [
"GB"
],
"geoSearchProviders": [
"Mapbox"
]
},
"accessInfo": {
"createdAt": "2018-06-27T11:26:07Z"
},
"links": [
{
"rel": "self",
"href": "/rest/projects/kt3hz932v53vabh8/md/projectSettings/qr0kekodkijcuhev"
}
]
}
}
|
Additional syntax examples
Example of a projectSettings object with template
Code Block |
---|
{
"name": "project_settings_template",
"type": "projectSettings",
"content": {
"geoSearchCountries": [
"GB"
],
"geoSearchProviders": [
"Mapbox"
],
"projectTemplate": {
"templateDatasets": [
{
"dataset": "/rest/projects/$projectId/md/datasets?name=baskets"
}
]
}
}
} |
This example has a projectTemplate
object with settings related to project templates.
Example of a projectSettings object with trustedOrigins
Code Block |
---|
{
"name": "project_settings_template",
"type": "projectSettings",
"content": {
"geoSearchCountries": [
"GB"
],
"geoSearchProviders": [
"Mapbox"
],
"trustedOrigins": [
"http://stories.clevermaps.io",
"https://www.stories.clevermaps.io:443"
]
}
} |
This example has a trustedOrigins
array with URL whitelisted for iFrame postMessage API.
Example of a projectSettings object with defaultViews
Code Block |
---|
{
"name": "project_settings_template",
"type": "projectSettings",
"content": {
"geoSearchCountries": [
"GB"
],
"geoSearchProviders": [
"Mapbox"
],
"defaultViews": [
"/rest/projects/$projectId/md/views?name=catchment_area_view",
"/rest/projects/$projectId/md/views?name=restaurants_rating_view"
]
}
} |
This example has a defaultViews
array with URLs of views to be displayed in UI/dumped into project dump for all project members.
Key description
content
...
Key
...
Type
...
Optionality
...
Description
...
Constraints
...
geoSearchCountries
...
array
...
Status | ||||
---|---|---|---|---|
|
...
array of ISO 3166 alpha-2 country codes, to which the geographic search will be limited
...
(A-Z)
...
geoSearchProviders
...
array
...
Status | ||||
---|---|---|---|---|
|
...
list of geosearch providers
default = [Mapbox]
...
[Mapbox]
...
projectTemplate
...
object
...
Status | ||||
---|---|---|---|---|
|
...
object containing settings related to project templates
...
trustedOrigins
...
array
...
Status | ||||
---|---|---|---|---|
|
...
list of whitelisted URL for iFrame postMessage API. Add a URL if you want to communicate with iFrame from your page.
...
protocol://host.name.domain(:PORT)?
...
allowUnsecuredOrigins
...
boolean
...
Status | ||||
---|---|---|---|---|
|
...
allows embedding of current project to any URL and communicate via postMessage API. Enabling this option could have a security impact, please consider security risk of this setting.
Values in trustedOrgins
are ignored once allowUnsecuredOrigins
is set to true
.
default = false
...
defaultViews
...
array
...
Status | ||||
---|---|---|---|---|
|
...
list of views (URLs corresponding to views) to be displayed in UI/dumped into project dump for all project members
An order of views in defaultViews
array defines the order in which views are displayed in UI.
NOTE: Once a View
is listed here it (and all its referenced MD objects) can no longer be deleted due to reference integrity. Adding/removing defaultViews
in ProjectSettings
can be done only by Editor
or Admin
but not View Creator
.
...
"^/rest/projects/(\\$projectId|[a-z0-9]{16})/md/views(\\?name=[a-z0-9_-]+|/[a-z0-9]+)$"
content.projectTemplate
...
Key
...
Type
...
Optionality
...
Description
...
Constraints
...
templateDatasets
...
array
...
Status | ||||
---|---|---|---|---|
|
...
array of dataset links
...
size => 1
content.projectTemplate.dataset
...
Key
...
Type
...
Optionality
...
Description
...
Constraints
...
dataset
...
string
...
Status | ||||
---|---|---|---|---|
|
...
URL link to the dataset, which will be loadable with data during custom create project
...
/rest/projects/$projectId/md/datasets?name={datasetName}
Visual representation
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The content you are trying to reach has been moved here: https://docs.clevermaps.io/docs/project-settingsWe are proud to announce that we have launched a new documentation. Please update your saved links and bookmarks to follow a new address docs.clevermaps.io. |