@panoramax/web-viewer 5.0.0-develop-d26305dd → 5.0.0-develop-be5ba1a7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +1 -1
- package/build/cjs/index_photoviewer.js +1 -1
- package/build/esm/components/core/Basic.js +1 -1
- package/build/esm/translations/el.json +92 -1
- package/package.json +1 -1
- package/build/bundle.cjs +0 -3399
- package/build/bundle.cjs.map +0 -1
- package/build/bundle_photoviewer.cjs +0 -2510
- package/build/bundle_photoviewer.cjs.map +0 -1
- package/build/components/core/Basic.css +0 -56
- package/build/components/core/Basic.js +0 -378
- package/build/components/core/CoverageMap.css +0 -10
- package/build/components/core/CoverageMap.js +0 -169
- package/build/components/core/Editor.css +0 -33
- package/build/components/core/Editor.js +0 -398
- package/build/components/core/PhotoViewer.css +0 -70
- package/build/components/core/PhotoViewer.js +0 -650
- package/build/components/core/Viewer.css +0 -130
- package/build/components/core/Viewer.js +0 -711
- package/build/components/core/index.js +0 -10
- package/build/components/index.js +0 -11
- package/build/components/index_photoviewer.js +0 -6
- package/build/components/layout/BottomDrawer.js +0 -258
- package/build/components/layout/CorneredGrid.js +0 -143
- package/build/components/layout/Mini.js +0 -121
- package/build/components/layout/Tabs.js +0 -140
- package/build/components/layout/index.js +0 -9
- package/build/components/menus/LocationPrecisionDoc.js +0 -42
- package/build/components/menus/MapBackground.js +0 -110
- package/build/components/menus/MapFilters.js +0 -567
- package/build/components/menus/MapLayers.js +0 -238
- package/build/components/menus/MapLegend.js +0 -68
- package/build/components/menus/MiniPictureLegend.js +0 -73
- package/build/components/menus/PictureLegend.js +0 -379
- package/build/components/menus/PictureMetadata.js +0 -380
- package/build/components/menus/PlayerOptions.js +0 -93
- package/build/components/menus/QualityScoreDoc.js +0 -42
- package/build/components/menus/ReportForm.js +0 -132
- package/build/components/menus/SemanticsDoc.js +0 -38
- package/build/components/menus/SemanticsDownload.js +0 -33
- package/build/components/menus/SemanticsFilters.js +0 -153
- package/build/components/menus/SemanticsList.js +0 -413
- package/build/components/menus/SemanticsMetadata.js +0 -368
- package/build/components/menus/Share.js +0 -105
- package/build/components/menus/index.js +0 -22
- package/build/components/menus/index_photoviewer.js +0 -11
- package/build/components/styles.js +0 -557
- package/build/components/ui/AnnotationsSwitch.js +0 -159
- package/build/components/ui/Button.js +0 -77
- package/build/components/ui/ButtonGroup.css +0 -59
- package/build/components/ui/ButtonGroup.js +0 -69
- package/build/components/ui/CopyButton.js +0 -110
- package/build/components/ui/Grade.js +0 -54
- package/build/components/ui/GradeFilter.js +0 -122
- package/build/components/ui/IconSwitch.js +0 -193
- package/build/components/ui/LinkButton.js +0 -67
- package/build/components/ui/ListGroup.js +0 -66
- package/build/components/ui/ListItem.js +0 -90
- package/build/components/ui/Loader.js +0 -203
- package/build/components/ui/Map.css +0 -63
- package/build/components/ui/Map.js +0 -853
- package/build/components/ui/MapMore.js +0 -175
- package/build/components/ui/Photo.css +0 -50
- package/build/components/ui/Photo.js +0 -1502
- package/build/components/ui/Popup.js +0 -145
- package/build/components/ui/ProgressBar.js +0 -104
- package/build/components/ui/QualityScore.js +0 -147
- package/build/components/ui/SearchBar.js +0 -374
- package/build/components/ui/SemanticsEditor.js +0 -191
- package/build/components/ui/SemanticsTable.js +0 -88
- package/build/components/ui/Switch.js +0 -139
- package/build/components/ui/TogglableGroup.js +0 -157
- package/build/components/ui/index.js +0 -29
- package/build/components/ui/index_photoviewer.js +0 -21
- package/build/components/ui/widgets/CopyCoordinates.js +0 -75
- package/build/components/ui/widgets/GeoSearch.css +0 -21
- package/build/components/ui/widgets/GeoSearch.js +0 -150
- package/build/components/ui/widgets/Legend.js +0 -190
- package/build/components/ui/widgets/LevelSelect.css +0 -51
- package/build/components/ui/widgets/LevelSelect.js +0 -143
- package/build/components/ui/widgets/MapFiltersButton.js +0 -114
- package/build/components/ui/widgets/MapLayersButton.js +0 -79
- package/build/components/ui/widgets/OSMEditors.js +0 -155
- package/build/components/ui/widgets/PictureLegendActions.js +0 -99
- package/build/components/ui/widgets/Player.css +0 -7
- package/build/components/ui/widgets/Player.js +0 -154
- package/build/components/ui/widgets/SemanticsFiltersButton.js +0 -65
- package/build/components/ui/widgets/Zoom.js +0 -84
- package/build/components/ui/widgets/index.js +0 -16
- package/build/components/ui/widgets/index_photoviewer.js +0 -7
- package/build/img/arrow_360.svg +0 -14
- package/build/img/arrow_flat.svg +0 -11
- package/build/img/arrow_triangle.svg +0 -9
- package/build/img/arrow_turn.svg +0 -8
- package/build/img/bg_aerial.jpg +0 -0
- package/build/img/bg_streets.jpg +0 -0
- package/build/img/loader_base.jpg +0 -0
- package/build/img/logo_dead.svg +0 -91
- package/build/img/marker.svg +0 -17
- package/build/img/marker_blue.svg +0 -20
- package/build/img/osm.svg +0 -49
- package/build/img/panoramax.svg +0 -13
- package/build/img/switch_big.svg +0 -54
- package/build/img/switch_mini.svg +0 -48
- package/build/img/wd.svg +0 -1
- package/build/index_photoviewer.js +0 -4
- package/build/package.json +0 -148
- package/build/servers.js +0 -14
- package/build/translations/ar.json +0 -1
- package/build/translations/be.json +0 -257
- package/build/translations/br.json +0 -81
- package/build/translations/cy.json +0 -117
- package/build/translations/da.json +0 -300
- package/build/translations/de.json +0 -309
- package/build/translations/en.json +0 -294
- package/build/translations/eo.json +0 -235
- package/build/translations/es.json +0 -292
- package/build/translations/fi.json +0 -1
- package/build/translations/fr.json +0 -294
- package/build/translations/hr.json +0 -294
- package/build/translations/hu.json +0 -294
- package/build/translations/it.json +0 -306
- package/build/translations/ja.json +0 -182
- package/build/translations/ko.json +0 -1
- package/build/translations/nl.json +0 -305
- package/build/translations/nn.json +0 -1
- package/build/translations/pl.json +0 -169
- package/build/translations/pt.json +0 -296
- package/build/translations/pt_BR.json +0 -304
- package/build/translations/sv.json +0 -182
- package/build/translations/ti.json +0 -9
- package/build/translations/tr.json +0 -297
- package/build/translations/uk.json +0 -268
- package/build/translations/zh_Hant.json +0 -309
- package/build/utils/API.js +0 -928
- package/build/utils/InitParameters.js +0 -521
- package/build/utils/MapStyleComposer.js +0 -889
- package/build/utils/PanoraMapProtocol.js +0 -49
- package/build/utils/PhotoAdapter.js +0 -49
- package/build/utils/PresetsManager.js +0 -148
- package/build/utils/SemanticsMapProtocol.js +0 -144
- package/build/utils/URLHandler.js +0 -426
- package/build/utils/geocoder.js +0 -203
- package/build/utils/i18n.js +0 -128
- package/build/utils/index.js +0 -17
- package/build/utils/index_photoviewer.js +0 -14
- package/build/utils/indoor.js +0 -200
- package/build/utils/map.js +0 -788
- package/build/utils/picture.js +0 -507
- package/build/utils/semantics.js +0 -321
- package/build/utils/services.js +0 -148
- package/build/utils/utils.js +0 -433
- package/build/utils/widgets.js +0 -110
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
import { btn } from "../styles.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Link Button element displays a HTML `<a>` anchor with a button style.
|
|
6
|
-
* @class Panoramax.components.ui.LinkButton
|
|
7
|
-
* @element pnx-link-button
|
|
8
|
-
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
9
|
-
* @example
|
|
10
|
-
* ```html
|
|
11
|
-
* <pnx-link-button
|
|
12
|
-
* title="Redirect to other website"
|
|
13
|
-
* kind="outline"
|
|
14
|
-
* href="https://panoramax.fr"
|
|
15
|
-
* target="_blank"
|
|
16
|
-
* >
|
|
17
|
-
* Click to go on Panoramax
|
|
18
|
-
* </pnx-link-button>
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export default class LinkButton extends LitElement {
|
|
22
|
-
/** @private */
|
|
23
|
-
static styles = btn;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Component properties.
|
|
27
|
-
* @memberof Panoramax.components.ui.LinkButton#
|
|
28
|
-
* @type {Object}
|
|
29
|
-
* @property {string} [href] The URL the button should navigate to when clicked
|
|
30
|
-
* @property {string} [target] Specifies where to open the linked document (e.g., '_blank')
|
|
31
|
-
* @property {string} [title] Tooltip text displayed when hovering over the button
|
|
32
|
-
* @property {string} [download] Indicates if the linked resource should be downloaded
|
|
33
|
-
* @property {string} [class] Custom CSS class for additional styling
|
|
34
|
-
* @property {string} [kind=full] The style variation of the button (full, fullwarn, fullsuccess, outline, flat, superflat)
|
|
35
|
-
* @property {string} [size=md] The size of the button (sm, md, l, xl, xxl)
|
|
36
|
-
*/
|
|
37
|
-
static properties = {
|
|
38
|
-
href: { type: String },
|
|
39
|
-
target: { type: String },
|
|
40
|
-
title: { type: String },
|
|
41
|
-
download: { type: String },
|
|
42
|
-
class: { type: String },
|
|
43
|
-
kind: {type: String},
|
|
44
|
-
size: {type: String},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
constructor() {
|
|
48
|
-
super();
|
|
49
|
-
this.kind = "full";
|
|
50
|
-
this.size = "md";
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** @private */
|
|
54
|
-
render() {
|
|
55
|
-
const a = document.createElement("a");
|
|
56
|
-
a.setAttribute("part", "btn");
|
|
57
|
-
this.constructor.observedAttributes
|
|
58
|
-
.filter(k => this[k] !== undefined)
|
|
59
|
-
.forEach(k => a.setAttribute(k, this[k]));
|
|
60
|
-
a.classList.add("pnx-btn", `pnx-btn-${this.kind}`, `pnx-btn-${this.size}`);
|
|
61
|
-
const slot = document.createElement("slot");
|
|
62
|
-
a.appendChild(slot);
|
|
63
|
-
return a;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
customElements.define("pnx-link-button", LinkButton);
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { panel } from "../styles.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* List Group element displays a menu having a list of rapid actions (links, buttons).
|
|
6
|
-
*
|
|
7
|
-
* Note that you may only want to use basic HTML elements (`a`, `button`) instead of Panoramax ones.
|
|
8
|
-
* The list group overrides style, so using `pnx-*` component may conflict on styling.
|
|
9
|
-
* @class Panoramax.components.ui.ListGroup
|
|
10
|
-
* @element pnx-list-group
|
|
11
|
-
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
12
|
-
* @slot `default` Any element you want to add in list.
|
|
13
|
-
* @example
|
|
14
|
-
* ```html
|
|
15
|
-
* <pnx-list-group>
|
|
16
|
-
* <a href="https://web.site/">First link</a>
|
|
17
|
-
* <button>Second button</button>
|
|
18
|
-
* </pnx-list-group>
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export default class ListGroup extends LitElement {
|
|
22
|
-
/** @private */
|
|
23
|
-
static styles = [ panel, css`
|
|
24
|
-
:host ::slotted(*) {
|
|
25
|
-
text-decoration: none;
|
|
26
|
-
border: none;
|
|
27
|
-
border-bottom: 1px solid var(--widget-border-div);
|
|
28
|
-
background: none;
|
|
29
|
-
display: block;
|
|
30
|
-
width: 100%;
|
|
31
|
-
color: var(--widget-font);
|
|
32
|
-
font-family: var(--font-family);
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
font-size: 1em;
|
|
35
|
-
font-weight: 400;
|
|
36
|
-
line-height: 18px;
|
|
37
|
-
padding: 5px 10px;
|
|
38
|
-
min-width: 150px;
|
|
39
|
-
width: 100%;
|
|
40
|
-
text-align: left;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:host ::slotted(*:hover) {
|
|
45
|
-
background-color: var(--widget-bg-hover);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:host ::slotted(*:first-child) {
|
|
49
|
-
border-top-left-radius: 5px;
|
|
50
|
-
border-top-right-radius: 5px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
:host ::slotted(*:last-child) {
|
|
54
|
-
border: none;
|
|
55
|
-
border-bottom-left-radius: 5px;
|
|
56
|
-
border-bottom-right-radius: 5px;
|
|
57
|
-
}
|
|
58
|
-
` ];
|
|
59
|
-
|
|
60
|
-
/** @private */
|
|
61
|
-
render() {
|
|
62
|
-
return html`<slot></slot>`;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
customElements.define("pnx-list-group", ListGroup);
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ListItem is a list entry, in a Material Design fashion.
|
|
5
|
-
* @class Panoramax.components.ui.ListItem
|
|
6
|
-
* @element pnx-list-item
|
|
7
|
-
* @slot `icon` The left icon (symbol for this item)
|
|
8
|
-
* @slot `action` The right icon (symbol for an interactive action)
|
|
9
|
-
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
10
|
-
* @example
|
|
11
|
-
* ```html
|
|
12
|
-
* <pnx-list-item title="My feature" subtitle="It is very cool">
|
|
13
|
-
* <img src="..." slot="icon" />
|
|
14
|
-
* <img src="..." slot="action" />
|
|
15
|
-
* </pnx-list-item>
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export default class ListItem extends LitElement {
|
|
19
|
-
/** @private */
|
|
20
|
-
static styles = css`
|
|
21
|
-
.list-item {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
padding: 8px 16px;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
border-bottom: 1px solid #ddd;
|
|
27
|
-
font-family: var(--font-family);
|
|
28
|
-
background: var(--white);
|
|
29
|
-
min-height: 40px;
|
|
30
|
-
box-sizing: border-box;
|
|
31
|
-
}
|
|
32
|
-
.list-item:hover { background: var(--widget-bg-hover); }
|
|
33
|
-
.icon {
|
|
34
|
-
margin-right: 16px;
|
|
35
|
-
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
|
-
gap: 10px;
|
|
38
|
-
position: relative;
|
|
39
|
-
}
|
|
40
|
-
.action {
|
|
41
|
-
margin-left: 16px;
|
|
42
|
-
display: flex;
|
|
43
|
-
gap: 5px;
|
|
44
|
-
}
|
|
45
|
-
.content {
|
|
46
|
-
flex: 1;
|
|
47
|
-
}
|
|
48
|
-
.title {
|
|
49
|
-
font-weight: 600;
|
|
50
|
-
}
|
|
51
|
-
.subtitle {
|
|
52
|
-
font-size: 0.9em;
|
|
53
|
-
color: var(--grey-dark);
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Component properties.
|
|
59
|
-
* @memberof Panoramax.components.ui.ListItem#
|
|
60
|
-
* @type {Object}
|
|
61
|
-
* @property {string} title The item title
|
|
62
|
-
* @property {string} [subtitle] The item subtitle
|
|
63
|
-
* @property {string} [tooltip] A display-on-hover label
|
|
64
|
-
*/
|
|
65
|
-
static properties = {
|
|
66
|
-
title: { type: String },
|
|
67
|
-
subtitle: { type: String },
|
|
68
|
-
tooltip: { type: String },
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/** @private */
|
|
72
|
-
render() {
|
|
73
|
-
return html`
|
|
74
|
-
<div class="list-item" title=${this.tooltip}>
|
|
75
|
-
<div class="icon">
|
|
76
|
-
<slot name="icon"></slot>
|
|
77
|
-
</div>
|
|
78
|
-
<div class="content">
|
|
79
|
-
<div class="title">${this.title}</div>
|
|
80
|
-
<div class="subtitle">${this.subtitle}</div>
|
|
81
|
-
</div>
|
|
82
|
-
<div class="action">
|
|
83
|
-
<slot name="action"></slot>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
customElements.define("pnx-list-item", ListItem);
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html, nothing, unsafeCSS } from "lit";
|
|
2
|
-
import { inRangeRandom } from "../../utils/utils.js";
|
|
3
|
-
|
|
4
|
-
const LogoDead = await fetch(new URL("../../img/logo_dead.svg", import.meta.url).href).then(res => res.text());
|
|
5
|
-
const LoaderBg = new URL("../../img/loader_base.jpg", import.meta.url).href;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Loader component display a full page covering for user waiting.
|
|
9
|
-
* @class Panoramax.components.ui.Loader
|
|
10
|
-
* @element pnx-loader
|
|
11
|
-
* @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
|
|
12
|
-
* @example
|
|
13
|
-
* ```html
|
|
14
|
-
* <pnx-loader ._parent=${this.viewer} />
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export default class Loader extends LitElement {
|
|
18
|
-
/** @private */
|
|
19
|
-
static styles = css`
|
|
20
|
-
:host {
|
|
21
|
-
position: absolute;
|
|
22
|
-
inset: 0;
|
|
23
|
-
display: flex;
|
|
24
|
-
flex-direction: column;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
gap: 10px;
|
|
27
|
-
align-items: center;
|
|
28
|
-
background-image: url('${unsafeCSS(LoaderBg)}');
|
|
29
|
-
background-repeat: no-repeat;
|
|
30
|
-
background-size: cover;
|
|
31
|
-
background-position: center;
|
|
32
|
-
z-index: 200;
|
|
33
|
-
font-family: var(--font-family);
|
|
34
|
-
font-weight: 550;
|
|
35
|
-
color: var(--black);
|
|
36
|
-
font-size: 1.4em;
|
|
37
|
-
text-align: center;
|
|
38
|
-
visibility: hidden;
|
|
39
|
-
opacity: 0;
|
|
40
|
-
}
|
|
41
|
-
:host(*[visible]) {
|
|
42
|
-
visibility: visible;
|
|
43
|
-
opacity: 1;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
div.label {
|
|
47
|
-
background-color: rgba(255,255,255,0.5);
|
|
48
|
-
box-shadow: white 0 0 10px;
|
|
49
|
-
padding: 3px 10px;
|
|
50
|
-
border-radius: 50px;
|
|
51
|
-
}
|
|
52
|
-
/* Logo */
|
|
53
|
-
img.logo-dead { width: 100px; }
|
|
54
|
-
`;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Component properties.
|
|
58
|
-
* @memberof Panoramax.components.ui.Loader#
|
|
59
|
-
* @type {Object}
|
|
60
|
-
* @property {boolean} [visible=true] Is the loader visible to user ?
|
|
61
|
-
* @property {boolean} [no-label=false] Set to true to avoid loading label display
|
|
62
|
-
* @property {number} [value] Progress bar percentage (0-100)
|
|
63
|
-
*/
|
|
64
|
-
static properties = {
|
|
65
|
-
_mode: {state: true},
|
|
66
|
-
_label: {state: true},
|
|
67
|
-
_isLabelFun: {state: true},
|
|
68
|
-
visible: {type: Boolean, reflect: true},
|
|
69
|
-
"no-label": {type: Boolean},
|
|
70
|
-
value: {type: Number},
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
this.visible = true;
|
|
76
|
-
this["no-label"] = false;
|
|
77
|
-
this._mode = "loading";
|
|
78
|
-
this._isLabelFun = false;
|
|
79
|
-
this.value = -1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** @private */
|
|
83
|
-
connectedCallback() {
|
|
84
|
-
super.connectedCallback();
|
|
85
|
-
this._nextLabel();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Is the loader currently visible ?
|
|
90
|
-
* @returns {boolean} True if visible
|
|
91
|
-
* @memberof Panoramax.components.ui.Loader#
|
|
92
|
-
*/
|
|
93
|
-
isVisible() {
|
|
94
|
-
return this.visible;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Dismiss loader, or show error
|
|
99
|
-
* @param {object} [err] Optional error object to show in browser console
|
|
100
|
-
* @param {str} [errMeaningful] Optional error message to show to user
|
|
101
|
-
* @param {fct} [next] Optional function to run after loader dismiss
|
|
102
|
-
* @memberof Panoramax.components.ui.Loader#
|
|
103
|
-
*/
|
|
104
|
-
dismiss(err = null, errMeaningful = null, next = null) {
|
|
105
|
-
clearTimeout(this._loaderLabelChanger);
|
|
106
|
-
|
|
107
|
-
if(!err) {
|
|
108
|
-
this.value = 100;
|
|
109
|
-
this._mode = "done";
|
|
110
|
-
this.visible = false;
|
|
111
|
-
this.style.transition = "all 0.5s";
|
|
112
|
-
setTimeout(() => {
|
|
113
|
-
if(this.parentNode) { this.parentNode.removeChild(this); }
|
|
114
|
-
}, 2000);
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Event when component is ready to use.
|
|
118
|
-
* This happens when loader screen disappear, with picture and map loaded.
|
|
119
|
-
*
|
|
120
|
-
* To follow more precisely loading steps, you can also watch for sub-components `ready` events.
|
|
121
|
-
* ```js
|
|
122
|
-
* // Watch API-readiness
|
|
123
|
-
* viewer.addEventListener("api:ready", ...); // From parent
|
|
124
|
-
* viewer.api.addEventListener("ready", ...); // Or on sub-component
|
|
125
|
-
* ```
|
|
126
|
-
* @event Panoramax.components.core.Basic#ready
|
|
127
|
-
* @type {CustomEvent}
|
|
128
|
-
*/
|
|
129
|
-
const readyEvt = new CustomEvent("ready");
|
|
130
|
-
this._parent.dispatchEvent(readyEvt);
|
|
131
|
-
|
|
132
|
-
if(next) { next(); }
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
if(err !== true) { console.error(err); }
|
|
136
|
-
|
|
137
|
-
let errHtml = [ this._parent?._t.pnx.error, html`<br />` ];
|
|
138
|
-
|
|
139
|
-
if(errMeaningful) { errHtml.push(errMeaningful, html`<br />`); }
|
|
140
|
-
|
|
141
|
-
if(next) {
|
|
142
|
-
errHtml.push(html`<pnx-button kind="full">${this._parent?._t.pnx.error_click}</pnx-button>`);
|
|
143
|
-
this.addEventListener("click", next);
|
|
144
|
-
}
|
|
145
|
-
else { errHtml.push(html`<small>${this._parent?._t.pnx.error_retry}</small>`); }
|
|
146
|
-
|
|
147
|
-
this._mode = "error";
|
|
148
|
-
this._label = errHtml;
|
|
149
|
-
|
|
150
|
-
const errLabel = errMeaningful || "Panoramax JS had a blocking exception";
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Event for viewer failing to initially load.
|
|
154
|
-
*
|
|
155
|
-
* To follow more precisely loading failures, you can also watch for sub-components `broken` events.
|
|
156
|
-
* ```js
|
|
157
|
-
* // Watch API breaks
|
|
158
|
-
* viewer.addEventListener("api:broken", ...); // From parent
|
|
159
|
-
* viewer.api.addEventListener("broken", ...); // Or on sub-component
|
|
160
|
-
* ```
|
|
161
|
-
* @event Panoramax.components.core.Basic#broken
|
|
162
|
-
* @type {CustomEvent}
|
|
163
|
-
* @property {string} detail.error The user-friendly error message to display
|
|
164
|
-
*/
|
|
165
|
-
const brokenEvt = new CustomEvent("broken", {
|
|
166
|
-
detail: { error: errLabel }
|
|
167
|
-
});
|
|
168
|
-
this._parent.dispatchEvent(brokenEvt);
|
|
169
|
-
|
|
170
|
-
// Throw error
|
|
171
|
-
throw new Error(errLabel);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/** @private */
|
|
176
|
-
_nextLabel() {
|
|
177
|
-
if(!this._isLabelFun) {
|
|
178
|
-
this._label = this._parent?._t.pnx.loading_labels_serious[inRangeRandom(0, this._parent?._t.pnx.loading_labels_serious.length-1)];
|
|
179
|
-
this._isLabelFun = true;
|
|
180
|
-
}
|
|
181
|
-
else {
|
|
182
|
-
this._label = this._parent?._t.pnx.loading_labels_fun[inRangeRandom(0, this._parent?._t.pnx.loading_labels_fun.length-1)];
|
|
183
|
-
}
|
|
184
|
-
this._loaderLabelChanger = setTimeout(this._nextLabel.bind(this), inRangeRandom(500, 1500));
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/** @private */
|
|
188
|
-
render() {
|
|
189
|
-
if(this._mode === "error") {
|
|
190
|
-
return html`
|
|
191
|
-
<img class="logo-dead" src=${LogoDead} alt="" title=${this._parent?._t.map.loading} />
|
|
192
|
-
${this._label}
|
|
193
|
-
`;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return html`
|
|
197
|
-
<pnx-progress-bar .value=${this.value}></pnx-progress-bar>
|
|
198
|
-
${this["no-label"] ? nothing : html`<div class="label">${this._label}</div>`}
|
|
199
|
-
`;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
customElements.define("pnx-loader", Loader);
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
.maplibregl-map.pnx-map {
|
|
2
|
-
background: white;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
/* Picture thumbnail on map */
|
|
6
|
-
.maplibregl-popup-content {
|
|
7
|
-
padding: 5px !important;
|
|
8
|
-
position: relative;
|
|
9
|
-
pointer-events: none !important;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.pnx-map-thumb {
|
|
13
|
-
display: inline-block;
|
|
14
|
-
text-align: center;
|
|
15
|
-
vertical-align: middle;
|
|
16
|
-
max-width: 130px;
|
|
17
|
-
max-height: 130px;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@keyframes rotating {
|
|
21
|
-
from { transform: rotate(0deg); }
|
|
22
|
-
to { transform: rotate(360deg); }
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.pnx-map-thumb-loader {
|
|
26
|
-
background-color: rgb(230,230,230);
|
|
27
|
-
border-radius: 65px;
|
|
28
|
-
max-height: 60px;
|
|
29
|
-
margin: 5px 35px;
|
|
30
|
-
animation: rotating 2s linear infinite;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.pnx-map-thumb-legend {
|
|
34
|
-
display: block;
|
|
35
|
-
position: absolute;
|
|
36
|
-
bottom: 5px;
|
|
37
|
-
right: 5px;
|
|
38
|
-
left: 5px;
|
|
39
|
-
background-color: rgba(0,0,0,0.8);
|
|
40
|
-
color: white;
|
|
41
|
-
text-align: center;
|
|
42
|
-
font-style: italic;
|
|
43
|
-
font-size: 0.8em;
|
|
44
|
-
margin: 0;
|
|
45
|
-
padding: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.maplibregl-marker {
|
|
49
|
-
width: 60px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/* Resize canvas for print */
|
|
53
|
-
@media print {
|
|
54
|
-
.pnx-map.maplibregl-map .maplibregl-canvas-container {
|
|
55
|
-
width: 100% !important;
|
|
56
|
-
height: unset !important;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Discard default indoor= widget */
|
|
61
|
-
.pnx-map .maplibregl-ctrl-indoorequal {
|
|
62
|
-
display: none;
|
|
63
|
-
}
|