@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.
- package/CHANGELOG.md +40 -1
- package/build/index.css +9 -9
- package/build/index.css.map +1 -1
- package/build/index.js +640 -456
- package/build/index.js.map +1 -1
- package/build/photo.html +1 -1
- package/build/viewer.html +3 -3
- package/build/widgets.html +1 -1
- package/config/jest/mocks.js +9 -1
- package/docs/03_URL_settings.md +21 -0
- package/docs/09_Develop.md +6 -0
- package/docs/images/comparative_3drender.jpg +0 -0
- package/docs/index.md +13 -0
- package/docs/reference/components/core/Editor.md +18 -0
- package/docs/reference/components/core/PhotoViewer.md +1 -0
- package/docs/reference/components/core/Viewer.md +1 -0
- package/docs/reference/components/menus/MapLegend.md +17 -0
- package/docs/reference/components/menus/MiniPictureLegend.md +15 -0
- package/docs/reference/components/menus/PictureLegend.md +17 -0
- package/docs/reference/components/ui/AnnotationsSwitch.md +15 -0
- package/docs/reference/components/ui/Button.md +1 -1
- package/docs/reference/components/ui/CopyButton.md +1 -1
- package/docs/reference/components/ui/LinkButton.md +1 -1
- package/docs/reference/components/ui/Map.md +18 -2
- package/docs/reference/components/ui/MapMore.md +6 -2
- package/docs/reference/components/ui/SemanticsEditor.md +87 -0
- package/docs/reference/components/ui/widgets/Legend.md +5 -4
- package/docs/reference/utils/URLHandler.md +7 -0
- package/docs/reference.md +3 -1
- package/docs/tutorials/aerial_imagery.md +13 -11
- package/mkdocs.yml +3 -1
- package/package.json +7 -7
- package/public/photo.html +1 -1
- package/public/viewer.html +3 -3
- package/public/widgets.html +32 -0
- package/src/components/core/Basic.css +2 -0
- package/src/components/core/Basic.js +3 -1
- package/src/components/core/CoverageMap.js +6 -0
- package/src/components/core/Editor.css +1 -0
- package/src/components/core/Editor.js +58 -7
- package/src/components/core/PhotoViewer.css +5 -10
- package/src/components/core/PhotoViewer.js +55 -20
- package/src/components/core/Viewer.css +9 -2
- package/src/components/core/Viewer.js +62 -33
- package/src/components/layout/BottomDrawer.js +2 -1
- package/src/components/layout/Tabs.js +4 -0
- package/src/components/menus/AnnotationsList.js +13 -9
- package/src/components/menus/MapBackground.js +8 -3
- package/src/components/menus/MapFilters.js +11 -2
- package/src/components/menus/MapLayers.js +3 -2
- package/src/components/menus/MapLegend.js +28 -4
- package/src/components/menus/MiniPictureLegend.js +74 -0
- package/src/components/menus/PictureLegend.js +88 -33
- package/src/components/menus/PictureMetadata.js +49 -17
- package/src/components/menus/PlayerOptions.js +3 -3
- package/src/components/menus/Share.js +3 -3
- package/src/components/menus/index.js +5 -4
- package/src/components/styles.js +11 -0
- package/src/components/ui/AnnotationsSwitch.js +169 -0
- package/src/components/ui/Button.js +1 -1
- package/src/components/ui/CopyButton.js +1 -1
- package/src/components/ui/LinkButton.js +1 -1
- package/src/components/ui/Map.css +4 -0
- package/src/components/ui/Map.js +17 -5
- package/src/components/ui/MapMore.js +61 -25
- package/src/components/ui/Photo.css +11 -2
- package/src/components/ui/Photo.js +6 -3
- package/src/components/ui/SemanticsEditor.js +157 -0
- package/src/components/ui/index.js +2 -1
- package/src/components/ui/widgets/GeoSearch.js +3 -2
- package/src/components/ui/widgets/Legend.js +69 -14
- package/src/components/ui/widgets/MapFiltersButton.js +3 -3
- package/src/components/ui/widgets/MapLayersButton.js +3 -3
- package/src/components/ui/widgets/OSMEditors.js +2 -2
- package/src/components/ui/widgets/PictureLegendActions.js +24 -42
- package/src/components/ui/widgets/Player.js +3 -3
- package/src/components/ui/widgets/Zoom.js +4 -2
- package/src/translations/ar.json +1 -0
- package/src/translations/da.json +3 -2
- package/src/translations/de.json +64 -13
- package/src/translations/en.json +5 -1
- package/src/translations/eo.json +32 -2
- package/src/translations/fr.json +7 -1
- package/src/translations/it.json +33 -2
- package/src/translations/nl.json +53 -11
- package/src/translations/zh_Hant.json +29 -2
- package/src/utils/API.js +17 -1
- package/src/utils/InitParameters.js +46 -4
- package/src/utils/URLHandler.js +9 -1
- package/src/utils/map.js +24 -1
- package/src/utils/semantics.js +53 -1
- package/src/utils/services.js +16 -0
- package/src/utils/widgets.js +20 -0
- package/tests/components/core/Editor.test.js +1 -1
- package/tests/components/core/__snapshots__/PhotoViewer.test.js.snap +18 -6
- package/tests/components/core/__snapshots__/Viewer.test.js.snap +15 -3
- package/tests/components/ui/Photo.test.js +1 -0
- package/tests/components/ui/__snapshots__/Map.test.js.snap +164 -0
- package/tests/utils/InitParameters.test.js +27 -0
- package/tests/utils/map.test.js +12 -0
- package/tests/utils/semantics.test.js +34 -5
- package/docs/reference/components/ui/HashTags.md +0 -15
- 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);
|