<mosaica-status>¶
A status line showing whether the map is up to date and how many items it shows.
Use the status line with a map so that viewers know whether what they see is current and how much
of the data it covers. A typical line reads ● | 16,822,190 of 21,406,522 match | 5,390 shown,
where the first figure is the items the filters match out of those the viewer may see. The
figures count the camera's box, or the selected region while there is one. While a highlight is
set, the counts cell reads N highlighted of M.
While the view is up to date, the first cell is a dot alone. When something goes wrong, the cell
names the state and offers a button if the viewer can act, such as Retry when the server is busy.
Sign in appears when the session expires only if you have set reauthorise.
Screen readers announce a refusal or an expiry, because the state cell is an aria-live region.
The counts sit outside it, so they are not read out every time the map pans.
import '@mosaicajs/components/status';
Attributes¶
| Attribute | Property | Type | Default | Description |
|---|---|---|---|---|
expanded |
expanded |
boolean |
false |
Adds a card of the figures below the strip. |
compact |
compact |
boolean |
false |
Shortens the figures to one decimal (16.8M) and drops the shown count. |
viewer-url |
viewerUrl |
string |
'' |
The base URL of the Mosaica viewer server, for the store the element builds: a full URL such as https://maps.example.org, or a path such as /mosaica. Unset, the page's own origin. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store. |
token |
token |
string |
'' |
A viewer token for the store the element builds. Without token or authorise, only an open server (serve.open) answers. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store. |
artifacts-per-tile |
artifactsPerTile |
number | null |
null |
The most artifacts one level of a layer shows per map tile, for the store the element builds. Unset, 50, or the server's selection.max_artifacts_per_tile if lower. A value above that maximum is refused. Read only by the map, the explorer and <mosaica-store>. Changing it builds a new store. |
Properties¶
Set as JavaScript properties; they have no attribute.
| Property | Type | Default | Description |
|---|---|---|---|
reauthorise |
(() => void) | null |
null |
A function the Sign in button calls when the session has expired. Without it there is no Sign in button. |
store |
Store | null |
null |
The store to use, ahead of one from context or one the element would build. The element never disposes it. |
authorise |
TokenSupplier | null |
null |
A function that returns a viewer token, used instead of token and called again before the token expires. A different function builds a new store, so keep it stable across renders. Set it together with viewer-url: a store built from viewer-url alone first sends a request with no token, and is replaced when authorise arrives. |
activeStore |
Store | null |
read-only | The store this element is using, or null if it has none. |
source |
StoreSource |
read-only | Where activeStore came from. |
Methods¶
| Method | Returns | Description |
|---|---|---|
dispose() |
void |
Dispose of the store this element built. Removing the element from the page does not, so call this when you are done with the element. A store you passed in is left to you. |
Events¶
Each bubbles and is composed. Events gives each detail.
| Event | Fired when |
|---|---|
mosaica-statechange |
The panel state changed, including on the first render. |
mosaica-expired |
The session expired. Fires once each time. |
Parts¶
Styled from outside the element with ::part().
| Part | Description |
|---|---|
strip |
The one-line strip. |
state |
The state's dot and words, with data-state set to the panel state. |
refusal |
The words "View refused", or "Server busy", with data-code set to the refusal's code. |
reason |
The server's reason for a refusal, under "View refused". |
refresh |
The Refresh button, shown when the data has changed. |
retry |
The Retry button, after a refusal, no answer or a busy server. |
reauthorise |
The Sign in button, shown on expiry if reauthorise is set. |
count-shown |
The <mosaica-count> of marks shown. |
count-matched |
The <mosaica-count> of items the filters match. |
count-highlighted |
The <mosaica-count> of highlighted items, while a highlight is set. |
count-of |
The matched count the highlighted count is out of, while a highlight is set. |
count-visible |
The <mosaica-count> of items the viewer may see here, which the matched count is out of. |
card |
The card of figures, when expanded is set. |
CSS custom properties¶
The theme tokens apply to this element.