@geogirafe/lib-geoportal 1.2.0-dev.2893241744 → 1.2.0-dev.2896420147

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.
@@ -1,6 +1,7 @@
1
1
  import Geolocation from 'ol/Geolocation.js';
2
2
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
3
3
  type GeolocationStatus = 'off' | 'error' | 'searching' | 'tracking' | 'headlock';
4
+ export type GeolocationIcons = Record<GeolocationStatus, string>;
4
5
  export default class GeolocationMobile extends GirafeHTMLElement {
5
6
  protected templateUrl: string | null;
6
7
  protected styleUrls: string[] | null;
@@ -8,6 +9,7 @@ export default class GeolocationMobile extends GirafeHTMLElement {
8
9
  geolocation: Geolocation | null;
9
10
  status: GeolocationStatus;
10
11
  statusBeforeError: GeolocationStatus;
12
+ icons: GeolocationIcons;
11
13
  private readonly positionFeature;
12
14
  private readonly accuracyFeature;
13
15
  private readonly headingFeature;
@@ -21,7 +23,7 @@ export default class GeolocationMobile extends GirafeHTMLElement {
21
23
  protected connectedCallback(): void;
22
24
  private pauseTracking;
23
25
  private updateIconIfTrackingOutside;
24
- getIconForStatus(): any;
26
+ getIconForStatus(): string | undefined;
25
27
  pointerUp(e: PointerEvent): void;
26
28
  pointerDown(e: PointerEvent): void;
27
29
  preventContextMenu(e: PointerEvent): boolean;
@@ -11,10 +11,6 @@ import Stroke from 'ol/style/Stroke.js';
11
11
  import Style from 'ol/style/Style.js';
12
12
  import { RegularShape } from 'ol/style.js';
13
13
  import GirafeHTMLElement from '../../base/GirafeHTMLElement.js';
14
- import locationDisabledIcon from '../../assets/icons/location_disabled.svg';
15
- import locationSearchingIcon from '../../assets/icons/location_searching.svg';
16
- import locationHeadingIcon from '../../assets/icons/location_heading.svg';
17
- import myLocationIcon from '../../assets/icons/my_location.svg';
18
14
  export default class GeolocationMobile extends GirafeHTMLElement {
19
15
  templateUrl = null;
20
16
  styleUrls = null;
@@ -31,6 +27,13 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
31
27
  geolocation = null;
32
28
  status = 'off';
33
29
  statusBeforeError = 'off';
30
+ icons = {
31
+ off: 'icons/location_disabled.svg',
32
+ error: 'icons/location_disabled.svg',
33
+ searching: 'icons/location_searching.svg',
34
+ tracking: 'icons/my_location.svg',
35
+ headlock: 'icons/location_heading.svg'
36
+ };
34
37
  positionFeature;
35
38
  accuracyFeature;
36
39
  headingFeature;
@@ -241,20 +244,7 @@ ${this.htmlUnsafe(this.feedbackTemplateHtml ?? '')}`;
241
244
  if (!this.geolocation) {
242
245
  return;
243
246
  }
244
- switch (this.status) {
245
- case 'searching':
246
- return locationSearchingIcon;
247
- case 'tracking':
248
- return myLocationIcon;
249
- case 'off':
250
- return locationDisabledIcon;
251
- case 'error':
252
- return locationDisabledIcon;
253
- case 'headlock':
254
- return locationHeadingIcon;
255
- default:
256
- return locationDisabledIcon;
257
- }
247
+ return this.icons[this.status] ?? this.icons.off;
258
248
  }
259
249
  pointerUp(e) {
260
250
  e.stopPropagation();
@@ -22,6 +22,7 @@ export { default as EditComponent } from './edit/component.js';
22
22
  export { default as EditFromComponent } from './edit/editform/component.js';
23
23
  export { default as ExternalLayersComponent } from './extlayers/component.js';
24
24
  export { default as FeedbackButtonComponent } from './feedbackbutton/component.js';
25
+ export type { GeolocationIcons } from './geolocation-mobile/component.js';
25
26
  export { default as GeolocationMobile } from './geolocation-mobile/component.js';
26
27
  export { default as GetDirectionsArtifact } from './getdirections/component.js';
27
28
  export { default as HeaderComponent } from './header/component.js';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "GeoGirafe PSC",
6
6
  "url": "https://doc.geogirafe.org"
7
7
  },
8
- "version": "1.2.0-dev.2893241744",
8
+ "version": "1.2.0-dev.2896420147",
9
9
  "type": "module",
10
10
  "engines": {
11
11
  "node": ">=20.19.0"
@@ -1 +1 @@
1
- {"version":"1.2.0-dev.2893241744", "build":"2893241744", "date":"29/09/2026"}
1
+ {"version":"1.2.0-dev.2896420147", "build":"2896420147", "date":"30/09/2026"}