Skip to content

Commit

Permalink
Add layer disclaimer docs (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobQuincey-DC authored Dec 20, 2024
1 parent c02dc97 commit beb7d12
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
14 changes: 14 additions & 0 deletions docs/db/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Layers are pretty configurable, and have lots of various options, some of which
| LayerSourceOption | Contains the details about where a layer comes from and the options that will be applied to it |
| LayerSourceType | Lookup list describing the types of layers available. **This should not be edited as it is tied directly to the application code** |
| CategoryLayer | Mapping between layers and the categories they are added to |
| LayerDisclaimers | List of disclaimers that can be added to a layer |

## Adding a layer

Expand Down Expand Up @@ -124,6 +125,7 @@ Once this has been created, the layer table has the following fields to fill in:
- `Filterable` - A Boolean indicating if the user is allowed to apply filters to this layer
- `ProxyMapRequests` - A Boolean indicating if all GetMap requests should be proxied via the [application proxy](../db/proxy.md). Only use this if a remote layer can't handle CORS requests (errors will appear in the console and layer control when using this layer if this is the case). See [Proxying](../db/proxy.md) for more details
- `ProxyMetaRequests` - As above, but related to all metadata and query requests, such as `GetCapabilities` and `GetFeatureInfo`. See [Proxying](../db/proxy.md) for more details
- `LayerDisclaimerId` - An optional `Id` from the [`Layer Disclaimers`](#layer-disclaimers) table that defines which disclaimer to show for this layer. Leave blank for no disclaimer

#### Info Templates

Expand Down Expand Up @@ -178,3 +180,15 @@ XYZ layers can be provided in different projections. To make use of on the fly r
"origin": [-238375.0, 1376256.0]
}
```

## Layer Disclaimers

You can add popup disclaimers to your layers that show when a user turns on a layer. The first step is to add a new disclaimer with the details you need.

- `Name` - A friendly name for administrators
- `Disclaimer` - The disclaimer to show. This can be plain text or HTML
- `Frequency` - A number indicating how often to show the disclaimer. Available options are:
- `-1` - Indicates that the disclaimer should only be shown once, and never again
- `0` - Indicates that the disclaimer should be shown once per browsing session. Refreshes do not count as a new session, but new tabs do. This prevents users from constantly being bombarded with the message every time they turn the layer on/off
- `Any positive number` - Indicates the number of days to leave between showing the disclaimer again.
- `Dismiss Text` - Optional text to show on the dismiss button. Defaults to 'Close' if you leave it blank
34 changes: 32 additions & 2 deletions docs/gui/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,14 @@ This section is where you add in the details for your layers. Select **Add new l
- Queryable - whether you want the layer to be queryable (clicking on a feature will display further information)
- Filterable - whether you want the layer to be filterable

You'll also see a button for *Advanced settings*, which are optional. You can change the default opacity and saturation here if you want to.
You'll also see a button for *Advanced settings*, which are optional.

- Disclaimer: The disclaimer to show when this layer is turned on. See [Layer Disclaimers](#layer-disclaimers).
- Restricted bounds: Allows you to prevent a layer from being rendered or query outside of the defined bounds
- Opacity/Saturation: Set the default starting opacity and saturation of this layer. Can be overridden by [Layer Customisations](../gui/versions.md#layer-customisations) or via the URL permalink
- Default filter is editable: If a layer has a filter applied to it via a CQL_FILTER, ticking this box allows users to edit that filter. Be default, that filter will be 'locked' and can't be edited by users
- Proxy Map Requests: Allows you to get round server CORS issues by proxying the requests via the in-built proxy server
- Proxy Metadata Requests: Allows you to get round server CORS issues by proxying the requests via the in-built proxy server

### Layer categories

Expand All @@ -289,4 +296,27 @@ Select the section then layer you want to edit. Make the changes you want and hi

## Delete a layer

Select the section then layer you want to delete. You will be asked if you're sure, press Delete again to confirm.
Select the section then layer you want to delete. You will be asked if you're sure, press Delete again to confirm.

## Layer Disclaimers

You can add popup disclaimers to your layers that show when a user turns on a layer. The first step is to add a new disclaimer with the details you need.

- Name: A friendly name for administrators
- Disclaimer: The disclaimer to show. This can be plain text or HTML
- Frequency: How often you want the disclaimer to show. The options are:
- Just once: Will only show once in that browser
- Always (once per session): Will show a maximum of once per browsing session. Refreshes do not count as a new session, but new tabs do. This prevents users from constantly being bombarded with the message every time they turn the layer on/off
- Once a (day/week/month etc.): Shows once per period shown
- Dismiss Text: Optional text to show on the dismiss button. Defaults to 'Close' if you leave it blank

Once you've created the disclaimer, you can go to your layer and set the disclaimer in the [Advanced settings](#layer-details) of the layer.

Disclaimers work using the browsers localStorage and sessionStorage. If a user changes browser, or clears their localStorage, they will see the disclaimer again.

!!! tip
Multiple layers can share the same disclaimer. This not only saves you from having to write multiple similar disclaimers, it also allows you to 'bundle' disclaimers together, so if you have a bunch of layers that all need the same disclaimer, the user will only see the warning once, not for every layer they click

!!! warning "Limitations"
If a layer is already turned on (either through layer customisations or via a share link) the disclaimer will not trigger unless the user turns the layer off and back on. This is to prevent being potentially bombarded with disclaimers on first load.

0 comments on commit beb7d12

Please sign in to comment.