@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,175 +0,0 @@
|
|
|
1
|
-
import Map from "./Map.js";
|
|
2
|
-
import { SEMANTICS_OVERLAYS } from "../../utils/semantics.js";
|
|
3
|
-
import { SEMANTICS_OVERLAY_MAXZOOM, SEMANTICS_OVERLAY_MINZOOM } from "../../utils/SemanticsMapProtocol.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* MapMore is a more complete version of [Map UI component](#Panoramax.components.ui.Map).
|
|
8
|
-
*
|
|
9
|
-
* It offers advanced features filters and semantic overlays.
|
|
10
|
-
*
|
|
11
|
-
* Note that all functions of [MapLibre GL JS class Map](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/) are also available.
|
|
12
|
-
*
|
|
13
|
-
* ℹ️ Many style management is done in [MapStyleComposer](#Panoramax.utils.MapStyleComposer), which is available as a property of parent component.
|
|
14
|
-
*
|
|
15
|
-
* ⚠️ This class doesn't inherit from [EventTarget](https://developer.mozilla.org/fr/docs/Web/API/EventTarget), so it doesn't have `addEventListener` and `dispatchEvent` functions.
|
|
16
|
-
* It uses instead [`on`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Map/#on) and `fire` functions from MapLibre Map class.
|
|
17
|
-
* `fire` function doesn't take directly [`Event`](https://developer.mozilla.org/fr/docs/Web/API/Event) objects, but a string and object data.
|
|
18
|
-
* @class Panoramax.components.ui.MapMore
|
|
19
|
-
* @extends Panoramax.components.ui.Map
|
|
20
|
-
* @param {Panoramax.components.core.Basic} parent The parent view
|
|
21
|
-
* @param {Element} container The DOM element to create into
|
|
22
|
-
* @param {object} [options] The map options (any of [MapLibre GL settings](https://maplibre.org/maplibre-gl-js/docs/API/type-aliases/MapOptions/) or any supplementary option defined here)
|
|
23
|
-
* @param {object} [options.raster] The MapLibre raster source for aerial background. This must be a JSON object following [MapLibre raster source definition](https://maplibre.org/maplibre-style-spec/sources/#raster).
|
|
24
|
-
* @param {object} [options.basemaps] List of complementary basemaps, as { id: {MapLibre Style JSON or URL} }. Note that special IDs streets and aerial are reserved for default backgrounds.
|
|
25
|
-
* @param {string} [options.background=streets] Choose default map background to display (streets or aerial, if raster aerial background available). Defaults to streets.
|
|
26
|
-
* @param {string} [options.attributionControl.customAttribution] To override default map attribution.
|
|
27
|
-
* @param {boolean} [options.picMarkerDraggable] To make the picture marker draggable, default to false.
|
|
28
|
-
* @param {object} [options.indoor] The indoor= MapLibre plugin options. This must be a JSON object following [IndoorEqual parameters](https://indoorequal.com/doc/maplibre-gl-indoorequal/api#parameters). Note that this is only available if [maplibre-gl-indoorequal](https://indoorequal.com/doc/maplibre-gl-indoorequal) plugin is loaded in your web page.
|
|
29
|
-
* @param {string} [options.indoor.level] (only if indoor= plugin is enabled) The initial indoor level to display. Defaults to ground or disabled depending on indoor map availability.
|
|
30
|
-
* @param {boolean} [options.indoor.visible=true] (only if indoor= plugin is enabled) The initial indoor visibility. Set to false to avoid data loading before user explicitly enables indoor through widgets. If set to false, you may not set any level option in component.
|
|
31
|
-
* @param {string} [options.theme=default] The map theme (default, age, score, type)
|
|
32
|
-
* @fires Panoramax.components.ui.Map#sequence-hover
|
|
33
|
-
* @fires Panoramax.components.ui.Map#sequence-click
|
|
34
|
-
* @fires Panoramax.components.ui.Map#picture-click
|
|
35
|
-
* @example
|
|
36
|
-
* const map = new Panoramax.components.ui.MapMore(viewer, mapNode, {center: {lat: 48.7, lng: -1.7}});
|
|
37
|
-
*/
|
|
38
|
-
export default class MapMore extends Map {
|
|
39
|
-
constructor(parent, container, options = {}) {
|
|
40
|
-
super(parent, container, options);
|
|
41
|
-
|
|
42
|
-
// Map theme
|
|
43
|
-
if(this._options.theme) { this._parent.mapStyleComposer.setPanoramaxTheme(this._options.theme); }
|
|
44
|
-
|
|
45
|
-
// Features restrictions
|
|
46
|
-
this._featuresRestrict = { pictures: {}, sequences: {} };
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @private */
|
|
50
|
-
async _postLoad() {
|
|
51
|
-
if(this._parent.api._endpoints.queryables) {
|
|
52
|
-
SEMANTICS_OVERLAYS.forEach(so => this.addSemanticOverlay(...so));
|
|
53
|
-
}
|
|
54
|
-
await super._postLoad();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Change the map filters
|
|
59
|
-
* @param {object} filters Filtering values
|
|
60
|
-
* @param {string} [filters.minDate] Start date for pictures (format YYYY-MM-DD)
|
|
61
|
-
* @param {string} [filters.maxDate] End date for pictures (format YYYY-MM-DD)
|
|
62
|
-
* @param {string} [filters.pic_type] Type of picture to keep (flat, equirectangular)
|
|
63
|
-
* @param {string} [filters.camera] Camera make and model to keep
|
|
64
|
-
* @param {string} [filters.theme] Map theme to use
|
|
65
|
-
* @param {number[]} [filters.qualityscore] QualityScore values, as a list of 1 to 5 grades
|
|
66
|
-
* @param {number[]} [filters.gps] GPS precision grades, as a list of 1 to 5 grades
|
|
67
|
-
* @param {string} [filters.source] Source of vector tiles, either "local" (this API) or "metacatalog" (federated catalog)
|
|
68
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
69
|
-
*/
|
|
70
|
-
setFilters(filters) {
|
|
71
|
-
const prevFilters = this._parent.mapStyleComposer.panoramaxFilters;
|
|
72
|
-
const nextFilters = Object.assign({featuresRestrictions: prevFilters.featuresRestrictions}, filters);
|
|
73
|
-
this._parent.mapStyleComposer.setPanoramaxFilters(nextFilters);
|
|
74
|
-
|
|
75
|
-
if(filters.theme) { this._parent.mapStyleComposer.setPanoramaxTheme(filters.theme); }
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Restrict the visible pictures or sequences on map.
|
|
80
|
-
* @param {string} restriction "keep" or "hide"
|
|
81
|
-
* @param {string} type "pictures" or "sequences"
|
|
82
|
-
* @param {string[]} features The list of features UUIDs concerned by this rule
|
|
83
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
84
|
-
*/
|
|
85
|
-
restrictVisibleFeatures(restriction, type, features) {
|
|
86
|
-
this._featuresRestrict[type] = { rule: restriction, features };
|
|
87
|
-
|
|
88
|
-
const prevFilters = this._parent.mapStyleComposer.panoramaxFilters;
|
|
89
|
-
const nextFilters = Object.assign({}, prevFilters, {featuresRestrictions: this._featuresRestrict});
|
|
90
|
-
this._parent.mapStyleComposer.setPanoramaxFilters(nextFilters);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Add a new semantic overlay on map
|
|
95
|
-
* @param {string} id The layer ID
|
|
96
|
-
* @param {string} apiFilter The API filter for semantics, [as documented in API](https://api.panoramax.xyz/redoc#tag/Items/operation/get_api-search-5769f3316ef291861415451c98c2e33f)
|
|
97
|
-
* @param {object} layerStyle The [MapLibre GL layer style](https://maplibre.org/maplibre-style-spec/layers/) to apply, including default visibility. Note that a "metadata" property is required to properly show it in Tags widget. If no metadata is set, layer is added as a "secret" layer (for internal mechanics).
|
|
98
|
-
* @param {object} [sprites] The optional sprites to load
|
|
99
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
100
|
-
*/
|
|
101
|
-
addSemanticOverlay(id, apiFilter, layerStyle, sprites = {}) {
|
|
102
|
-
if(!this._parent.getAPI()._endpoints.queryables) {
|
|
103
|
-
throw new Error("Semantics overlay are not available on API");
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const srcId = "sem-"+id;
|
|
107
|
-
const isVisible = layerStyle.layout.visibility !== "none";
|
|
108
|
-
const myLayerStyle = {
|
|
109
|
-
sources: {
|
|
110
|
-
[srcId]: {
|
|
111
|
-
type: "vector",
|
|
112
|
-
tiles: [`sem:///${apiFilter}/{z}/{x}/{y}`],
|
|
113
|
-
minzoom: SEMANTICS_OVERLAY_MINZOOM,
|
|
114
|
-
maxzoom: SEMANTICS_OVERLAY_MAXZOOM
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
layers: [
|
|
118
|
-
{
|
|
119
|
-
id,
|
|
120
|
-
source: srcId,
|
|
121
|
-
"source-layer": "layer",
|
|
122
|
-
...JSON.parse(JSON.stringify(layerStyle))
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
sprite: Object
|
|
126
|
-
.entries(sprites || {})
|
|
127
|
-
.map(([k,v]) => ({ id: k, url: v }))
|
|
128
|
-
};
|
|
129
|
-
delete myLayerStyle.layers[0].layout.visibility; // Get rid of original visibility
|
|
130
|
-
this._parent.mapStyleComposer.addDataOverlay(
|
|
131
|
-
srcId,
|
|
132
|
-
myLayerStyle,
|
|
133
|
-
isVisible
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
// Click event
|
|
137
|
-
this.on("click", id, e => {
|
|
138
|
-
e.preventDefault();
|
|
139
|
-
if(e?.features?.length > 0) {
|
|
140
|
-
const f = e.features[0];
|
|
141
|
-
this._parent.select(f.properties.seqid, f.properties.picid);
|
|
142
|
-
this._parent.psv.addEventListener("picture-loaded", () => {
|
|
143
|
-
const picMeta = this._parent.psv.getPictureMetadata();
|
|
144
|
-
if(picMeta.properties?.annotations?.length === 1) {
|
|
145
|
-
this._parent.psv.focusOnAnnotation(picMeta.properties.annotations[0].id);
|
|
146
|
-
}
|
|
147
|
-
}, { once: true });
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* List existing semantic overlays, either visible or not.
|
|
154
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
155
|
-
* @returns {object[]} List of MapLibre layers
|
|
156
|
-
*/
|
|
157
|
-
getSemanticOverlays() {
|
|
158
|
-
return Object
|
|
159
|
-
.entries(this._parent.mapStyleComposer.layerRanges.dataOverlays)
|
|
160
|
-
.filter(([k,]) => k.startsWith("sem-"))
|
|
161
|
-
.map(([,v]) => v.layers[0]);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Change visibility of all semantics overlays at once.
|
|
166
|
-
* @param {boolean} visible True to make all visible
|
|
167
|
-
* @memberof Panoramax.components.core.MapMore#
|
|
168
|
-
*/
|
|
169
|
-
toggleAllSemanticOverlays(visible) {
|
|
170
|
-
Object
|
|
171
|
-
.keys(this._parent.mapStyleComposer.layerRanges.dataOverlays)
|
|
172
|
-
.filter(k => k.startsWith("sem-"))
|
|
173
|
-
.forEach(k => this._parent.mapStyleComposer.switchDataOverlayVisibility(k, visible));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/* Smaller loading text */
|
|
2
|
-
.psv-loader-text {
|
|
3
|
-
text-align: center;
|
|
4
|
-
font-size: 0.9em;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.psv-loader-image { width: 80%; }
|
|
8
|
-
|
|
9
|
-
.psv-overlay { opacity: 1 !important; }
|
|
10
|
-
|
|
11
|
-
/* Hide PSV tooltips */
|
|
12
|
-
.psv-virtual-tour-tooltip { display: none; }
|
|
13
|
-
|
|
14
|
-
/* Resize canvas for print */
|
|
15
|
-
@media print {
|
|
16
|
-
.pnx-psv canvas {
|
|
17
|
-
width: 100% !important;
|
|
18
|
-
height: unset !important;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Virtual Tour SVG arrows */
|
|
23
|
-
.pnx-psv-tour-arrows {
|
|
24
|
-
background: none;
|
|
25
|
-
border: none;
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
.pnx-psv-tour-arrows:active svg,
|
|
29
|
-
.pnx-psv-tour-arrows.pnx-clicked svg {
|
|
30
|
-
opacity: 0.4;
|
|
31
|
-
transition: opacity 0.2s ease;
|
|
32
|
-
}
|
|
33
|
-
.pnx-psv-tour-arrows svg {
|
|
34
|
-
width: 100%;
|
|
35
|
-
height: auto;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.pnx-psv-tour-arrows svg:hover {
|
|
39
|
-
filter: drop-shadow(0 0 15px var(--blue));
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.pnx-psv-playing .pnx-psv-tour-arrows {
|
|
43
|
-
display: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/* No virtual tour arrows or annotations if photo is reduced */
|
|
47
|
-
pnx-mini .psv-virtual-tour-arrows,
|
|
48
|
-
pnx-mini .pnx-psv-annotation {
|
|
49
|
-
display: none;
|
|
50
|
-
}
|