new module:Permalink(initialConfig, initialPermalink)
Creates a Permalink instance
Parameters:
| Name | Type | Description |
|---|---|---|
initialConfig |
Config | The lizmap initial config instance |
initialPermalink |
null | object | Initial permalink startup object |
- Source:
Classes
Members
_shortLinkPermalink :boolean
Permalink is managed via short link
Type:
- boolean
- Source:
currentPermalinkId
Setting the current permalink hash
- Source:
currentPermalinkId :string
Getting the current permalink hash
Type:
- string
- Source:
currentPermalinkProperties
Stores the current permalink properties in local storage when short link permalink is enabled
- Source:
currentPermalinkProperties :object
Retrieves the current permalink properties from local storage
Type:
- object
- Source:
permalinksHistory
Stores the permalink history in the local storage
- Source:
permalinksHistory :Array
Get history records
Type:
- Array
- Source:
Methods
(async) _addShortLinkPermalink() → {Promise.<(null|string)>}
Adds a new short link permalink for the given repository and project
- Source:
Returns:
The permalink hash or null in case of errors
- Type
- Promise.<(null|string)>
_attachComponentEvents() → {void}
Defines events on UI components
- Source:
Returns:
- Type
- void
_clearPermalinkHistory() → {void}
Removes permalink history from local storage
- Source:
Returns:
- Type
- void
_copyToClipboard(link) → {void}
Copy the permalink link to clipboard
Parameters:
| Name | Type | Description |
|---|---|---|
link |
string | the permalink url |
- Source:
Returns:
- Type
- void
(async) _createNewPermalink(e) → {void}
Creates a new permalink short link and updates UI.
Parameters:
| Name | Type | Description |
|---|---|---|
e |
Event | click event |
- Source:
Returns:
- Type
- void
_enableNewPermalinkButton() → {void}
Enables the add paermalink button.
- Source:
Returns:
- Type
- void
_getPermalinkValues() → {Array}
Parse permalink hash
- Source:
Returns:
The array of permalink parameters
- Type
- Array
_getShortLinkPermalinkUrl() → {string}
Returns the permalink url
- Source:
Returns:
The permalink url
- Type
- string
_renderHistoryTemplate(mode) → {void}
Renders the history template on client
Parameters:
| Name | Type | Description |
|---|---|---|
mode |
string | update mode, 'a' = permalink added, 'd' = permalink deletes, '' = refresh only |
- Source:
Returns:
- Type
- void
_resetPermalinkSymbology(layerName) → {void}
Reset current permalink symbology information
Parameters:
| Name | Type | Description |
|---|---|---|
layerName |
string | the layer name |
- Source:
Returns:
- Type
- void
(async) _runPermalink(setExtent, useInitialPermalink) → {Promise.<void>}
Runs the permalink to update the map
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
setExtent |
boolean | whether set the map extent or not |
|
useInitialPermalink |
boolean | false | whether ignore permalink hash and use initial permalink |
- Source:
Returns:
- Type
- Promise.<void>
_sharePermalink() → {void}
Updates component UI for share functionality
- Source:
Returns:
- Type
- void
_updatePermalinkHistory(plink, mode) → {void}
Updates the local permalink history
Parameters:
| Name | Type | Description |
|---|---|---|
plink |
string | the permalink hash |
mode |
string | update mode, 'a' = add, 'd' = delete, '' = refresh only |
- Source:
Returns:
- Type
- void
_writeURLFragment() → {void}
Writes the hash. If the short link permalink functionality is enabled, stores the permalink information in the local storage
- Source:
Returns:
- Type
- void
(async, static) getPermalink(permalinkId) → {Promise.<object>}
Get permalink from server
Parameters:
| Name | Type | Description |
|---|---|---|
permalinkId |
string | the permalink hash |
- Source:
Returns:
The permalink object or the error object
- Type
- Promise.<object>