@geogirafe/lib-geoportal 1.1.0-dev.2321641404 → 1.1.0-dev.2334445027

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.
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Suche sichtbar",
353
353
  "Search...": "Suchen...",
354
354
  "search_tip": "Ort, Objekt oder Karte suchen",
355
+ "search_tooltip": "Suchen Sie nach einem Ort, einer Adresse, einer Karte oder geografischen Daten",
355
356
  "searchFillColor": "Suchresultat Füllfarbe",
356
357
  "searchStrokeColor": "Suchresultat Strichfarbe",
357
358
  "Select all": "Alles auswählen",
@@ -353,6 +353,7 @@
353
353
  "Search visible": "Search visible",
354
354
  "Search...": "Search...",
355
355
  "search_tip": "Search for a place, object or map",
356
+ "search_tooltip": "Search for a place, address, map, or geographic data",
356
357
  "searchFillColor": "Search result fill color",
357
358
  "searchStrokeColor": "Search result stroke color",
358
359
  "Select all": "Select all",
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Recherche visible",
353
353
  "Search...": "Rechercher...",
354
354
  "search_tip": "Rechercher un lieu, un objet ou une carte",
355
+ "search_tooltip": "Rechercher un lieu, une adresse, une carte ou une donnée géographique",
355
356
  "searchFillColor": "Couleur de remplissage des résultats de recherche",
356
357
  "searchStrokeColor": "Couleur du trait des résultats de recherche",
357
358
  "Select all": "Tout sélectionner",
@@ -352,6 +352,7 @@
352
352
  "Search visible": "Ricerca visibile",
353
353
  "Search...": "Cerca...",
354
354
  "search_tip": "Cerca un luogo, un oggetto o una mappa",
355
+ "search_tooltip": "Cerca un luogo, un indirizzo, una mappa o un dato geografico",
355
356
  "searchFillColor": "Colore di riempimento dei risultati della ricerca",
356
357
  "searchStrokeColor": "Colore del tratto dei risultati della ricerca",
357
358
  "Select all": "Seleziona tutto",
@@ -66,7 +66,7 @@ export default class MFPEncoder {
66
66
  // If all the children have the same ogcServer and the group
67
67
  // has no grandchildren, we keep the layers together
68
68
  if (group.isMixed === false && group.hasGrandChildren === false) {
69
- layers.push(group);
69
+ layers.push(...group.children);
70
70
  }
71
71
  else {
72
72
  const resultLayers = this.getFlatLayers(group.children);
@@ -87,10 +87,14 @@ describe('MFPEncoder', () => {
87
87
  expect(result.dpi).toBe(defaultOptions.dpi);
88
88
  expect(result.scale).toBe(defaultOptions.scale);
89
89
  expect(result.rotation).toBe(180);
90
- expect(result.layers.length).toBe(5);
90
+ expect(result.layers.length).toBe(6);
91
91
  // Test order
92
92
  expect(result.layers[0].name).toBe('Test Vector layer');
93
- expect(result.layers[4].name).toBe('basemap-below');
93
+ expect(result.layers[1].layers[0]).toBe('wms-2');
94
+ expect(result.layers[2].name).toBe('testWmts');
95
+ expect(result.layers[3].layers[0]).toBe('wms-0');
96
+ expect(result.layers[4].layers[0]).toBe('wms-1');
97
+ expect(result.layers[5].name).toBe('basemap-below');
94
98
  });
95
99
  });
96
100
  describe('encodeWmsLayer method', () => {
@@ -132,7 +132,7 @@ export class MFPLegendEncoder {
132
132
  }
133
133
  const layerNames = layerWms.layers?.split(',') ?? [];
134
134
  layerNames.forEach((name) => {
135
- const url = LegendHelper.getWMSLegendURL(layerWms.ogcServer.url, name, {
135
+ const url = LegendHelper.getWMSLegendURL(layerWms.ogcServer, name, {
136
136
  dpi,
137
137
  serverType,
138
138
  scale: this.options?.scale,
@@ -1,6 +1,6 @@
1
1
  import { it, describe, expect, beforeEach, afterAll } from 'vitest';
2
2
  import { MFPLegendEncoder } from './MFPLegendEncoder';
3
- import { createTestGroupLayer, createTestLayerWms, createTestLayerWmts, createTestOgcServer } from '../../../tools/tests/layerhelpers';
3
+ import { createTestGroupLayer, createTestLayerWms, createTestLayerWmsQGis, createTestLayerWmts, createTestOgcServer } from '../../../tools/tests/layerhelpers';
4
4
  import MockHelper from '../../../tools/tests/mockhelper';
5
5
  import { createOlWmtsLayer } from '../../../tools/tests/olhelpers';
6
6
  describe('MFPLegendEncoder', () => {
@@ -199,6 +199,21 @@ describe('MFPLegendEncoder', () => {
199
199
  });
200
200
  });
201
201
  });
202
+ describe('encodeLayerWmsLegendClasses QGis', () => {
203
+ let layer;
204
+ beforeEach(() => {
205
+ layer = createTestLayerWmsQGis();
206
+ });
207
+ it('should return MFPLegendClass for QGisServer (including LAYERTITLE)', () => {
208
+ layer.layers = 'foo';
209
+ const result = encoder.encodeLayerWmsLegendClasses(layer);
210
+ expect(result?.name).toEqual('testWmsQGis');
211
+ // One layer = no subclass, complete directly the current class.
212
+ expect(result?.icons).toEqual([
213
+ 'https://ogc.test.url?FORMAT=image%2Fpng&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER=foo&LAYERTITLE=False&SCALE=10000'
214
+ ]);
215
+ });
216
+ });
202
217
  it('getLegendClassForWMS', () => {
203
218
  const layerName = 'LayerName';
204
219
  const icon_dpi = {
@@ -68,6 +68,7 @@ declare class SearchComponent extends GirafeHTMLElement {
68
68
  onMouseMove(): void;
69
69
  onKeyDown(e: KeyboardEvent): void;
70
70
  private navigateToResult;
71
+ private createTooltip;
71
72
  private initColorPicker;
72
73
  private updatePreviewLayerStyle;
73
74
  private defaultColorHasChanged;
@@ -2,6 +2,7 @@ import { html as uHtml } from 'uhtml';
2
2
  import Collection from 'ol/Collection.js';
3
3
  import Feature from 'ol/Feature.js';
4
4
  import GeoJSON from 'ol/format/GeoJSON.js';
5
+ import tippy from 'tippy.js';
5
6
  import VectorSource from 'ol/source/Vector.js';
6
7
  import VectorLayer from 'ol/layer/Vector.js';
7
8
  import { Point } from 'ol/geom.js';
@@ -20,9 +21,9 @@ class SearchComponent extends GirafeHTMLElement {
20
21
  return uHtml `<style>
21
22
  *{font-family:Arial,sans-serif}.hidden{display:none!important}.gg-rotate90{transform:rotate(90deg)}.gg-rotate180{transform:rotate(180deg)}.gg-rotate270{transform:rotate(270deg)}img{filter:var(--svg-filter)}img.legend-image{filter:var(--svg-map-filter);background:var(--svg-legend-bkg)}div{scrollbar-width:thin}a,a:visited{color:var(--link-color)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes spin-wait{0%{transform:rotate(0)}7%{transform:rotate(360deg)}to{transform:rotate(360deg)}}.gg-spin{animation-name:spin;animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite}.gg-spin-wait{animation-name:spin-wait;animation-duration:10s;animation-timing-function:linear;animation-iteration-count:infinite}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-thumb{background:#999}.gg-button,.gg-select,.gg-input,.gg-textarea{background-color:var(--bkg-color);color:var(--text-color);border:var(--app-standard-border);box-sizing:border-box;cursor:pointer;border-radius:3px;outline:0;margin:0;padding:0 0 0 .5rem;display:inline-block}.gg-label{background-color:var(--bkg-color);color:var(--text-color);border:none;align-items:center;margin:0;padding:0;display:flex}.gg-button,.gg-select,.gg-input,.gg-label{min-height:calc(var(--app-standard-height)/1.5)}.gg-textarea{max-height:initial;resize:vertical;height:6rem;padding:.5rem;line-height:1.3rem}.gg-input{cursor:text}.gg-checkbox{accent-color:var(--text-color);width:1.2rem}.gg-range{accent-color:var(--text-color)}.gg-button{padding:0 .5rem}.gg-button.active{border:solid 1px var(--text-color-grad2);background-color:var(--text-color-grad2);color:var(--bkg-color)}.gg-button:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3;border:none}.gg-input:disabled,.gg-select:disabled,.gg-textarea:disabled{color:gray;cursor:not-allowed;background-color:#d3d3d3}.gg-button>img{vertical-align:middle}.gg-icon-button{color:var(--text-color);cursor:pointer;background-color:#0000;border:none;flex-direction:column;justify-content:center;align-items:center;padding:0;display:flex}.gg-icon{justify-content:center;align-items:center;display:flex}.gg-big,.gg-big-withtext{min-width:var(--app-standard-height);min-height:var(--app-standard-height);max-height:var(--app-standard-height)}.gg-big img,.gg-big-withtext img{width:calc(var(--app-standard-height) - 1.5rem);margin:0}.gg-big-withtext span{font-variant:small-caps;padding:0 1rem;font-size:.9rem}.gg-medium,.gg-medium-withtext{min-width:calc(var(--app-standard-height)/1.2);min-height:calc(var(--app-standard-height)/1.2);max-height:calc(var(--app-standard-height)/1.2);flex-direction:row}.gg-medium img{width:calc(var(--app-standard-height)/2.4);margin:0}.gg-medium-withtext img{width:calc(var(--app-standard-height)/2.4);margin-left:.5rem}.gg-medium-withtext span{padding:0 1rem 0 .5rem;font-size:.9rem}.gg-small,.gg-small-withtext{min-width:calc(var(--app-standard-height)/2);min-height:calc(var(--app-standard-height)/2);max-height:calc(var(--app-standard-height)/2);flex-direction:row}.gg-small img{width:calc(var(--app-standard-height)/3);margin:0}.gg-small-withtext img{width:calc(var(--app-standard-height)/3);margin-left:.5rem}.gg-small-withtext span{padding:0 .5rem 0 .3rem;font-size:.9rem}.gg-button:hover,.gg-select:hover,.gg-input:hover,.gg-textarea:hover,.gg-icon-button:hover{background-color:var(--bkg-color-grad1)}.gg-opacity{opacity:.5}.gg-opacity:hover{opacity:1;background-color:#0000}.gg-tabs{cursor:pointer;grid-auto-flow:column;padding-bottom:1rem;font-size:1rem;display:grid}.gg-tab{border:none;border-bottom:var(--app-standard-border);cursor:pointer;color:var(--text-color);background:0 0;padding:.5rem}.gg-tab.active{border-bottom:solid 1px var(--text-color)}.girafe-button-big,.girafe-button-large,.girafe-button-small,.girafe-button-tiny{color:var(--text-color);background-color:#0000;border:none;flex-direction:column;display:flex}.girafe-button-big:hover,.girafe-button-large:hover,.girafe-button-small:hover,.girafe-button-tiny:hover{background-color:var(--bkg-color-grad1);cursor:pointer}.girafe-button-big.dark,.girafe-button-large.dark,.girafe-button-small.dark,.girafe-button-tiny.dark{background-color:var(--bkg-color);filter:invert()}.girafe-button-big{width:var(--app-standard-height);height:var(--app-standard-height);align-items:center;padding:1rem}.girafe-button-big img{overflow:hidden}.girafe-button-large{flex-direction:row}.girafe-button-large img{height:2rem;margin:.3rem}.girafe-button-large span{height:2rem;margin:.3rem;line-height:2rem}.girafe-button-small{min-width:calc(var(--app-standard-height)/2);height:calc(var(--app-standard-height)/2);align-items:center;padding:.5rem}.girafe-button-small img{overflow:hidden}.girafe-button-small span{text-align:left;text-overflow:ellipsis;width:100%;overflow:hidden}.girafe-button-tiny{align-items:center;width:1rem;height:1rem;padding:0}.girafe-button-tiny img{overflow:hidden}.girafe-onboarding-theme{background-color:var(--bkg-color)!important;color:var(--text-color)!important}.girafe-onboarding-theme button{background-color:var(--bkg-color)!important;color:var(--text-color)!important;text-shadow:none!important}.girafe-onboarding-theme button.driver-popover-close-btn{z-index:10000}
22
23
  </style><style>
23
- .hidden{display:none}#searchbox{background-color:var(--bkg-color);border:1px solid #cfd6dd;border-radius:4px;flex-direction:row;width:100%;height:2.25rem;display:flex}#search{-webkit-appearance:none;width:auto;height:2.25rem;color:var(--text-color);background:0 0;border:0;outline:none;-webkit-flex:auto;-ms-flex:auto;flex:auto;margin:0 0 0 .5rem;padding-left:.8rem;font-size:1rem}.search-icon,.close-icon,.select-color-icon{width:14px;color:var(--text-color);padding:0 1rem}.close-button,.select-color-button{cursor:pointer;background-color:#0000;border:none;padding:0}#results{z-index:1000;background-color:var(--bkg-color);scrollbar-width:thin;width:36rem;max-height:31rem;margin-top:.1rem;margin-bottom:.5rem;position:absolute;top:3.5rem;overflow-x:hidden}.result,.title{width:34rem;padding:.3rem 1rem;line-height:1.3rem;display:inline-block}.title{color:var(--text-color);padding-top:1.5rem;font-size:1.3rem;font-weight:600;line-height:2.5rem}.result{cursor:pointer;text-align:left;width:100%;color:var(--text-color);background:0 0;border:none;border-top:1px solid #ccc}.title img{width:14px;margin-right:1rem}.title span{text-transform:uppercase}.result.selected{color:var(--text-color);background-color:#aaa!important}#no-result{background:var(--warning-color);opacity:.75;visibility:hidden;pointer-events:none;border-radius:6px;width:fit-content;margin:auto;padding:.5rem 0;font-size:1rem;position:absolute;top:3.5rem;left:0;right:0}#no-result>span{padding:1.3rem}@keyframes fadeOut{0%{opacity:1}80%{opacity:1}to{opacity:0}}.shown-then-fadeout{animation:2s ease-in-out forwards fadeOut;visibility:visible!important}
24
+ .hidden{display:none}#searchbox{background-color:var(--bkg-color);border:1px solid #cfd6dd;border-radius:4px;flex-direction:row;width:100%;height:2.25rem;display:flex;& slot[name=search-tooltip]{display:none}}#search{-webkit-appearance:none;width:auto;height:2.25rem;color:var(--text-color);background:0 0;border:0;outline:none;-webkit-flex:auto;-ms-flex:auto;flex:auto;margin:0 0 0 .5rem;padding-left:.8rem;font-size:1rem}.search-icon,.close-icon,.select-color-icon{width:14px;color:var(--text-color);padding:0 1rem}.close-button,.select-color-button{cursor:pointer;background-color:#0000;border:none;padding:0}#results{z-index:1000;background-color:var(--bkg-color);scrollbar-width:thin;width:36rem;max-height:31rem;margin-top:.1rem;margin-bottom:.5rem;position:absolute;top:3.5rem;overflow-x:hidden}.result,.title{width:34rem;padding:.3rem 1rem;line-height:1.3rem;display:inline-block}.title{color:var(--text-color);padding-top:1.5rem;font-size:1.3rem;font-weight:600;line-height:2.5rem}.result{cursor:pointer;text-align:left;width:100%;color:var(--text-color);background:0 0;border:none;border-top:1px solid #ccc}.title img{width:14px;margin-right:1rem}.title span{text-transform:uppercase}.result.selected{color:var(--text-color);background-color:#aaa!important}#no-result{background:var(--warning-color);opacity:.75;visibility:hidden;pointer-events:none;border-radius:6px;width:fit-content;margin:auto;padding:.5rem 0;font-size:1rem;position:absolute;top:3.5rem;left:0;right:0}#no-result>span{padding:1.3rem}@keyframes fadeOut{0%{opacity:1}80%{opacity:1}to{opacity:0}}.shown-then-fadeout{animation:2s ease-in-out forwards fadeOut;visibility:visible!important}
24
25
  </style>
25
- <link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="searchbox"><input tip="search_tip" id="search" class="gg-input" length="20" maxlength="1000" autocomplete="off" autocorrect="off" i18n="Search..." placeholder="Search..." oninput="${(e) => this.doSearchDebounced(e)}" onfocusin="${() => this.onFocusIn()}" onfocusout="${() => this.onFocusOut()}" onkeydown="${(e) => this.onKeyDown(e)}"> <img class="${this.allResults.length > 0 ? 'hidden' : 'search-icon'}" alt="search-icon" src="${this.searchIcon}"> <button class="${this.allResults.length > 0 ? 'close-button' : 'hidden'}" onclick="${() => this.clearSearch(true)}"><img class="close-icon" alt="close-icon" src="icons/close.svg"></button> <button tip="change_search_result_color" id="colorPickerBtn" class="${this.paintSearchResults ? 'select-color-button' : 'hidden'}"><img class="select-color-icon" alt="select-color-icon" src="${this.paintbrushIcon}"></button><div id="results" class="${Object.keys(this.groupedResults).length === 0 || this.forceHide ? 'hidden' : ''}" onmousemove="${() => this.onMouseMove()}">${Object.keys(this.groupedResults).map(group => uHtml `<div class="title"><img alt="result icon" src="${this.getIcon(group)}"> <span i18n="${group}"></span></div>${this.groupedResults[group].map(result => uHtml ` <button class="${result.get('selected') ? 'result selected' : 'result'}" onmousedown="${() => this.onMouseDown()}" onclick="${() => this.onSelect(result)}" onmouseover="${() => this.onMouseOver(result)}" onmouseleave="${() => this.onMouseLeave()}">${result.get('label')}</button> `)} `)}</div><div id="no-result" class="${this.showNoResultWarning ? 'shown-then-fadeout' : ''}"><span i18n="${'No match found'}"></span></div></div>`;
26
+ <link rel="stylesheet" href="lib/vanilla-picker/vanilla-picker.csp.css"><link rel="stylesheet" href="styles/girafecolorpicker.css"><div id="searchbox"><slot name="search-tooltip"></slot><input id="search" class="gg-input" length="20" maxlength="1000" autocomplete="off" autocorrect="off" i18n="Search..." placeholder="Search..." oninput="${(e) => this.doSearchDebounced(e)}" onfocusin="${() => this.onFocusIn()}" onfocusout="${() => this.onFocusOut()}" onkeydown="${(e) => this.onKeyDown(e)}"> <img class="${this.allResults.length > 0 ? 'hidden' : 'search-icon'}" alt="search-icon" src="${this.searchIcon}"> <button class="${this.allResults.length > 0 ? 'close-button' : 'hidden'}" onclick="${() => this.clearSearch(true)}"><img class="close-icon" alt="close-icon" src="icons/close.svg"></button> <button tip="change_search_result_color" id="colorPickerBtn" class="${this.paintSearchResults ? 'select-color-button' : 'hidden'}"><img class="select-color-icon" alt="select-color-icon" src="${this.paintbrushIcon}"></button><div id="results" class="${Object.keys(this.groupedResults).length === 0 || this.forceHide ? 'hidden' : ''}" onmousemove="${() => this.onMouseMove()}">${Object.keys(this.groupedResults).map(group => uHtml `<div class="title"><img alt="result icon" src="${this.getIcon(group)}"> <span i18n="${group}"></span></div>${this.groupedResults[group].map(result => uHtml ` <button class="${result.get('selected') ? 'result selected' : 'result'}" onmousedown="${() => this.onMouseDown()}" onclick="${() => this.onSelect(result)}" onmouseover="${() => this.onMouseOver(result)}" onmouseleave="${() => this.onMouseLeave()}">${result.get('label')}</button> `)} `)}</div><div id="no-result" class="${this.showNoResultWarning ? 'shown-then-fadeout' : ''}"><span i18n="${'No match found'}"></span></div></div>`;
26
27
  };
27
28
  searchIcon = SearchIcon;
28
29
  paintbrushIcon = PaintbrushIcon;
@@ -116,6 +117,7 @@ class SearchComponent extends GirafeHTMLElement {
116
117
  this.render();
117
118
  super.girafeTranslate();
118
119
  this.registerEvents();
120
+ this.createTooltip();
119
121
  if (this.context.permalinkManager.hasSearch()) {
120
122
  this.subscribe('application.isReady', () => {
121
123
  if (this.state.application.isReady) {
@@ -454,6 +456,39 @@ class SearchComponent extends GirafeHTMLElement {
454
456
  break;
455
457
  }
456
458
  }
459
+ createTooltip() {
460
+ const searchInput = this.shadowRoot?.getElementById('search');
461
+ if (searchInput) {
462
+ // Create a tooltip using tippy.js
463
+ tippy(searchInput, {
464
+ content: () => {
465
+ // Check if there's a slot named "search-tooltip"
466
+ const slot = this.shadow.querySelector('slot[name="search-tooltip"]');
467
+ if (slot) {
468
+ const assignedNodes = slot.assignedNodes({ flatten: true });
469
+ if (assignedNodes.length > 0) {
470
+ // Create a temporary div to hold the content
471
+ const tooltipContent = document.createElement('div');
472
+ assignedNodes.forEach((node) => {
473
+ tooltipContent.appendChild(node.cloneNode(true));
474
+ });
475
+ return tooltipContent;
476
+ }
477
+ }
478
+ // Fallback to the default tooltip text if no slot content is found
479
+ return this.context.i18nManager.getTranslation('search_tooltip') || 'Search...';
480
+ },
481
+ trigger: 'mouseenter',
482
+ hideOnClick: false,
483
+ interactive: true,
484
+ theme: 'light',
485
+ placement: 'bottom',
486
+ arrow: true,
487
+ appendTo: document.body,
488
+ maxWidth: '300px'
489
+ });
490
+ }
491
+ }
457
492
  initColorPicker() {
458
493
  super.render();
459
494
  const colorPicker = this.shadowRoot?.getElementById('colorPickerBtn');
package/models/gmf.d.ts CHANGED
@@ -79,7 +79,7 @@ export interface GMFServerOgc {
79
79
  urlWfs?: string;
80
80
  oapifSupport?: boolean;
81
81
  urlOapif?: string;
82
- type: string;
82
+ type: 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
83
83
  imageType: string;
84
84
  attributes?: GMFServerOgcAttributes;
85
85
  }
@@ -6,7 +6,7 @@ export default class ServerOgc {
6
6
  urlWfs?: string;
7
7
  oapifSupport: boolean;
8
8
  urlOapif?: string;
9
- type: string;
9
+ type: 'mapserver' | 'qgisserver' | 'georama' | 'geoserver' | 'arcgis' | 'other';
10
10
  imageType: string;
11
11
  aliases: Record<string, string>;
12
12
  constructor(name: string, elem: GMFServerOgc);
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geomapfish.dev"
7
7
  },
8
- "version": "1.1.0-dev.2321641404",
8
+ "version": "1.1.0-dev.2334445027",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -86,7 +86,13 @@
86
86
  <header>
87
87
  <girafe-theme-select data-tour="theme-selection"></girafe-theme-select>
88
88
  <img class="logo" alt="geogirafe-logo" src="images/logo/horizontal_black.svg" />
89
- <girafe-search id="search"></girafe-search>
89
+ <girafe-search id="search">
90
+ <!-- <div slot="search-tooltip">
91
+ <p>
92
+ Create a custom tooltip
93
+ </p>
94
+ </div> -->
95
+ </girafe-search>
90
96
  <girafe-oauth></girafe-oauth>
91
97
  <girafe-nav-history></girafe-nav-history>
92
98
  <girafe-video-record></girafe-video-record>
@@ -1 +1 @@
1
- {"version":"1.1.0-dev.2321641404", "build":"2321641404", "date":"12/02/2026"}
1
+ {"version":"1.1.0-dev.2334445027", "build":"2334445027", "date":"18/02/2026"}
@@ -1,14 +1,15 @@
1
1
  import TileLayer from 'ol/layer/Tile.js';
2
2
  import WMTS from 'ol/source/WMTS.js';
3
+ import ServerOgc from '../models/serverogc.js';
3
4
  declare class LegendHelper {
4
5
  /**
5
6
  * Get the WMS legend URL.
6
- * @param url The base url of the wms service.
7
+ * @param serverOgc The base url of the wms service.
7
8
  * @param layerName The name of a wms layer.
8
9
  * @param options to create the legend url.
9
10
  * @returns The legend URL or undefined.
10
11
  */
11
- static readonly getWMSLegendURL: (url: string | undefined, layerName: string, options?: WMSLegendURLOptions) => string | undefined;
12
+ static readonly getWMSLegendURL: (serverOgc: ServerOgc, layerName: string, options?: WMSLegendURLOptions) => string | undefined;
12
13
  /**
13
14
  * Retrieves the legend URL for a given WMTS tile layer.
14
15
  * @param {TileLayer<WMTS>} olayer - The OpenLayers tile layer object.
@@ -2,13 +2,13 @@ import { appendParams } from 'ol/uri.js';
2
2
  class LegendHelper {
3
3
  /**
4
4
  * Get the WMS legend URL.
5
- * @param url The base url of the wms service.
5
+ * @param serverOgc The base url of the wms service.
6
6
  * @param layerName The name of a wms layer.
7
7
  * @param options to create the legend url.
8
8
  * @returns The legend URL or undefined.
9
9
  */
10
- static getWMSLegendURL = (url, layerName, options) => {
11
- if (!url) {
10
+ static getWMSLegendURL = (serverOgc, layerName, options) => {
11
+ if (!serverOgc.url) {
12
12
  return undefined;
13
13
  }
14
14
  const queryString = {
@@ -19,6 +19,9 @@ class LegendHelper {
19
19
  REQUEST: 'GetLegendGraphic',
20
20
  LAYER: layerName
21
21
  };
22
+ if (serverOgc.type === 'qgisserver') {
23
+ queryString.LAYERTITLE = 'False';
24
+ }
22
25
  const scale = options?.scale;
23
26
  const legendRule = options?.legendRule;
24
27
  const legendWidth = options?.legendWidth;
@@ -55,7 +58,7 @@ class LegendHelper {
55
58
  if (additionalQueryString) {
56
59
  Object.assign(queryString, additionalQueryString);
57
60
  }
58
- return appendParams(url, queryString);
61
+ return appendParams(serverOgc.url, queryString);
59
62
  };
60
63
  /**
61
64
  * Retrieves the legend URL for a given WMTS tile layer.
@@ -33,7 +33,7 @@ export const DEMO_LAYERS = {
33
33
  urlWfs: '',
34
34
  oapifSupport: true,
35
35
  urlOapif: 'https://geomapfish-demo-2-9.camptocamp.com/mapserv_proxy/QGIS_Server/wfs3',
36
- type: 'gmf',
36
+ type: 'qgisserver',
37
37
  imageType: ''
38
38
  })
39
39
  }
@@ -11,7 +11,7 @@ const server = new ServerOgc('test', {
11
11
  urlWfs: '',
12
12
  oapifSupport: true,
13
13
  urlOapif: mockUrl,
14
- type: 'default',
14
+ type: 'qgisserver',
15
15
  imageType: ''
16
16
  });
17
17
  let context;
@@ -12,7 +12,7 @@ const server = new ServerOgc('test', {
12
12
  urlWfs: '',
13
13
  oapifSupport: true,
14
14
  urlOapif: mockUrl,
15
- type: 'default',
15
+ type: 'qgisserver',
16
16
  imageType: ''
17
17
  });
18
18
  const collectionId = 'test-collection';
@@ -29,7 +29,7 @@ describe('OgcApiFeaturesManager', () => {
29
29
  urlWfs: '',
30
30
  oapifSupport: true,
31
31
  urlOapif: "'https://testUrl.com",
32
- type: 'default',
32
+ type: 'qgisserver',
33
33
  imageType: ''
34
34
  })
35
35
  };
@@ -4,7 +4,9 @@ import GroupLayer, { GroupLayerOptions } from '../../models/layers/grouplayer';
4
4
  import ServerOgc from '../../models/serverogc';
5
5
  import Basemap from '../../models/basemaps/basemap';
6
6
  export declare function createTestOgcServer(): ServerOgc;
7
+ export declare function createTestOgcServerQGis(): ServerOgc;
7
8
  export declare function createTestLayerWms(options?: LayerWmsOptions): LayerWms;
9
+ export declare function createTestLayerWmsQGis(options?: LayerWmsOptions): LayerWms;
8
10
  export declare function createTestLayerWmts(options?: LayerWmtsOptions, ogcServer?: ServerOgc): LayerWmts;
9
11
  export declare function createTestGroupLayer(options?: GroupLayerOptions): GroupLayer;
10
12
  export declare function createTestBasemap(): Basemap;
@@ -11,12 +11,26 @@ export function createTestOgcServer() {
11
11
  imageType: 'image/png'
12
12
  });
13
13
  }
14
+ export function createTestOgcServerQGis() {
15
+ return new ServerOgc('testOgcServer', {
16
+ url: 'https://ogc.test.url',
17
+ wfsSupport: false,
18
+ type: 'qgisserver',
19
+ imageType: 'image/png'
20
+ });
21
+ }
14
22
  export function createTestLayerWms(options) {
15
23
  const ogcServer = createTestOgcServer();
16
24
  const layerWms = new LayerWms(1, 'testWms', 1, ogcServer, options);
17
25
  layerWms.activeState = 'on';
18
26
  return layerWms;
19
27
  }
28
+ export function createTestLayerWmsQGis(options) {
29
+ const ogcServer = createTestOgcServerQGis();
30
+ const layerWms = new LayerWms(1, 'testWmsQGis', 1, ogcServer, options);
31
+ layerWms.activeState = 'on';
32
+ return layerWms;
33
+ }
20
34
  export function createTestLayerWmts(options, ogcServer) {
21
35
  const layerWmts = new LayerWmts(1, 'testWmts', 1, 'https://test.ch', 'testWmts', options, ogcServer);
22
36
  layerWmts.activeState = 'on';
@@ -58,6 +58,9 @@ export default class WmsLegendHelper {
58
58
  graphicUrl += '&HEIGHT=' + this.context.configManager.Config.treeview.defaultIconSize.height;
59
59
  graphicUrl += '&WIDTH=' + this.context.configManager.Config.treeview.defaultIconSize.width;
60
60
  }
61
+ if (layer.ogcServer.type === 'qgisserver') {
62
+ graphicUrl += '&LAYERTITLE=False';
63
+ }
61
64
  legends[l] = graphicUrl;
62
65
  }
63
66
  return legends;