@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.
Files changed (153) hide show
  1. package/build/cjs/index.js +1 -1
  2. package/build/cjs/index_photoviewer.js +1 -1
  3. package/build/esm/components/core/Basic.js +1 -1
  4. package/build/esm/translations/el.json +92 -1
  5. package/package.json +1 -1
  6. package/build/bundle.cjs +0 -3399
  7. package/build/bundle.cjs.map +0 -1
  8. package/build/bundle_photoviewer.cjs +0 -2510
  9. package/build/bundle_photoviewer.cjs.map +0 -1
  10. package/build/components/core/Basic.css +0 -56
  11. package/build/components/core/Basic.js +0 -378
  12. package/build/components/core/CoverageMap.css +0 -10
  13. package/build/components/core/CoverageMap.js +0 -169
  14. package/build/components/core/Editor.css +0 -33
  15. package/build/components/core/Editor.js +0 -398
  16. package/build/components/core/PhotoViewer.css +0 -70
  17. package/build/components/core/PhotoViewer.js +0 -650
  18. package/build/components/core/Viewer.css +0 -130
  19. package/build/components/core/Viewer.js +0 -711
  20. package/build/components/core/index.js +0 -10
  21. package/build/components/index.js +0 -11
  22. package/build/components/index_photoviewer.js +0 -6
  23. package/build/components/layout/BottomDrawer.js +0 -258
  24. package/build/components/layout/CorneredGrid.js +0 -143
  25. package/build/components/layout/Mini.js +0 -121
  26. package/build/components/layout/Tabs.js +0 -140
  27. package/build/components/layout/index.js +0 -9
  28. package/build/components/menus/LocationPrecisionDoc.js +0 -42
  29. package/build/components/menus/MapBackground.js +0 -110
  30. package/build/components/menus/MapFilters.js +0 -567
  31. package/build/components/menus/MapLayers.js +0 -238
  32. package/build/components/menus/MapLegend.js +0 -68
  33. package/build/components/menus/MiniPictureLegend.js +0 -73
  34. package/build/components/menus/PictureLegend.js +0 -379
  35. package/build/components/menus/PictureMetadata.js +0 -380
  36. package/build/components/menus/PlayerOptions.js +0 -93
  37. package/build/components/menus/QualityScoreDoc.js +0 -42
  38. package/build/components/menus/ReportForm.js +0 -132
  39. package/build/components/menus/SemanticsDoc.js +0 -38
  40. package/build/components/menus/SemanticsDownload.js +0 -33
  41. package/build/components/menus/SemanticsFilters.js +0 -153
  42. package/build/components/menus/SemanticsList.js +0 -413
  43. package/build/components/menus/SemanticsMetadata.js +0 -368
  44. package/build/components/menus/Share.js +0 -105
  45. package/build/components/menus/index.js +0 -22
  46. package/build/components/menus/index_photoviewer.js +0 -11
  47. package/build/components/styles.js +0 -557
  48. package/build/components/ui/AnnotationsSwitch.js +0 -159
  49. package/build/components/ui/Button.js +0 -77
  50. package/build/components/ui/ButtonGroup.css +0 -59
  51. package/build/components/ui/ButtonGroup.js +0 -69
  52. package/build/components/ui/CopyButton.js +0 -110
  53. package/build/components/ui/Grade.js +0 -54
  54. package/build/components/ui/GradeFilter.js +0 -122
  55. package/build/components/ui/IconSwitch.js +0 -193
  56. package/build/components/ui/LinkButton.js +0 -67
  57. package/build/components/ui/ListGroup.js +0 -66
  58. package/build/components/ui/ListItem.js +0 -90
  59. package/build/components/ui/Loader.js +0 -203
  60. package/build/components/ui/Map.css +0 -63
  61. package/build/components/ui/Map.js +0 -853
  62. package/build/components/ui/MapMore.js +0 -175
  63. package/build/components/ui/Photo.css +0 -50
  64. package/build/components/ui/Photo.js +0 -1502
  65. package/build/components/ui/Popup.js +0 -145
  66. package/build/components/ui/ProgressBar.js +0 -104
  67. package/build/components/ui/QualityScore.js +0 -147
  68. package/build/components/ui/SearchBar.js +0 -374
  69. package/build/components/ui/SemanticsEditor.js +0 -191
  70. package/build/components/ui/SemanticsTable.js +0 -88
  71. package/build/components/ui/Switch.js +0 -139
  72. package/build/components/ui/TogglableGroup.js +0 -157
  73. package/build/components/ui/index.js +0 -29
  74. package/build/components/ui/index_photoviewer.js +0 -21
  75. package/build/components/ui/widgets/CopyCoordinates.js +0 -75
  76. package/build/components/ui/widgets/GeoSearch.css +0 -21
  77. package/build/components/ui/widgets/GeoSearch.js +0 -150
  78. package/build/components/ui/widgets/Legend.js +0 -190
  79. package/build/components/ui/widgets/LevelSelect.css +0 -51
  80. package/build/components/ui/widgets/LevelSelect.js +0 -143
  81. package/build/components/ui/widgets/MapFiltersButton.js +0 -114
  82. package/build/components/ui/widgets/MapLayersButton.js +0 -79
  83. package/build/components/ui/widgets/OSMEditors.js +0 -155
  84. package/build/components/ui/widgets/PictureLegendActions.js +0 -99
  85. package/build/components/ui/widgets/Player.css +0 -7
  86. package/build/components/ui/widgets/Player.js +0 -154
  87. package/build/components/ui/widgets/SemanticsFiltersButton.js +0 -65
  88. package/build/components/ui/widgets/Zoom.js +0 -84
  89. package/build/components/ui/widgets/index.js +0 -16
  90. package/build/components/ui/widgets/index_photoviewer.js +0 -7
  91. package/build/img/arrow_360.svg +0 -14
  92. package/build/img/arrow_flat.svg +0 -11
  93. package/build/img/arrow_triangle.svg +0 -9
  94. package/build/img/arrow_turn.svg +0 -8
  95. package/build/img/bg_aerial.jpg +0 -0
  96. package/build/img/bg_streets.jpg +0 -0
  97. package/build/img/loader_base.jpg +0 -0
  98. package/build/img/logo_dead.svg +0 -91
  99. package/build/img/marker.svg +0 -17
  100. package/build/img/marker_blue.svg +0 -20
  101. package/build/img/osm.svg +0 -49
  102. package/build/img/panoramax.svg +0 -13
  103. package/build/img/switch_big.svg +0 -54
  104. package/build/img/switch_mini.svg +0 -48
  105. package/build/img/wd.svg +0 -1
  106. package/build/index_photoviewer.js +0 -4
  107. package/build/package.json +0 -148
  108. package/build/servers.js +0 -14
  109. package/build/translations/ar.json +0 -1
  110. package/build/translations/be.json +0 -257
  111. package/build/translations/br.json +0 -81
  112. package/build/translations/cy.json +0 -117
  113. package/build/translations/da.json +0 -300
  114. package/build/translations/de.json +0 -309
  115. package/build/translations/en.json +0 -294
  116. package/build/translations/eo.json +0 -235
  117. package/build/translations/es.json +0 -292
  118. package/build/translations/fi.json +0 -1
  119. package/build/translations/fr.json +0 -294
  120. package/build/translations/hr.json +0 -294
  121. package/build/translations/hu.json +0 -294
  122. package/build/translations/it.json +0 -306
  123. package/build/translations/ja.json +0 -182
  124. package/build/translations/ko.json +0 -1
  125. package/build/translations/nl.json +0 -305
  126. package/build/translations/nn.json +0 -1
  127. package/build/translations/pl.json +0 -169
  128. package/build/translations/pt.json +0 -296
  129. package/build/translations/pt_BR.json +0 -304
  130. package/build/translations/sv.json +0 -182
  131. package/build/translations/ti.json +0 -9
  132. package/build/translations/tr.json +0 -297
  133. package/build/translations/uk.json +0 -268
  134. package/build/translations/zh_Hant.json +0 -309
  135. package/build/utils/API.js +0 -928
  136. package/build/utils/InitParameters.js +0 -521
  137. package/build/utils/MapStyleComposer.js +0 -889
  138. package/build/utils/PanoraMapProtocol.js +0 -49
  139. package/build/utils/PhotoAdapter.js +0 -49
  140. package/build/utils/PresetsManager.js +0 -148
  141. package/build/utils/SemanticsMapProtocol.js +0 -144
  142. package/build/utils/URLHandler.js +0 -426
  143. package/build/utils/geocoder.js +0 -203
  144. package/build/utils/i18n.js +0 -128
  145. package/build/utils/index.js +0 -17
  146. package/build/utils/index_photoviewer.js +0 -14
  147. package/build/utils/indoor.js +0 -200
  148. package/build/utils/map.js +0 -788
  149. package/build/utils/picture.js +0 -507
  150. package/build/utils/semantics.js +0 -321
  151. package/build/utils/services.js +0 -148
  152. package/build/utils/utils.js +0 -433
  153. package/build/utils/widgets.js +0 -110
@@ -1,155 +0,0 @@
1
- import { LitElement, css, html, nothing } from "lit";
2
- import { fa, onceParentAvailable } from "../../../utils/widgets.js";
3
- import { josmBboxParameters } from "../../../utils/utils.js";
4
- import { IdEditorURL } from "../../../utils/services.js";
5
- import {
6
- faExternalLinkAlt, faLocationDot, faSatelliteDish
7
- } from "@fortawesome/free-solid-svg-icons";
8
-
9
- const JOSM_REMOTE_URL = "http://127.0.0.1:8111";
10
-
11
- /**
12
- * OSM Editors component offers direct links to OpenStreetMap's iD and JOSM editors.
13
- * @class Panoramax.components.ui.widgets.OSMEditors
14
- * @element pnx-widget-osmeditors
15
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
16
- * @example
17
- * ```html
18
- * <pnx-widget-osmeditors _parent=${viewer} />
19
- * ```
20
- */
21
- export default class OSMEditors extends LitElement {
22
- /** @private */
23
- static properties = {
24
- _pic: {state: true},
25
- _josm: {state: true},
26
- };
27
-
28
- /** @private */
29
- static styles = css`
30
- :host { display: inline-flex; gap: 5px; }
31
- :host > * { flex: 1; }
32
- pnx-link-button::part(btn) { height: auto; }
33
- `;
34
-
35
- constructor() {
36
- super();
37
- this._josm = false;
38
- }
39
-
40
- /** @private */
41
- connectedCallback() {
42
- super.connectedCallback();
43
- onceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {
44
- this._parent.onceFirstPicLoaded().then(this._onPictureLoad.bind(this));
45
- this._parent.psv.addEventListener("picture-loaded", this._onPictureLoad.bind(this));
46
- });
47
- }
48
-
49
- /** @private */
50
- _onPictureLoad() {
51
- this._pic = this._parent?.psv?.getPictureMetadata();
52
- }
53
-
54
- /**
55
- * Enable or disable JOSM live editing using [Remote](https://josm.openstreetmap.de/wiki/Help/RemoteControlCommands)
56
- * @private
57
- */
58
- _toggleJOSMLive() {
59
- this._josm = !this._josm;
60
-
61
- if(this._josm) {
62
- // Check if JOSM remote is enabled
63
- fetch(JOSM_REMOTE_URL+"/version")
64
- .then(() => {
65
- // First loading : download + zoom
66
- const p1 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());
67
- if(p1) {
68
- const url = `${JOSM_REMOTE_URL}/load_and_zoom?${p1}`;
69
- fetch(url).catch(e => {
70
- console.warn(e);
71
- this._toggleJOSMLive();
72
- });
73
- }
74
-
75
- // Enable event listening
76
- this._josmListener = () => {
77
- const p2 = josmBboxParameters(this._parent?.psv?.getPictureMetadata?.());
78
- if(p2) {
79
- // Next loadings : just zoom
80
- // This avoids desktop focus to go on JOSM instead of
81
- // Staying on web browser
82
- const url = `${JOSM_REMOTE_URL}/zoom?${p2}`;
83
- fetch(url).catch(e => {
84
- console.warn(e);
85
- this._toggleJOSMLive();
86
- });
87
- }
88
- };
89
- this._parent?.psv?.addEventListener?.("picture-loaded", this._josmListener);
90
- this._parent?.psv?.addEventListener?.("picture-loading", this._josmListener);
91
- })
92
- .catch(e => {
93
- console.warn(e);
94
- alert(this._parent?._t.pnx.error_josm);
95
- this._toggleJOSMLive();
96
- });
97
- }
98
- else {
99
- if(this._josmListener) {
100
- this._parent?.psv?.removeEventListener?.("picture-loading", this._josmListener);
101
- this._parent?.psv?.removeEventListener?.("picture-loaded", this._josmListener);
102
- delete this._josmListener;
103
- }
104
- }
105
- }
106
-
107
- /** @private */
108
- render() {
109
- if(!this._pic) { return nothing; }
110
-
111
- // Mobile -> Geo URI
112
- if(this._parent?.isWidthSmall()) {
113
- return html`
114
- <pnx-link-button
115
- size="sm"
116
- href="geo:${this._pic.gps[1]},${this._pic.gps[0]};u=3"
117
- >
118
- ${fa(faExternalLinkAlt)} ${this._parent?._t.pnx.geo_uri}
119
- </pnx-link-button>
120
- `;
121
- }
122
- else {
123
- const idOpts = {
124
- "map": `19/${this._pic.gps[1]}/${this._pic.gps[0]}`,
125
- "source": "Panoramax",
126
- "photo_overlay": "panoramax",
127
- "photo": `panoramax/${this._pic.id}`,
128
- };
129
- const idUrl = idOpts && `${IdEditorURL()}#${new URLSearchParams(idOpts).toString()}`;
130
-
131
- return html`
132
- <pnx-link-button
133
- size="sm"
134
- href=${idUrl}
135
- target="_blank"
136
- title="${this._parent?._t.pnx.contribute_id}"
137
- >
138
- ${fa(faLocationDot)} ${this._parent?._t.pnx.id}
139
- </pnx-link-button>
140
-
141
- <pnx-button
142
- id="pnx-edit-josm"
143
- size="sm"
144
- active=${this._josm ? "" : nothing}
145
- @click=${this._toggleJOSMLive}
146
- title="${this._parent?._t.pnx.josm_live}"
147
- >
148
- ${fa(faSatelliteDish)} ${this._parent?._t.pnx.josm}
149
- </pnx-button>
150
- `;
151
- }
152
- }
153
- }
154
-
155
- customElements.define("pnx-widget-osmeditors", OSMEditors);
@@ -1,99 +0,0 @@
1
- import { LitElement, css, html, nothing } from "lit";
2
- import { fa, onceParentAvailable } from "../../../utils/widgets.js";
3
- import { faEllipsisV } from "@fortawesome/free-solid-svg-icons";
4
- import { noprint } from "../../styles.js";
5
-
6
- /**
7
- * Picture Legend Actions is a menu showing up complementary actions for picture legend.
8
- * @class Panoramax.components.ui.widgets.PictureLegendActions
9
- * @element pnx-picture-legend-actions
10
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
11
- * @example
12
- * ```html
13
- * <pnx-picture-legend-actions _parent=${viewer} />
14
- * ```
15
- */
16
- export default class PictureLegendActions extends LitElement {
17
- /** @private */
18
- static styles = [ noprint, css`
19
- pnx-togglable-group::part(menu) {
20
- border-radius: 5px;
21
- min-width: unset;
22
- }
23
- `];
24
-
25
- /**
26
- * Component properties.
27
- * @memberof Panoramax.components.ui.widgets.PictureLegendActions#
28
- * @type {Object}
29
- * @property {boolean} [full=false] Show advanced actions
30
- */
31
- static properties = {
32
- full: { type: Boolean },
33
- _meta: { state: true },
34
- };
35
-
36
- constructor() {
37
- super();
38
- this.full = false;
39
- }
40
-
41
- /** @private */
42
- connectedCallback() {
43
- super.connectedCallback();
44
-
45
- onceParentAvailable(this).then(() => this._parent.onceReady()).then(() => {
46
- this._meta = this._parent.psv.getPictureMetadata();
47
- this._parent.psv.addEventListener("picture-loaded", () => {
48
- this._meta = this._parent.psv.getPictureMetadata();
49
- });
50
- });
51
- }
52
-
53
- /** @private */
54
- _onPrint() {
55
- this._closeGroup();
56
- window.print();
57
- }
58
-
59
- /** @private */
60
- _closeGroup() {
61
- this.renderRoot.querySelector("#pic-legend-headline-menu").close();
62
- }
63
-
64
- /** @private */
65
- render() {
66
- return html`<pnx-togglable-group padded="false" id="pic-legend-headline-menu" ._parent=${this._parent}>
67
- <pnx-button slot="button" kind="inline">${fa(faEllipsisV)}</pnx-button>
68
- <pnx-list-group class="pnx-print-hidden" @click=${this._closeMenu}>
69
- ${this._meta ? html`<pnx-copy-button ._t=${this._parent?._t} text=${this._meta.id} unstyled>
70
- ${this._parent?._t.pnx.metadata_general_copy_picid}
71
- </pnx-copy-button>` : nothing}
72
-
73
- <a
74
- download
75
- target="_blank"
76
- href=${this._meta?.panorama?.hdUrl}
77
- @click=${this._closeGroup}
78
- >${this._parent?._t.pnx.share_image}</a>
79
-
80
- ${this._parent.isWidthSmall() ? nothing : html`<button @click=${this._onPrint}>
81
- ${this._parent?._t.pnx.share_print}
82
- </button>`}
83
-
84
- ${this._parent?.api?.getRSSURL() && !this._parent.isWidthSmall() && html`
85
- <a
86
- target="_blank"
87
- href=${this._parent?.api.getRSSURL(this._parent?.map?.getBounds?.())}
88
- title=${this._parent?._t.pnx.share_rss_title}
89
- @click=${this._closeGroup}
90
- >
91
- ${this._parent?._t.pnx.share_rss}
92
- </a>
93
- `}
94
- </pnx-list-group>
95
- </pnx-togglable-group>`;
96
- }
97
- }
98
-
99
- customElements.define("pnx-picture-legend-actions", PictureLegendActions);
@@ -1,7 +0,0 @@
1
- pnx-widget-player {
2
- pointer-events: none;
3
- }
4
-
5
- pnx-widget-player > pnx-button-group {
6
- pointer-events: auto;
7
- }
@@ -1,154 +0,0 @@
1
- import { LitElement, html, nothing } from "lit";
2
- import { fa, onceParentAvailable } from "../../../utils/widgets.js";
3
- import {
4
- faBackward, faEllipsisVertical, faForward, faPause, faPlay
5
- } from "@fortawesome/free-solid-svg-icons";
6
- import PlayerStyles from "./Player.css" with { type: "css" };
7
- document.adoptedStyleSheets.push(PlayerStyles);
8
-
9
- /**
10
- * Player widget shows prev/play/pause/next/more buttons in a unified toolbar.
11
- * @class Panoramax.components.ui.widgets.Player
12
- * @element pnx-widget-player
13
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
14
- * @example
15
- * ```html
16
- * <pnx-widget-player _parent=${viewer} />
17
- * ```
18
- */
19
- export default class Player extends LitElement {
20
- /**
21
- * Component properties.
22
- * @memberof Panoramax.components.ui.widgets.Player#
23
- * @type {Object}
24
- * @property {boolean} [playing=false] Is sequence currently playing ?
25
- * @property {string} [size=xl] Group size (md, xl)
26
- * @property {string} [more=depends] Should we display the "more options" button ("always", "never", "depends" = only on large screens (default))
27
- */
28
- static properties = {
29
- playing: {type: Boolean, reflect: true},
30
- size: {type: String},
31
- more: {type: String},
32
- _activePrev: {state: true},
33
- _activePlay: {state: true},
34
- _activeNext: {state: true},
35
- };
36
-
37
- constructor() {
38
- super();
39
-
40
- this.playing = false;
41
- this.size = "xl";
42
- this.more = "depends";
43
- this._activePrev = true;
44
- this._activePlay = true;
45
- this._activeNext = true;
46
- }
47
-
48
- /** @private */
49
- createRenderRoot() {
50
- return this;
51
- }
52
-
53
- /** @private */
54
- connectedCallback() {
55
- super.connectedCallback();
56
-
57
- onceParentAvailable(this).then(() => this._parent?.oncePSVReady?.().then(() => {
58
- this._parent.psv.addEventListener("sequence-playing", () => this.playing = true);
59
- this._parent.psv.addEventListener("sequence-stopped", () => this.playing = false);
60
- this._parent.psv.addEventListener("picture-loaded", this._changeActiveStates.bind(this));
61
- this._parent.psv.addEventListener("pictures-navigation-changed", this._changeActiveStates.bind(this));
62
- this._changeActiveStates();
63
- }));
64
- }
65
-
66
- /** @private */
67
- _changeActiveStates() {
68
- if(this._parent.psv.getPicturesNavigation?.() === "pic") {
69
- this._activeNext = false;
70
- this._activePlay = false;
71
- this._activePrev = false;
72
- }
73
- else {
74
- this._activePrev = this._parent.psv.getPictureMetadata()?.sequence?.prevPic != null;
75
-
76
- if(this._parent.psv.getPictureMetadata()?.sequence?.nextPic != null) {
77
- this._activeNext = true;
78
- this._activePlay = true;
79
- }
80
- else {
81
- this._activeNext = false;
82
- this._activePlay = false;
83
- }
84
- }
85
- this.requestUpdate();
86
- }
87
-
88
- /** @private */
89
- _onPlayClick() {
90
- if(this._parent?.psv?.isSequencePlaying()) {
91
- this.playing = false;
92
- this._parent?.psv?.stopSequence();
93
- }
94
- else {
95
- this.playing = true;
96
- this._parent?.psv?.playSequence();
97
- }
98
- }
99
-
100
- /** @private */
101
- render() {
102
- if(!this._parent?.psv?.addEventListener) { return nothing; }
103
-
104
- return html`
105
- <pnx-button-group
106
- id="pnx-widget-player"
107
- dir="row"
108
- size=${this.size}
109
- class="pnx-print-hidden"
110
- style=${!this._activePrev && !this._activePlay && !this._activeNext ? "display: none": ""}
111
- >
112
- <pnx-button
113
- kind="superflat"
114
- id="pnx-player-prev"
115
- title=${this._parent?._t.pnx.sequence_prev}
116
- @click=${() => this._parent?.psv?.goToPrevPicture()}
117
- .disabled=${!this._activePrev}
118
- >${fa(faBackward)}</pnx-button>
119
-
120
- <pnx-button
121
- kind="superflat"
122
- id="pnx-player-play"
123
- title=${this.playing ? this._parent?._t.pnx.sequence_pause : this._parent?._t.pnx.sequence_play}
124
- .disabled=${!this._activePlay}
125
- @click=${this._onPlayClick.bind(this)}
126
- >${this.playing ? fa(faPause) : fa(faPlay)}</pnx-button>
127
-
128
- <pnx-button
129
- kind="superflat"
130
- id="pnx-player-next"
131
- title=${this._parent?._t.pnx.sequence_next}
132
- .disabled=${!this._activeNext}
133
- @click=${() => this._parent?.psv?.goToNextPicture()}
134
- >${fa(faForward)}</pnx-button>
135
-
136
- ${this.more === "never" || (this.more !== "always" && this._parent?.isWidthSmall()) ? nothing : html`
137
- <pnx-togglable-group padded="false" ._parent=${this._parent}>
138
- <pnx-button
139
- kind="flat"
140
- id="pnx-player-more"
141
- title=${this._parent?._t.pnx.sequence_more}
142
- class=${this.more === "depends" ? "pnx-xs-hidden" : ""}
143
- slot="button"
144
- >${fa(faEllipsisVertical)}</pnx-button>
145
-
146
- <pnx-player-options ._parent=${this._parent}></pnx-player-options>
147
- </pnx-togglable-group>
148
- `}
149
- </pnx-button-group>
150
- `;
151
- }
152
- }
153
-
154
- customElements.define("pnx-widget-player", Player);
@@ -1,65 +0,0 @@
1
- import { LitElement, html, nothing } from "lit";
2
- import { fa, onceParentAvailable } from "../../../utils/widgets.js";
3
- import {
4
- faChevronDown, faTags, faXmark
5
- } from "@fortawesome/free-solid-svg-icons";
6
- import { activeIcon } from "../../styles.js";
7
-
8
- /**
9
- * Collapsible button showing off tags filters menus.
10
- * @class Panoramax.components.ui.widgets.SemanticsFiltersButton
11
- * @element pnx-widget-semantics-filters
12
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
13
- * @example
14
- * ```html
15
- * <pnx-widget-semantics-filters _parent=${viewer} />
16
- * ```
17
- */
18
- export default class SemanticsFiltersButton extends LitElement {
19
- /** @private */
20
- static styles = [activeIcon];
21
-
22
- constructor() {
23
- super();
24
- onceParentAvailable(this).then(() => this._parent.onceMapReady?.().then(() => {
25
- this._parent?.mapStyleComposer?.addEventListener("dataoverlay-added", () => this.requestUpdate());
26
- this._parent?.map?.addEventListener("styledata", () => this.requestUpdate());
27
- }));
28
- }
29
-
30
- /** @private */
31
- render() {
32
- const o = this._parent.map?.getSemanticOverlays?.();
33
- if(!o || o.length === 0) { return; }
34
-
35
- const active = o.filter(l => l.metadata && this._parent.mapStyleComposer.dataOverlays.has(l.source)).length > 0;
36
- const isSmall = this._parent?.isWidthSmall() || this._parent?.isWidthMedium();
37
- const resetIcon = fa(faXmark, {styles: {"pointer-events": "auto"}});
38
- resetIcon.addEventListener("click", e => {
39
- e.stopPropagation();
40
- this._parent?.map?.toggleAllSemanticOverlays(false);
41
- });
42
-
43
- return html`
44
- <pnx-togglable-group
45
- id="pnx-widget-semantics-filter"
46
- class="pnx-only-map pnx-print-hidden"
47
- ._parent=${this._parent}
48
- >
49
- <pnx-button kind="flat" size="xl" slot="button">
50
- ${fa(faTags)}
51
- ${active ? html`<span class="pnx-active-icon"></span>` : nothing}
52
- ${isSmall ? nothing : this._parent?._t.pnx.semantics_title}
53
- ${isSmall ? nothing : (active ? resetIcon : fa(faChevronDown))}
54
- </pnx-button>
55
- <pnx-map-semantics-filters-menu
56
- id="pnx-map-semantics-filters-menu"
57
- ._parent=${this._parent}
58
- @change=${this._onLayersChange}
59
- ></pnx-map-semantics-filters-menu>
60
- </pnx-togglable-group>
61
- `;
62
- }
63
- }
64
-
65
- customElements.define("pnx-widget-semantics-filters", SemanticsFiltersButton);
@@ -1,84 +0,0 @@
1
- import { LitElement, html } from "lit";
2
- import { PSV_ANIM_DURATION, PSV_DEFAULT_ZOOM } from "../Photo.js";
3
- import { PSV_ZOOM_DELTA } from "../../core/PhotoViewer.js";
4
- import { fa, onceParentAvailable } from "../../../utils/widgets.js";
5
- import { faMinus, faPlus } from "@fortawesome/free-solid-svg-icons";
6
- import ButtonGroupStyles from "../ButtonGroup.css" with { type: "css" };
7
- document.adoptedStyleSheets.push(ButtonGroupStyles);
8
-
9
- /**
10
- * Widget for +/- zoom on PSV or Map.
11
- * @class Panoramax.components.ui.widgets.Zoom
12
- * @element pnx-widget-zoom
13
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
14
- * @example
15
- * ```html
16
- * <pnx-widget-zoom _parent=${viewer} />
17
- * ```
18
- */
19
- export default class Zoom extends LitElement {
20
- /** @private */
21
- static properties = {
22
- _lastWantedZoom: {state: true},
23
- };
24
-
25
- /** @private */
26
- createRenderRoot() {
27
- return this;
28
- }
29
-
30
- /** @private */
31
- connectedCallback() {
32
- super.connectedCallback();
33
- onceParentAvailable(this).then(() => this._parent?.oncePSVReady?.().then(() => {
34
- this._lastWantedZoom = this._parent?.psv?.getZoomLevel() || PSV_DEFAULT_ZOOM;
35
- }));
36
- }
37
-
38
- /** @private */
39
- _onClick(e, zoomIn) {
40
- if(this._parent.map && this._parent.isMapWide()) {
41
- if(zoomIn) { this._parent.map.zoomIn({}, {originalEvent: e}); }
42
- else { this._parent.map.zoomOut({}, {originalEvent: e}); }
43
- }
44
- else {
45
- if(this._parent.lastPsvAnim) { this._parent.lastPsvAnim.cancel(); }
46
- const goToZoom = zoomIn ?
47
- Math.min(100, this._lastWantedZoom + PSV_ZOOM_DELTA)
48
- : Math.max(0, this._lastWantedZoom - PSV_ZOOM_DELTA);
49
- this._parent.lastPsvAnim = this._parent.psv.animate({
50
- speed: PSV_ANIM_DURATION,
51
- zoom: goToZoom
52
- });
53
- this._lastWantedZoom = goToZoom;
54
- }
55
- }
56
-
57
- /** @private */
58
- render() {
59
- return html`
60
- <pnx-button-group
61
- id="pnx-widget-zoom"
62
- dir="column"
63
- size="xl"
64
- class="pnx-mobile-hidden pnx-print-hidden"
65
- >
66
- <pnx-button
67
- id="pnx-zoom-in"
68
- kind="superflat"
69
- title=${this._parent?._t.pnx.zoomIn}
70
- @click=${e => this._onClick(e, true)}
71
- >${fa(faPlus)}</pnx-button>
72
-
73
- <pnx-button
74
- id="pnx-zoom-out"
75
- kind="superflat"
76
- title=${this._parent?._t.pnx.zoomOut}
77
- @click=${e => this._onClick(e, false)}
78
- >${fa(faMinus)}</pnx-button>
79
- </pnx-button-group>
80
- `;
81
- }
82
- }
83
-
84
- customElements.define("pnx-widget-zoom", Zoom);
@@ -1,16 +0,0 @@
1
- /**
2
- * Pre-assembled UI pieces components
3
- * @module Panoramax:components:ui:widgets
4
- */
5
-
6
- export {default as CopyCoordinates} from "./CopyCoordinates.js";
7
- export {default as GeoSearch} from "./GeoSearch.js";
8
- export {default as Legend} from "./Legend.js";
9
- export {default as LevelSelect} from "./LevelSelect.js";
10
- export {default as MapFiltersButton} from "./MapFiltersButton.js";
11
- export {default as MapLayersButton} from "./MapLayersButton.js";
12
- export {default as OSMEditors} from "./OSMEditors.js";
13
- export {default as PictureLegendActions} from "./PictureLegendActions.js";
14
- export {default as Player} from "./Player.js";
15
- export {default as SemanticsFiltersButton} from "./SemanticsFiltersButton.js";
16
- export {default as Zoom} from "./Zoom.js";
@@ -1,7 +0,0 @@
1
- // Lightweight export for PhotoViewer
2
- export {default as CopyCoordinates} from "./CopyCoordinates.js";
3
- export {default as Legend} from "./Legend.js";
4
- export {default as OSMEditors} from "./OSMEditors.js";
5
- export {default as PictureLegendActions} from "./PictureLegendActions.js";
6
- export {default as Player} from "./Player.js";
7
- export {default as Zoom} from "./Zoom.js";
@@ -1,14 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- width="48"
4
- height="48"
5
- viewBox="0 0 48 48"
6
- xmlns="http://www.w3.org/2000/svg"
7
- xmlns:svg="http://www.w3.org/2000/svg">
8
- <path
9
- style="fill:#ffcc80;fill-opacity:1;stroke:#ffffff;stroke-width:2.63736;stroke-dasharray:none;stroke-opacity:1"
10
- d="M 24 1.3183594 A 22.68132 22.68132 0 0 0 1.3183594 24 A 22.68132 22.68132 0 0 0 24 46.681641 A 22.68132 22.68132 0 0 0 46.681641 24 A 22.68132 22.68132 0 0 0 24 1.3183594 z M 24 14.021484 A 9.9777565 9.9777565 0 0 1 33.978516 24 A 9.9777565 9.9777565 0 0 1 24 33.978516 A 9.9777565 9.9777565 0 0 1 14.021484 24 A 9.9777565 9.9777565 0 0 1 24 14.021484 z " />
11
- <path
12
- style="fill:#bf360c;fill-opacity:1;stroke:#ffffff;stroke-width:2.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
13
- d="M 24 1.2421875 A 22.594107 22.594107 0 0 0 8.0214844 7.859375 L 17.042969 16.882812 A 9.9777565 9.9777565 0 0 1 24 14.021484 A 9.9777565 9.9777565 0 0 1 30.974609 16.867188 L 39.978516 7.8632812 A 22.594107 22.594107 0 0 0 24 1.2421875 z " />
14
- </svg>
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- width="48"
4
- height="48"
5
- viewBox="0 0 48 48"
6
- xmlns="http://www.w3.org/2000/svg"
7
- xmlns:svg="http://www.w3.org/2000/svg">
8
- <path
9
- style="fill:#bf360c;fill-opacity:1;stroke:#ffffff;stroke-width:2.50003;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
10
- d="M 24 1.2421875 A 22.594107 22.594107 0 0 0 8.0214844 7.859375 L 17.042969 16.882812 A 9.9777565 9.9777565 0 0 1 24 14.021484 A 9.9777565 9.9777565 0 0 1 30.974609 16.867188 L 39.978516 7.8632812 A 22.594107 22.594107 0 0 0 24 1.2421875 z " />
11
- </svg>
@@ -1,9 +0,0 @@
1
- <svg
2
- viewBox="0 0 64 64"
3
- width="64" height="64"
4
- xmlns="http://www.w3.org/2000/svg"
5
- xmlns:svg="http://www.w3.org/2000/svg">
6
- <path
7
- d="M 27.359486,12.65513 1.4316349,43.49917 c -3.2999082,3.906014 -0.53876046,9.96707 4.6468097,9.96707 H 57.934146 c 5.118225,0 7.946718,-5.993711 4.64681,-9.96707 L 36.653105,12.65513 c -2.424422,-2.8284931 -6.869197,-2.8284931 -9.293619,0 z"
8
- style="fill: currentColor;fill-opacity:1;stroke-width:0.673451" />
9
- </svg>
@@ -1,8 +0,0 @@
1
- <svg viewBox="0 0 64 192" width="64" height="192" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
2
- <circle
3
- cx="32"
4
- cy="32"
5
- r="29.897806"
6
- style="fill: currentColor;fill-opacity:1;stroke:#ffffff;stroke-width:4.20439;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
7
- <path d="m 34.279873,20.262171 6.711442,6.714294 c 0.891465,0.891465 2.339986,0.891465 3.231451,0 0.891466,-0.891465 0.891466,-2.339985 0,-3.23145 -9.662902,-9.665829 -3.794285,-3.794286 -8.180297,-8.180298 -1.071396,-1.074322 -2.525696,-1.677165 -4.039972,-1.677165 -1.517129,0 -2.968576,0.602858 -4.042825,1.677165 l -8.180298,8.180298 c -0.894317,0.891465 -0.894317,2.339986 0,3.23145 0.891466,0.891465 2.339987,0.891465 3.231452,0 l 6.697106,-6.694253 v 27.703943 c 0,0 -0.109706,2.126292 2.285971,2.126292 2.395676,0 2.28597,-2.126292 2.28597,-2.126292 z" style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke-width:0.731429" />
8
- </svg>
Binary file
Binary file
Binary file