Share object persists the state of the application when using the Share function.
This function is available by clicking the Menu button () in the top left of the map window, and selecting Share. The state of the application (including all dashboard settings, filters, map position, visualizations and much more) is persisted and a link is generated. After clicking this link, anyone with access to the project will be able to recover the saved application state and see the exact view as the creator of the share link. The link looks like this:
Code Block | ||||
---|---|---|---|---|
| ||||
https://secure.clevermaps.io/#/yufqzxkbiecj7jot/map/catchment_area_view?shareId=exb9g8wi9606ziyk |
It's a link to a specific view in a specific CleverMaps project, followed by the ?shareId={shareId}
parameter, which contains the ID of the share - exb9g8wi9606ziyk
.
Each shared link can consist of 5 share objects, which extend these object types:
Please note that there can be more than one indicator, and more than one indicator drill. Or there can be no indicator or no dashboard. This depends on the settings of your dashboard.
Syntax
This is a share object applied on catchment_area_view
view of the Retail Solution Demo. The diff array contains these changes:
- it adds default values of (
histogram
) filter at 10th position to 50 and 90 - it sets the map window center to 52.42325659892287,-1.9569396972656254 and zoom to level 12
- it adds the default visualization setting -
areas
- it adds the default compare type setting -
dominance
- it sets the default compare type to dominance
- it sets default spatial query to settings
- it adds default measure type -
isoline
- it sets the
defaultSelected
property to the feature with id "6" from datasetshops
All these properties and paths are described in detail in the Views article.
Code Block | ||
---|---|---|
| ||
{
"id": "m1nfjgsglwlcxvlf",
"name": "catchment_area_view_m1nfjgsglwlcxvlf",
"type": "share",
"content": {
"shareId": "m1nfjgsglwlcxvlf",
"objectId": "o31q6691gdtj3vng",
"objectName": "catchment_area_view",
"diff": [
{
"op": "add",
"path": "/content/filterGroup/10/defaultValues/values/0",
"value": 50,
"itemId": "d13d5b44990292a6c1b051c018410053"
},
{
"op": "add",
"path": "/content/filterGroup/10/defaultValues/values/1",
"value": 900,
"itemId": "ee2069d8ebd36700690adbf9875111f1"
},
{
"op": "replace",
"path": "/content/mapOptions/center/lat",
"value": 52.42325659892287
},
{
"op": "replace",
"path": "/content/mapOptions/center/lng",
"value": -1.9569396972656254
},
{
"op": "replace",
"path": "/content/mapOptions/zoom",
"value": 12
},
{
"op": "add",
"path": "/content/defaultVisualization",
"value": "areas"
},
{
"op": "add",
"path": "/content/defaultCompareType",
"value": "dominance"
},
{
"op": "add",
"path": "/content/spatialQuery/profile",
"value": "air"
},
{
"op": "add",
"path": "/content/spatialQuery/unit",
"value": "distance"
},
{
"op": "add",
"path": "/content/spatialQuery/amount",
"value": 500
},
{
"op": "add",
"path": "/content/measure/type",
"value": "isoline"
},
{
"op": "add",
"path": "/content/defaultSelected/dataset",
"value": "/rest/projects/$projectId/md/datasets?name=shops"
},
{
"op": "add",
"path": "/content/defaultSelected/ids/0",
"value": "6"
}
],
"breakingChanges": [],
"forcedRebaseCount": 0
}
}
|
Code Block | ||||
---|---|---|---|---|
| ||||
{
"url": "/rest/projects/yufqzxkbiecj7jot/md/shares/m1nfjgsglwlcxvlf",
"dumpTime": "2020-12-08T08:06:10Z",
"version": "1",
"content": {
"id": "m1nfjgsglwlcxvlf",
"name": "catchment_area_view_m1nfjgsglwlcxvlf",
"type": "share",
"content": {
"shareId": "m1nfjgsglwlcxvlf",
"objectId": "o31q6691gdtj3vng",
"objectName": "catchment_area_view",
"diff": [
{
"op": "add",
"path": "/content/filterGroup/10/defaultValues/values/0",
"value": 50,
"itemId": "d13d5b44990292a6c1b051c018410053"
},
{
"op": "add",
"path": "/content/filterGroup/10/defaultValues/values/1",
"value": 900,
"itemId": "ee2069d8ebd36700690adbf9875111f1"
},
{
"op": "replace",
"path": "/content/mapOptions/center/lat",
"value": 52.42325659892287
},
{
"op": "replace",
"path": "/content/mapOptions/center/lng",
"value": -1.9569396972656254
},
{
"op": "replace",
"path": "/content/mapOptions/zoom",
"value": 12
},
{
"op": "add",
"path": "/content/defaultVisualization",
"value": "areas"
},
{
"op": "add",
"path": "/content/defaultCompareType",
"value": "dominance"
},
{
"op": "add",
"path": "/content/spatialQuery/profile",
"value": "air"
},
{
"op": "add",
"path": "/content/spatialQuery/unit",
"value": "distance"
},
{
"op": "add",
"path": "/content/spatialQuery/amount",
"value": 500
},
{
"op": "add",
"path": "/content/measure/type",
"value": "isoline"
},
{
"op": "add",
"path": "/content/defaultSelected/dataset",
"value": "/rest/projects/$projectId/md/datasets?name=shops"
},
{
"op": "add",
"path": "/content/defaultSelected/ids/0",
"value": "6"
}
],
"breakingChanges": [],
"forcedRebaseCount": 0
},
"accessInfo": {
"createdAt": "2020-12-07T15:35:51Z",
"createdBy": "/rest/accounts/00ubfu7fdyIoFKxXm0h7"
},
"links": [
{
"rel": "self",
"href": "/rest/projects/yufqzxkbiecj7jot/md/shares/m1nfjgsglwlcxvlf"
}
]
}
}
|
Additional syntax examples
Code Block | ||||
---|---|---|---|---|
| ||||
{
"id": "exb9g8wi9606ziyk",
"name": "turnover_indicator_drill_on_exb9g8wi9606ziyk",
"type": "share",
"content": {
"shareId": "exb9g8wi9606ziyk",
"objectId": "iir539klh29s9mvo",
"objectName": "turnover_indicator_drill_on",
"diff": [
{
"op": "add",
"path": "/content/blocks/3/visualized",
"value": false,
"itemId": "9403698a1ed0cc2e55fcc27762faa1a3"
},
{
"op": "add",
"path": "/content/blocks/3/displayValues/0/Offline",
"value": "Offline",
"itemId": "9403698a1ed0cc2e55fcc27762faa1a3"
},
{
"op": "add",
"path": "/content/blocks/4/visualized",
"value": false,
"itemId": "ccf504abece40ed0bbe992f4931ddae3"
},
{
"op": "add",
"path": "/content/blocks/5/visualized",
"value": false,
"itemId": "d13d5b44990292a6c1b051c018410053"
},
{
"op": "add",
"path": "/content/blocks/6/visualized",
"value": false,
"itemId": "8d053723cb9372574ceeae9bd0c360ba"
}
],
"breakingChanges": [],
"forcedRebaseCount": 0
}
} |
This share object is applied on indicator drill. You can see it contains explicit disabled visalization of drill blocks. But mainly, for block 3 (categories
) there is an displayValues
setting which means we selected "Offline" category from the block.
Code Block | ||||
---|---|---|---|---|
| ||||
{
"id": "exb9g8wi9606ziyk",
"name": "shops_marker_selector_exb9g8wi9606ziyk",
"type": "share",
"content": {
"shareId": "exb9g8wi9606ziyk",
"objectId": "nl3porml3fmg4o0a",
"objectName": "shops_marker_selector",
"diff": [
{
"op": "add",
"path": "/content/keepFiltered/granularity",
"value": false
},
{
"op": "add",
"path": "/content/keepFiltered/markers",
"value": true
},
{
"op": "add",
"path": "/content/showIndicatorValuesOnMap",
"value": false
},
{
"op": "add",
"path": "/content/clusterMarkers",
"value": false
}
],
"breakingChanges": [],
"forcedRebaseCount": 0
}
} |
This share object is applied on marker selector. You can see it contains three marker selector settings - keepFiltered
, showIndicatorValuesOnMap
and clusterMarkers
set to false.
Key description
content
...
Status | ||||
---|---|---|---|---|
|
...
id of the share (present in share link)
...
Status | ||||
---|---|---|---|---|
|
...
id of metadata object on which the share is applied
...
Status | ||||
---|---|---|---|---|
|
...
diff
...
Status | ||||
---|---|---|---|---|
|
...
Status | ||||
---|---|---|---|---|
|
...
Status | ||||
---|---|---|---|---|
|
...
content.diff
content.breakingChanges
Each diff
and breakingChanges
array element follows the JSON Patch standard.
...
Status | ||||
---|---|---|---|---|
|
...
type of the operation
...
Status | ||||
---|---|---|---|---|
|
...
string
integer
number
boolean
...
Status | ||||
---|---|---|---|---|
|
...
value applied to the path
value
is polymorphic - it can be of any type available in the JSON standard
...
Status | ||||
---|---|---|---|---|
|
...
Generated ID for an item from the most outer array in the path - itemId
is used while rebasing share diffs to match existent diffs with corresponding items within master metadata object content which might have been reordered within arrays after metadata object update.
e.g. for path /content/filterGroup/10/defaultValues/values/0
the itemId
is generated for the item at path /content/filterGroup/10
There are cases when item for which diff is applied does not exists in master metadata object (only in shared metadata object) - in such cases itemId attribute is not present in share diff as it is not supposed to match anything in the master metadata object.
IMPORTANT: itemId
is not supposed to be modified manually via REST API.
NOTE: Mechanism described above does not cover all the cases, for example reordering items within a nested array currently produces breaking changes - the implementation is likely to improve in the future to store item IDs in share diff for items within all arrays in the path (the most outer and nested arrays instead of just the most outer one).
...
Visual representation
Shares themselves do not have a visual representation in the application. However, the Share function is available in Menu:
Then, a popup window with the generated link is shown:
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
The content you are trying to reach has been moved here: https://docs.clevermaps.io/docs/sharesWe 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. |