@panoramax/web-viewer 4.0.3 → 4.1.0

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 (103) hide show
  1. package/CHANGELOG.md +40 -1
  2. package/build/index.css +9 -9
  3. package/build/index.css.map +1 -1
  4. package/build/index.js +640 -456
  5. package/build/index.js.map +1 -1
  6. package/build/photo.html +1 -1
  7. package/build/viewer.html +3 -3
  8. package/build/widgets.html +1 -1
  9. package/config/jest/mocks.js +9 -1
  10. package/docs/03_URL_settings.md +21 -0
  11. package/docs/09_Develop.md +6 -0
  12. package/docs/images/comparative_3drender.jpg +0 -0
  13. package/docs/index.md +13 -0
  14. package/docs/reference/components/core/Editor.md +18 -0
  15. package/docs/reference/components/core/PhotoViewer.md +1 -0
  16. package/docs/reference/components/core/Viewer.md +1 -0
  17. package/docs/reference/components/menus/MapLegend.md +17 -0
  18. package/docs/reference/components/menus/MiniPictureLegend.md +15 -0
  19. package/docs/reference/components/menus/PictureLegend.md +17 -0
  20. package/docs/reference/components/ui/AnnotationsSwitch.md +15 -0
  21. package/docs/reference/components/ui/Button.md +1 -1
  22. package/docs/reference/components/ui/CopyButton.md +1 -1
  23. package/docs/reference/components/ui/LinkButton.md +1 -1
  24. package/docs/reference/components/ui/Map.md +18 -2
  25. package/docs/reference/components/ui/MapMore.md +6 -2
  26. package/docs/reference/components/ui/SemanticsEditor.md +87 -0
  27. package/docs/reference/components/ui/widgets/Legend.md +5 -4
  28. package/docs/reference/utils/URLHandler.md +7 -0
  29. package/docs/reference.md +3 -1
  30. package/docs/tutorials/aerial_imagery.md +13 -11
  31. package/mkdocs.yml +3 -1
  32. package/package.json +7 -7
  33. package/public/photo.html +1 -1
  34. package/public/viewer.html +3 -3
  35. package/public/widgets.html +32 -0
  36. package/src/components/core/Basic.css +2 -0
  37. package/src/components/core/Basic.js +3 -1
  38. package/src/components/core/CoverageMap.js +6 -0
  39. package/src/components/core/Editor.css +1 -0
  40. package/src/components/core/Editor.js +58 -7
  41. package/src/components/core/PhotoViewer.css +5 -10
  42. package/src/components/core/PhotoViewer.js +55 -20
  43. package/src/components/core/Viewer.css +9 -2
  44. package/src/components/core/Viewer.js +62 -33
  45. package/src/components/layout/BottomDrawer.js +2 -1
  46. package/src/components/layout/Tabs.js +4 -0
  47. package/src/components/menus/AnnotationsList.js +13 -9
  48. package/src/components/menus/MapBackground.js +8 -3
  49. package/src/components/menus/MapFilters.js +11 -2
  50. package/src/components/menus/MapLayers.js +3 -2
  51. package/src/components/menus/MapLegend.js +28 -4
  52. package/src/components/menus/MiniPictureLegend.js +74 -0
  53. package/src/components/menus/PictureLegend.js +88 -33
  54. package/src/components/menus/PictureMetadata.js +49 -17
  55. package/src/components/menus/PlayerOptions.js +3 -3
  56. package/src/components/menus/Share.js +3 -3
  57. package/src/components/menus/index.js +5 -4
  58. package/src/components/styles.js +11 -0
  59. package/src/components/ui/AnnotationsSwitch.js +169 -0
  60. package/src/components/ui/Button.js +1 -1
  61. package/src/components/ui/CopyButton.js +1 -1
  62. package/src/components/ui/LinkButton.js +1 -1
  63. package/src/components/ui/Map.css +4 -0
  64. package/src/components/ui/Map.js +17 -5
  65. package/src/components/ui/MapMore.js +61 -25
  66. package/src/components/ui/Photo.css +11 -2
  67. package/src/components/ui/Photo.js +6 -3
  68. package/src/components/ui/SemanticsEditor.js +157 -0
  69. package/src/components/ui/index.js +2 -1
  70. package/src/components/ui/widgets/GeoSearch.js +3 -2
  71. package/src/components/ui/widgets/Legend.js +69 -14
  72. package/src/components/ui/widgets/MapFiltersButton.js +3 -3
  73. package/src/components/ui/widgets/MapLayersButton.js +3 -3
  74. package/src/components/ui/widgets/OSMEditors.js +2 -2
  75. package/src/components/ui/widgets/PictureLegendActions.js +24 -42
  76. package/src/components/ui/widgets/Player.js +3 -3
  77. package/src/components/ui/widgets/Zoom.js +4 -2
  78. package/src/translations/ar.json +1 -0
  79. package/src/translations/da.json +3 -2
  80. package/src/translations/de.json +64 -13
  81. package/src/translations/en.json +5 -1
  82. package/src/translations/eo.json +32 -2
  83. package/src/translations/fr.json +7 -1
  84. package/src/translations/it.json +33 -2
  85. package/src/translations/nl.json +53 -11
  86. package/src/translations/zh_Hant.json +29 -2
  87. package/src/utils/API.js +17 -1
  88. package/src/utils/InitParameters.js +46 -4
  89. package/src/utils/URLHandler.js +9 -1
  90. package/src/utils/map.js +24 -1
  91. package/src/utils/semantics.js +53 -1
  92. package/src/utils/services.js +16 -0
  93. package/src/utils/widgets.js +20 -0
  94. package/tests/components/core/Editor.test.js +1 -1
  95. package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +18 -6
  96. package/tests/components/core/__snapshots__/Viewer.test.js.snap +15 -3
  97. package/tests/components/ui/Photo.test.js +1 -0
  98. package/tests/components/ui/__snapshots__/Map.test.js.snap +164 -0
  99. package/tests/utils/InitParameters.test.js +27 -0
  100. package/tests/utils/map.test.js +12 -0
  101. package/tests/utils/semantics.test.js +34 -5
  102. package/docs/reference/components/ui/HashTags.md +0 -15
  103. package/src/components/ui/HashTags.js +0 -98
@@ -1,98 +0,0 @@
1
- import { LitElement, html, css, nothing } from "lit";
2
- import { getHashTags, hasAnnotations } from "../../utils/picture";
3
- import { fa } from "../../utils/widgets";
4
- import { faDrawPolygon } from "@fortawesome/free-solid-svg-icons/faDrawPolygon";
5
-
6
- /**
7
- * HashTags component shows the list of hashtags associated to a picture.
8
- * @class Panoramax.components.ui.HashTags
9
- * @element pnx-hashtags
10
- * @extends [lit.LitElement](https://lit.dev/docs/api/LitElement/)
11
- * @example
12
- * ```html
13
- * <pnx-hashtags ._parent=${viewer} />
14
- * ```
15
- */
16
- export default class HashTags extends LitElement {
17
- /** @private */
18
- static styles = css`
19
- div {
20
- background: linear-gradient(to bottom left, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
21
- margin-top: -10px;
22
- margin-right: -10px;
23
- padding: 5px 10px;
24
- border-bottom-left-radius: 10px;
25
- font-family: var(--font-family);
26
- color: white;
27
- font-size: 0.8em;
28
- }
29
- `;
30
-
31
- /** @private */
32
- static properties = {
33
- _tags: {state: true},
34
- _visible: {state: true},
35
- _annotationsToggled: {state: true},
36
- };
37
-
38
- constructor() {
39
- super();
40
- this._tags = [];
41
- this._visible = false;
42
- this._annotationsToggled = false;
43
- }
44
-
45
- /** @private */
46
- connectedCallback() {
47
- super.connectedCallback();
48
-
49
- this._parent.onceReady().then(() => {
50
- this._tags = getHashTags(this._parent?.psv?.getPictureMetadata?.());
51
-
52
- // Component visibility : only if seen at least one pic with semantics
53
- if(
54
- !this._visible && (
55
- this._tags.length > 0
56
- || hasAnnotations(this._parent?.psv?.getPictureMetadata?.())
57
- )
58
- ) {
59
- this._visible = true;
60
- this._parent.psv.toggleAllAnnotations(true);
61
- }
62
-
63
- this._parent.psv.addEventListener("picture-loaded", () => {
64
- this._tags = getHashTags(this._parent.psv.getPictureMetadata());
65
- if(
66
- !this._visible && (
67
- this._tags.length > 0 ||
68
- hasAnnotations(this._parent.psv.getPictureMetadata())
69
- )
70
- ) {
71
- this._visible = true;
72
- this._parent.psv.toggleAllAnnotations(true);
73
- }
74
- });
75
-
76
- this._annotationsToggled = this._parent.psv.areAnnotationsVisible() || false;
77
- this._parent.psv.addEventListener("annotations-toggled", e => {
78
- this._annotationsToggled = e.detail.visible;
79
- });
80
- });
81
- }
82
-
83
- /** @private */
84
- render() {
85
- return this._visible ? html`<div>
86
- ${this._tags.join(" ")}
87
- <pnx-button
88
- kind="outline"
89
- style="vertical-align: middle"
90
- title=${this._annotationsToggled ? this._parent._t?.pnx.semantics_hide_annotations : this._parent._t?.pnx.semantics_show_annotations}
91
- active=${this._annotationsToggled ? "" : nothing}
92
- @click=${() => this._parent.psv.toggleAllAnnotations(!this._annotationsToggled)}
93
- >${fa(faDrawPolygon)}</pnx-button>
94
- </div>` : nothing;
95
- }
96
- }
97
-
98
- customElements.define("pnx-hashtags", HashTags);