This pages contain specific configurations and documentation related to the javascript applications only.
The configuration file is located in client/static/mapstore/configs/localConfig.json
and it exposes specific properties to customize:
property | type | description | |
---|---|---|---|
supportedLocales |
{object} | ||
geoNodeConfiguration |
{object} | contains all the configuration needed to change the theme, filters and navbar structures | see available properties |
localConfig.geoNodeConfiguration
property | type | description | |
---|---|---|---|
filters |
{object} | configuration of filter | |
filters.order |
{object} | configuration of order dropdown | |
filters.order.defaultLabelId |
{string} | label id to use for the order dropdown button | |
filters.order.options |
{array} | label id to use for the order dropdown button | order object entry |
filters.extent |
{object} | configuration of extent filter | |
filters.extent.layers |
{array} | a list of MapStore layers object used as extent background | |
filters.extent.style |
{object} | a MapStore vector style object | |
cardsMenu |
{object} | configuration of the menu of resource cards | |
cardsMenu.items |
{array} | list of menu item objects, right placement | menu item object entry |
cardOptions |
{object} | configuration of the resource cards dropdown | |
cardOptions.items |
{array} | list of menu item objects, dropdown placement | menu item object entry |
filtersForm |
{object} | configuration of the resource cards dropdown | |
filtersForm.items |
{array} | list of filter objects, panel placement | filter object |
Order object contains properties for an entry of the order dropdown. Configuration:
{
"labelId": "gnhome.aZ", // message id for the dropdown item
"value": "title" // value used in the sort filter
}
Menu item object contains properties for a list item rendered in a menu. Configuration:
- type link
{
"labelId": "gnhome.register", // label message id
"type": "link", // one of 'link', 'dropdown', 'divider' or 'filter'
"href": "/account/signup/?next=/",
"badge": "{state.datasetsTotalCount}", // (menu configuration only) counter badge. variable available: datasetsTotalCount, mapsTotalCount,
"authenticated": true, // true shows the item only when user authenticated while false only for anonymous user, if undefined the item is always visible
"perms": [], // the value in array define the access to the contents
"allowedRoles": [] // user roles to access to the contents
}
- type dropdown
{
"labelId": "gnhome.register", // label message id
"image": "", //the toogle image
"type": "dropdown", // one of 'link', 'dropdown', 'divider' or 'filter'
"authenticated": true, // true shows the item only when user authenticated while false only for anonymous user, if undefined the item is always visible
"perms": [], // the value in array define the access to the contents
"allowedRoles": [], // user roles to access to the contents
"items": [] // menu items of type link or divider
}
- type divider
{
"type": "divider", // one of 'link', 'dropdown', 'divider' or 'filter'
"authenticated": true, // true shows the item only when user authenticated while false only for anonymous user, if undefined the item is always visible
"perms": [], // the value in array define the access to the contents
"allowedRoles": [], // user roles to access to the contents
}
- type filter
{
"type": "filter", // one of 'link', 'dropdown', 'divider' or 'filter'
"id": "landuse", // unique id of the filter
"labelId": "gnhome.customFilterExample", // label message id
"authenticated": true, // true shows the item only when user authenticated while false only for anonymous user, if undefined the item is always visible
"perms": [], // the value in array define the access to the contents
"allowedRoles": [], // user roles to access to the contents
"query": { // query filter to use
"filter{regions.name.in}": [
"Global"
]
}
}
Filter object contains properties for a select input rendered inside the filter form. Configurations:
-
type select
- properties for select input with static options:
{ "id": "title", // filter id used for the request filter{title.in}= "labelId": "gnhome.labelId", // message id for select label "placeholderId": "gnhome.placeholderId", // message id for select placeholder "type": "select", "options": [ // list of string values "Title 1", "Title 2", "Title 3", "Title 4" ] }
- properties for select input with suggestions request:
{ "labelId": "gnhome.resourceTypes", // message id for select label "placeholderId": "gnhome.resourceTypesPlaceholder", // message id for select placeholder "type": "select", "suggestionsRequestKey": "resourceTypes" // available 'resourceTypes', 'categories', 'keywords', 'regions' or 'owners' }
-
type group
{
"type": "group",
"labelId": "gnhome.customFiltersTitle", // label message id
"authenticated": true, // true shows the item only when user authenticated while false only for anonymous user, if undefined the item is always visible
"items": [
//... list of filter objects excluding type group
]
}
Filter items supports also the following types from menu object configuration: filter, divider and link.
- actions/gnresource
Actions for GeoNode resource store information of the resource in use
- actions/gnsave
Actions for GeoNode save workflow
- actions/gnsearch
Actions for GeoNode resource featured items set new Featured Resources includes data, page, links
- epics/index
- epics/visualstyleeditor
- plugins/LayerSettings
- plugins/MediaViewer
- plugins/Save
- plugins/SaveAs
- plugins/Sync
- selectors/config
- utils/APIUtils
Utilities for api requests
- utils/CoordinatesUtils
Utilities for api requests
- utils/FileUtils
- utils/MenuUtils
- utils/ResourceUtils
- SYNC_RESOURCES
Sync geostory components with their live resources on geonode
- gnSyncComponentsWithResources ⇒
Observable
Sync reources in current geostory or dashboard with their respective sources
- getGeonodeResourceDataFromGeostory ⇒
Array
Get geonode resources from within a Geostory
- getSyncInfo(appType, resourceData, successArr) ⇒
Object
Get resource type and data for state update in sync process
- getNotificationInfo(errors, successes) ⇒
Object
Get notification title, leve, and message for showNotification
Actions for GeoNode resource store information of the resource in use
- actions/gnresource
- .resourceLoading()
- .setResource(data)
- .editTitleResource(title)
- .editAbstractResource(abstract)
- .editThumbnailResource(image)
- .setResourceType(resourceType)
- .resourceError(error)
- .updateResourceProperties(properties)
- .setNewResource()
- .setResourceId(id)
- .setResourcePermissions(permissions)
- .setSelectedDatasetPermissions(permissions)
- .setFavoriteResource(favorite)
- .enableMapThumbnailViewer()
- .setMapThumbnail()
Initialize loading state
Kind: static method of actions/gnresource
Set the resource in the state
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
data | object |
resource data object |
edit the title resource in the state
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
title | string |
resource |
edit the abstract resource in the state
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
abstract | string |
resource |
edit the image resource in the state
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
image | string |
resource |
Set the resource type in the state
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
resourceType | object |
resource type |
Set error of resource request
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
error | object |
error data object |
Update resource properties
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
properties | object |
resource properties to override |
Set the current resource as new
Kind: static method of actions/gnresource
Set resource id or primary key
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
id | number | string |
resource id or primary key |
Set resource permissions
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
permissions | object |
permissions info |
permissions.canEdit | bool |
can edit permission |
permissions.canView | bool |
can view permission |
Set resource permissions
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
permissions | object |
permissions info |
permissions.canEdit | bool |
can edit permission |
permissions.canView | bool |
can view permission |
Set the resource favorite field (trigger epic gnSaveFavoriteContent)
Kind: static method of actions/gnresource
Param | Type | Description |
---|---|---|
favorite | bool |
resource data field |
Enable or disable map thumbnail viewer
Kind: static method of actions/gnresource
Set map like thumbnail to map or layer (trigger epic gnSaveDirectContent)
Kind: static method of actions/gnresource
Actions for GeoNode save workflow
Initialize saving loading state
Kind: static method of actions/gnsave
Set success response of save workflow
Kind: static method of actions/gnsave
Param | Type | Description |
---|---|---|
success | object |
success response |
Set error response of save workflow
Kind: static method of actions/gnsave
Param | Type | Description |
---|---|---|
error | object |
error response |
Clear state of actions.gnsave reducer
Kind: static method of actions/gnsave
Save or create a resource (trigger epic actions.gnsaveContent)
Kind: static method of actions/gnsave
Param | Type | Description |
---|---|---|
id | number | string |
resource id or primary key, create a new resource if undefined |
metadata | object |
properties to update { name, description, thumbnail } |
reload | bool |
reload page on create |
showNotifications | bool |
show notifications to user |
Save or updates a resource (trigger epic actions.gnsaveDirectContent)
Kind: static method of actions/gnsave
Actions for GeoNode resource featured items set new Featured Resources includes data, page, links
Actions for GeoNode resource featured items loads new featured resources basing on the action, previous or next
Kind: static method of actions/gnsearch
Param | Type | Description |
---|---|---|
action | string |
can be either next or previous |
pageSize | number |
page_size of items to load defaults to 4; |
Handles checking and for permissions of a layer when its selected
Kind: static constant of epics/index
Checks the permissions for layers when a map is loaded and when a new layer is added to a map
Kind: static constant of epics/index
Get Mapstore style in JSON, editor type and code for layer style in Promise
Kind: inner method of epics/visualstyleeditor
Param | Type | Description |
---|---|---|
style | Object |
layer default style |
styleService | Object |
Object containing baseUrl for getStylesInfo |
Plugin for layer and groups settings
Kind: inner property of plugins/LayerSettings
Example
{
"name": "LayerSettings",
}
Plugin for Media Viewer
Kind: inner property of plugins/MediaViewer
Properties
Name | Type | Description |
---|---|---|
cfg.gltf.environmentFiles | string |
path to an hdr environment file for the 3d scene (format gltf) |
cfg.pcd.environmentFiles | string |
path to an hdr environment file for the 3d scene (format pcd) |
Plugin for Save modal
Kind: inner property of plugins/Save
Plugin for SaveAs modal
Kind: inner property of plugins/SaveAs
get the parsed geonode configuration that take into account user permissions and expressions
Kind: static constant of selectors/config
Param | Type | Description |
---|---|---|
state | object |
redux state |
return all the custom filters available in the GeoNode configuration from localConfig
Kind: static constant of selectors/config
Param | Type | Description |
---|---|---|
state | object |
redux state |
Utilities for api requests
In development mode it returns the request with a relative path if the request url contain localhost:8000
Kind: static constant of utils/APIUtils
Returns: string
- correct url for localhost
Param | Type | Description |
---|---|---|
requestUrl | string |
request url |
Utilities for api requests
- utils/CoordinatesUtils
- .boundsToExtentString ⇒
string
- .getExtent ⇒
Array
- .boundsToExtentString ⇒
Given a bounds { minx, miny, maxx, maxy } and a crs return the extent param as string
Kind: static constant of utils/CoordinatesUtils
Returns: string
- extent param
Get the extent of area of interest from map bbox the values of the extent are expressed in the unit of the projection
Kind: static constant of utils/CoordinatesUtils
Returns: Array
- containng minx, miny, maxx, maxy
minx, miny -> bottom-left corner of square
maxx, maxy -> top-right corner of square
Param | Type | Description |
---|---|---|
Options | Object |
containing layers and features |
- utils/FileUtils
- .getFileFromDownload ⇒
string
- .determineResourceType ⇒
string
- .getFileFromDownload ⇒
Generates a blob path for a resource
Kind: static constant of utils/FileUtils
Returns: string
- Object url to view resource in browser
Param | Type | Description |
---|---|---|
downloadURL | string |
remote path to a resource |
type | string |
type of the file to be converted to default application/json |
check if a resource extension is supported for display in the media viewer
Kind: static constant of utils/FileUtils
Returns: string
- pdf image video unsupported
Param | Type | Description |
---|---|---|
extension | string |
extension of the resource accessed on resource.extenstion |
check if the menu perms is allowed by user or resource
Kind: static method of utils/MenuUtils
Param | Type | Description |
---|---|---|
perms | array |
array with perms of user or resource |
objResource | array |
menu or resource perms |
objType | string |
type of objcet (user / resource) |
- utils/ResourceUtils
- .resourceToLayerConfig ⇒
object
- .setAvailableResourceTypes
- .getResourcePermissions ⇒
- .parseDocumentConfig ⇒
Object
- .parseMapConfig ⇒
Object
- .resourceToLayerConfig ⇒
convert resource layer configuration to a mapstore layer object
Kind: static constant of utils/ResourceUtils
Param | Type | Description |
---|---|---|
resource | object |
geonode layer resource |
A setter funtion to assign a value to availableResourceTypes
Kind: static constant of utils/ResourceUtils
Param | Type | Description |
---|---|---|
value | * |
Value to be assign to availableResourceTypes (gotten from resource_types response payload) |
Extracts lists of permissions into an object for use in the Share plugin select elements
Kind: static constant of utils/ResourceUtils
Returns: An object containing permissions for each type of user/group
Param | Type | Description |
---|---|---|
options | Object |
Permission Object to extract permissions from |
Parse document response object (for image and video)
Kind: static constant of utils/ResourceUtils
Returns: Object
- new document config object
Param | Type | Description |
---|---|---|
docResponse | Object |
api response object |
resource | Object |
optional resource object |
Parse map response object
Kind: static constant of utils/ResourceUtils
Returns: Object
- new map config object
Param | Type | Description |
---|---|---|
mapResponse | Object |
api response object |
resource | Object |
optional resource object |
Sync geostory components with their live resources on geonode
Sync reources in current geostory or dashboard with their respective sources
Kind: global constant
Param | Type | Description |
---|---|---|
action$ | * |
the actions |
store | Object |
Get geonode resources from within a Geostory
Kind: global constant
Returns: Array
- Array of geonode resources
Param | Type | Description |
---|---|---|
state | Object |
App state |
Get resource type and data for state update in sync process
Kind: global function
Param | Type | Description |
---|---|---|
appType | String |
geostory or dashboard |
resourceData | Object |
Resource Object |
successArr | Array |
Array of success responses only used in case of dashboard |
Get notification title, leve, and message for showNotification
Kind: global function
Param | Type | Description |
---|---|---|
errors | Number |
length of errors array |
successes | Number |
length of success arra |