@panoramax/web-viewer 3.2.1-develop-75fc7b1a → 3.2.1-develop-b47723aa

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panoramax/web-viewer",
3
- "version": "3.2.1-develop-75fc7b1a",
3
+ "version": "3.2.1-develop-b47723aa",
4
4
  "description": "Panoramax web viewer for geolocated pictures",
5
5
  "main": "build/index.js",
6
6
  "author": "Panoramax team",
package/src/Viewer.js CHANGED
@@ -536,7 +536,6 @@ class Viewer extends CoreView {
536
536
  setPopup(visible, content = null) {
537
537
  if(!visible) {
538
538
  this.popupContainer.classList.add("gvs-hidden");
539
- this.setFocus("pic");
540
539
  this.psv.startKeyboardControl();
541
540
  }
542
541
  else if(content) {
@@ -103,6 +103,11 @@
103
103
  "picture_360": "360°",
104
104
  "filter_qualityscore": "Quality score",
105
105
  "filter_qualityscore_help": "Click to enable or disable",
106
+ "qualityscore_title": "About the quality score",
107
+ "qualityscore_doc_1": "Panoramax offers a Quality Score for each picture. It allows easy map filtering and comprehensive display of high-quality pictures availability.",
108
+ "qualityscore_doc_2": "The grade is shown to users as a A/B/C/D/E score (A is the best, E the worst), and shown graphically through this scale:",
109
+ "qualityscore_doc_3": "It is computed based on GPS precision and picture resolution. A professional system will have an A-rating, a 360° action camera will have a B-rating, and a smartphone will be C/D/E-rated.",
110
+ "qualityscore_doc_link": "More details about the Quality Score computation is available in our documentation.",
106
111
  "map_background": "Map background",
107
112
  "map_background_aerial": "Aerial",
108
113
  "map_background_streets": "Streets",
@@ -102,6 +102,11 @@
102
102
  "picture_360": "360°",
103
103
  "filter_qualityscore": "Score de qualité",
104
104
  "filter_qualityscore_help": "Cliquez pour activer ou désactiver",
105
+ "qualityscore_title": "À propos du score qualité",
106
+ "qualityscore_doc_1": "Panoramax propose un Score de Qualité pour chacune de ses photos. Cela facilite le filtre et la recherche de photos de bonne qualité sur la carte.",
107
+ "qualityscore_doc_2": "Le score est affiché sous la forme d'une lettre A/B/C/D/E (A étant le meilleur, E le moins bon), et visualisable grâce à cette échelle :",
108
+ "qualityscore_doc_3": "Il est calculé en fonction de la précision du GPS ainsi que la résolution de la photo. Un matériel professionnel aura une note de A, une caméra sportive 360° une note de B, et un smartphone une note de C à E.",
109
+ "qualityscore_doc_link": "Plus d'infos sur le calcul du Score Qualité dans notre documentation.",
105
110
  "filter_zoom_in": "Zoomez plus pour voir les filtres",
106
111
  "map_background": "Fond de carte",
107
112
  "map_background_aerial": "Satellite",
@@ -50,7 +50,7 @@
50
50
  "☕ Iniezione di caffeina",
51
51
  "😀 Sorridete, siete stati mappati!",
52
52
  "🐈 Condivisione delle foto di gatti",
53
- "😴 Riduzione della procastinazione",
53
+ "😴 Riduzione della procrastinazione",
54
54
  "🫖 Preparazione del tè",
55
55
  "🐧 Apertura del codice sorgente",
56
56
  "🚇 Indicizzazione delle stazioni della metro",
@@ -31,8 +31,8 @@ export const QUALITYSCORE_VALUES = [
31
31
  { color: "#f6a020", label: "E" },
32
32
  ];
33
33
 
34
- export const QUALITYSCORE_RES_FLAT_VALUES = [1, 15, 2, 38, 3, 60, 4]; // Grade, < Px/FOV value
35
- export const QUALITYSCORE_RES_360_VALUES = [2, 15, 3, 20, 4, 38, 5]; // Grade, < Px/FOV value
34
+ export const QUALITYSCORE_RES_FLAT_VALUES = [1, 10, 2, 15, 3, 30, 4]; // Grade, < Px/FOV value
35
+ export const QUALITYSCORE_RES_360_VALUES = [3, 15, 4, 30, 5]; // Grade, < Px/FOV value
36
36
  export const QUALITYSCORE_GPS_VALUES = [5, 1.01, 4, 2.01, 3, 5.01, 2, 10.01, 1]; // Grade, < Meters value
37
37
  export const QUALITYSCORE_POND_RES = 4/5;
38
38
  export const QUALITYSCORE_POND_GPS = 1/5;
@@ -103,6 +103,12 @@
103
103
 
104
104
  .gvs-mini .gvs-corner .gvs-widget-bg { box-shadow: none; }
105
105
  .gvs-widget-bg a { color: var(--widget-font-btn-direct); }
106
+ .gvs-widget-bg button.gvs-btn-link {
107
+ color: var(--widget-font-btn-direct);
108
+ background: none;
109
+ border: none;
110
+ cursor: pointer;
111
+ }
106
112
 
107
113
  .gvs-hidden,
108
114
  .gvs-focus-map .gvs-only-psv,
@@ -533,10 +533,12 @@ export default class Widgets {
533
533
 
534
534
  // Picture quality level
535
535
  if(this._viewer?.map?._hasQualityScore()) {
536
- popupContent.push(createHeader(
536
+ const qsHeader = createHeader(
537
537
  "h4",
538
- `${fat(faMedal)} ${this._t.gvs.metadata_quality} <a href="https://docs.panoramax.fr/pictures-metadata/quality_score/" target="_blank" title="${this._t.gvs.metadata_quality_help}">${fat(faInfoCircle)}</a>`
539
- ));
538
+ `${fat(faMedal)} ${this._t.gvs.metadata_quality} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${fat(faInfoCircle)}</button>`
539
+ );
540
+ qsHeader.lastChild.addEventListener("click", () => this._showQualityScoreDoc());
541
+ popupContent.push(qsHeader);
540
542
  const gpsGrade = getGrade(QUALITYSCORE_GPS_VALUES, picMeta?.properties?.["quality:horizontal_accuracy"]);
541
543
  const resGrade = getGrade(
542
544
  picMeta?.horizontalFov === 360 ? QUALITYSCORE_RES_360_VALUES : QUALITYSCORE_RES_FLAT_VALUES,
@@ -567,6 +569,30 @@ export default class Widgets {
567
569
  this._viewer.dispatchEvent(new CustomEvent("focus-changed", { detail: { focus: "meta" } }));
568
570
  }
569
571
 
572
+ _showQualityScoreDoc() {
573
+ const popupContent = [];
574
+ popupContent.push(createHeader("h4", `${fat(faMedal)} ${this._t.gvs.qualityscore_title}`));
575
+
576
+ const link = document.createElement("a");
577
+ link.setAttribute("href", "https://docs.panoramax.fr/pictures-metadata/quality_score/");
578
+ link.setAttribute("target", "_blank");
579
+ link.appendChild(document.createTextNode(this._t.gvs.qualityscore_doc_link));
580
+
581
+ [
582
+ document.createTextNode(this._t.gvs.qualityscore_doc_1),
583
+ document.createTextNode(this._t.gvs.qualityscore_doc_2),
584
+ showQualityScore(5),
585
+ document.createTextNode(this._t.gvs.qualityscore_doc_3),
586
+ link
587
+ ].forEach(elem => {
588
+ const p = document.createElement("p");
589
+ p.appendChild(elem);
590
+ popupContent.push(p);
591
+ });
592
+
593
+ this._viewer.setPopup(true, popupContent);
594
+ }
595
+
570
596
  _showReportForm() {
571
597
  const picMeta = this._viewer.psv.getPictureMetadata();
572
598
  if (!picMeta) { throw new Error("No picture currently selected"); }
@@ -905,9 +931,12 @@ export default class Widgets {
905
931
  </div>
906
932
  <div id="gvs-map-theme-legend-score" class="gvs-map-theme-legend gvs-hidden">
907
933
  ${QUALITYSCORE_VALUES.map(pv => "<span class=\"gvs-qualityscore\" style=\"background-color: "+pv.color+";\">"+pv.label+"</span>").join("")}
934
+ <button id="gvs-map-theme-quality-help" class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${fat(faInfoCircle, {transform: {x: 6, size: 24}})}</button>
908
935
  </div>
909
936
  </div>`;
910
937
 
938
+ pnlLayers.querySelector("#gvs-map-theme-quality-help").addEventListener("click", () => this._showQualityScoreDoc());
939
+
911
940
  // Map theme events
912
941
  const fMapTheme = pnlLayers.querySelector("#gvs-map-theme");
913
942
  const onChange = () => {
@@ -1012,8 +1041,9 @@ export default class Widgets {
1012
1041
  // Create qualityscore filter
1013
1042
  if(hasQualityScore) {
1014
1043
  const title = document.createElement("h4");
1015
- title.innerHTML = `${fat(faMedal)} ${this._t.gvs.filter_qualityscore}`;
1044
+ title.innerHTML = `${fat(faMedal)} ${this._t.gvs.filter_qualityscore} <button class="gvs-btn-link" title="${this._t.gvs.metadata_quality_help}">${fat(faInfoCircle)}</button>`;
1016
1045
  title.style.marginBottom = "3px";
1046
+ title.lastChild.addEventListener("click", () => this._showQualityScoreDoc());
1017
1047
  form.appendChild(title);
1018
1048
 
1019
1049
  const div = document.createElement("div");