@igo2/geo 21.0.0-next.14 → 21.0.0-next.15

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.
@@ -8937,13 +8937,23 @@ function addStopToStopsFeatureStore(stop, stopsFeatureStore, projection, languag
8937
8937
  * @param {boolean} [active=false] - Indicates whether the direction is active or not. Default is false.
8938
8938
  */
8939
8939
  function addRouteToRoutesFeatureStore(routesFeatureStore, directions, projection, active = false) {
8940
- const coordinate = directions.geometry?.coordinates;
8941
- if (!coordinate) {
8940
+ const geometry = directions.geometry;
8941
+ if (!geometry) {
8942
8942
  return;
8943
8943
  }
8944
- const linestring4326 = new olgeom.LineString(coordinate);
8945
- const linestringStore = linestring4326.transform(projection, routesFeatureStore.map.projectionCode);
8946
- const geojsonGeom = new OlGeoJSON().writeGeometryObject(linestringStore, {
8944
+ const coordinate = geometry.coordinates;
8945
+ let directionGeom;
8946
+ if (geometry.type === 'LineString') {
8947
+ directionGeom = new olgeom.LineString(coordinate);
8948
+ }
8949
+ else if (geometry.type === 'MultiLineString') {
8950
+ directionGeom = new olgeom.MultiLineString(coordinate);
8951
+ }
8952
+ else {
8953
+ return;
8954
+ }
8955
+ const directionGeomInMapProjection = directionGeom.transform(projection, routesFeatureStore.map.projectionCode);
8956
+ const geojsonGeom = new OlGeoJSON().writeGeometryObject(directionGeomInMapProjection, {
8947
8957
  featureProjection: routesFeatureStore.map.projectionCode,
8948
8958
  dataProjection: routesFeatureStore.map.projectionCode
8949
8959
  });
@@ -8965,7 +8975,7 @@ function addRouteToRoutesFeatureStore(routesFeatureStore, directions, projection
8965
8975
  id: directions.id,
8966
8976
  revision: previousRouteRevision + 1
8967
8977
  },
8968
- ol: new OlFeature({ linestringStore })
8978
+ ol: new OlFeature({ geometry: directionGeomInMapProjection })
8969
8979
  };
8970
8980
  routesFeatureStore.update(routeFeatureStore);
8971
8981
  }
@@ -17365,7 +17375,7 @@ class DirectionsComponent {
17365
17375
  if (routeResponse) {
17366
17376
  this.routesQueries$$.push(routeResponse.subscribe((directions) => {
17367
17377
  this.routesFeatureStore().deleteMany(this.routesFeatureStore().all());
17368
- directions.map((direction) => addRouteToRoutesFeatureStore(this.routesFeatureStore(), direction, this.projection, direction === directions[0] ? true : false));
17378
+ directions.map((direction) => addRouteToRoutesFeatureStore(this.routesFeatureStore(), direction, direction.projection ?? this.projection, direction === directions[0] ? true : false));
17369
17379
  }));
17370
17380
  }
17371
17381
  }
@@ -17387,7 +17397,7 @@ class DirectionsComponent {
17387
17397
  this.getRoutes(this.isTranslating);
17388
17398
  }
17389
17399
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DirectionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
17390
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DirectionsComponent, isStandalone: true, selector: "igo-directions", inputs: { contextUri: { classPropertyName: "contextUri", publicName: "contextUri", isSignal: true, isRequired: false, transformFunction: null }, stopsStore: { classPropertyName: "stopsStore", publicName: "stopsStore", isSignal: true, isRequired: true, transformFunction: null }, stopsFeatureStore: { classPropertyName: "stopsFeatureStore", publicName: "stopsFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, routesFeatureStore: { classPropertyName: "routesFeatureStore", publicName: "routesFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, stepsFeatureStore: { classPropertyName: "stepsFeatureStore", publicName: "stepsFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, coordRoundedDecimals: { classPropertyName: "coordRoundedDecimals", publicName: "coordRoundedDecimals", isSignal: true, isRequired: false, transformFunction: null }, zoomToActiveRoute: { classPropertyName: "zoomToActiveRoute", publicName: "zoomToActiveRoute", isSignal: true, isRequired: true, transformFunction: null }, authenticated$: { classPropertyName: "authenticated$", publicName: "authenticated$", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"directions-options\">\n @if (sources.length > 1) {\n <mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{\n 'igo.geo.directions.results.routingSource' | translate\n }}</mat-label>\n <mat-select\n [matTooltip]=\"\n 'igo.geo.directions.results.routingSourceTooltip' | translate\n \"\n [value]=\"activeSource\"\n (selectionChange)=\"onSourceChange($event.value)\"\n >\n @for (source of sources; track source) {\n <mat-option [value]=\"source.getSourceId()\">{{\n source.getSourceName()\n }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n\n <mat-slide-toggle\n [checked]=\"directionControlIsActive\"\n [labelPosition]=\"'before'\"\n (change)=\"onToggleDirectionsControl($event.checked)\"\n >\n {{ 'igo.geo.directions.toggle.activateControl' | translate }}\n </mat-slide-toggle>\n</div>\n\n<igo-directions-inputs\n (stopInputHasFocus)=\"onStopInputHasFocusChange($event)\"\n [coordRoundedDecimals]=\"coordRoundedDecimals()\"\n [projection]=\"projection\"\n [stopsFeatureStore]=\"stopsFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n [debounce]=\"debounce()\"\n [length]=\"length()\"\n/>\n\n@if (routesFeatureStore().all().length > 0) {\n <igo-directions-buttons\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [contextUri]=\"contextUri()\"\n (zoomOnActiveRoute)=\"zoomOnActiveRoute()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n />\n}\n\n<igo-directions-results\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n/>\n", styles: [":host{display:block;padding:16px}.directions-options{display:flex;flex-flow:column;align-items:center;row-gap:8px;margin-bottom:16px}.directions-options mat-slide-toggle{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-form-field{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-label{margin-left:0;margin-right:auto;width:auto;padding-right:0}.directions-options mat-slide-toggle ::ng-deep .mdc-slide-toggle{margin-left:auto;margin-right:0}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: DirectionsButtonsComponent, selector: "igo-directions-buttons", inputs: ["contextUri", "stopsStore", "routesFeatureStore", "stepsFeatureStore"], outputs: ["zoomOnActiveRoute"] }, { kind: "component", type: DirectionsInputsComponent, selector: "igo-directions-inputs", inputs: ["stopsStore", "stopsFeatureStore", "projection", "coordRoundedDecimals", "debounce", "length"], outputs: ["stopInputHasFocus"] }, { kind: "component", type: DirectionsResultsComponent, selector: "igo-directions-results", inputs: ["routesFeatureStore", "stepsFeatureStore"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] });
17400
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: DirectionsComponent, isStandalone: true, selector: "igo-directions", inputs: { contextUri: { classPropertyName: "contextUri", publicName: "contextUri", isSignal: true, isRequired: false, transformFunction: null }, stopsStore: { classPropertyName: "stopsStore", publicName: "stopsStore", isSignal: true, isRequired: true, transformFunction: null }, stopsFeatureStore: { classPropertyName: "stopsFeatureStore", publicName: "stopsFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, routesFeatureStore: { classPropertyName: "routesFeatureStore", publicName: "routesFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, stepsFeatureStore: { classPropertyName: "stepsFeatureStore", publicName: "stepsFeatureStore", isSignal: true, isRequired: true, transformFunction: null }, debounce: { classPropertyName: "debounce", publicName: "debounce", isSignal: true, isRequired: false, transformFunction: null }, length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, coordRoundedDecimals: { classPropertyName: "coordRoundedDecimals", publicName: "coordRoundedDecimals", isSignal: true, isRequired: false, transformFunction: null }, zoomToActiveRoute: { classPropertyName: "zoomToActiveRoute", publicName: "zoomToActiveRoute", isSignal: true, isRequired: true, transformFunction: null }, authenticated$: { classPropertyName: "authenticated$", publicName: "authenticated$", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"directions-options\">\n @if (sources.length > 1) {\n <mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{\n 'igo.geo.directions.results.routingSource' | translate\n }}</mat-label>\n <mat-select\n [matTooltip]=\"\n 'igo.geo.directions.results.routingSourceTooltip' | translate\n \"\n [value]=\"activeSource.getSourceId()\"\n (selectionChange)=\"onSourceChange($event.value)\"\n >\n @for (source of sources; track source) {\n <mat-option [value]=\"source.getSourceId()\">{{\n source.getSourceName()\n }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n\n <mat-slide-toggle\n [checked]=\"directionControlIsActive\"\n [labelPosition]=\"'before'\"\n (change)=\"onToggleDirectionsControl($event.checked)\"\n >\n {{ 'igo.geo.directions.toggle.activateControl' | translate }}\n </mat-slide-toggle>\n</div>\n\n<igo-directions-inputs\n (stopInputHasFocus)=\"onStopInputHasFocusChange($event)\"\n [coordRoundedDecimals]=\"coordRoundedDecimals()\"\n [projection]=\"projection\"\n [stopsFeatureStore]=\"stopsFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n [debounce]=\"debounce()\"\n [length]=\"length()\"\n/>\n\n@if (routesFeatureStore().all().length > 0) {\n <igo-directions-buttons\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [contextUri]=\"contextUri()\"\n (zoomOnActiveRoute)=\"zoomOnActiveRoute()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n />\n}\n\n<igo-directions-results\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n/>\n", styles: [":host{display:block;padding:16px}.directions-options{display:flex;flex-flow:column;align-items:center;row-gap:8px;margin-bottom:16px}.directions-options mat-slide-toggle{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-form-field{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-label{margin-left:0;margin-right:auto;width:auto;padding-right:0}.directions-options mat-slide-toggle ::ng-deep .mdc-slide-toggle{margin-left:auto;margin-right:0}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i3$1.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$1.MatLabel, selector: "mat-label" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i4$3.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i4$3.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatSlideToggleModule }, { kind: "component", type: i2$2.MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: DirectionsButtonsComponent, selector: "igo-directions-buttons", inputs: ["contextUri", "stopsStore", "routesFeatureStore", "stepsFeatureStore"], outputs: ["zoomOnActiveRoute"] }, { kind: "component", type: DirectionsInputsComponent, selector: "igo-directions-inputs", inputs: ["stopsStore", "stopsFeatureStore", "projection", "coordRoundedDecimals", "debounce", "length"], outputs: ["stopInputHasFocus"] }, { kind: "component", type: DirectionsResultsComponent, selector: "igo-directions-results", inputs: ["routesFeatureStore", "stepsFeatureStore"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }] });
17391
17401
  }
17392
17402
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: DirectionsComponent, decorators: [{
17393
17403
  type: Component,
@@ -17400,7 +17410,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
17400
17410
  DirectionsInputsComponent,
17401
17411
  DirectionsResultsComponent,
17402
17412
  IgoLanguageModule
17403
- ], template: "<div class=\"directions-options\">\n @if (sources.length > 1) {\n <mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{\n 'igo.geo.directions.results.routingSource' | translate\n }}</mat-label>\n <mat-select\n [matTooltip]=\"\n 'igo.geo.directions.results.routingSourceTooltip' | translate\n \"\n [value]=\"activeSource\"\n (selectionChange)=\"onSourceChange($event.value)\"\n >\n @for (source of sources; track source) {\n <mat-option [value]=\"source.getSourceId()\">{{\n source.getSourceName()\n }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n\n <mat-slide-toggle\n [checked]=\"directionControlIsActive\"\n [labelPosition]=\"'before'\"\n (change)=\"onToggleDirectionsControl($event.checked)\"\n >\n {{ 'igo.geo.directions.toggle.activateControl' | translate }}\n </mat-slide-toggle>\n</div>\n\n<igo-directions-inputs\n (stopInputHasFocus)=\"onStopInputHasFocusChange($event)\"\n [coordRoundedDecimals]=\"coordRoundedDecimals()\"\n [projection]=\"projection\"\n [stopsFeatureStore]=\"stopsFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n [debounce]=\"debounce()\"\n [length]=\"length()\"\n/>\n\n@if (routesFeatureStore().all().length > 0) {\n <igo-directions-buttons\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [contextUri]=\"contextUri()\"\n (zoomOnActiveRoute)=\"zoomOnActiveRoute()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n />\n}\n\n<igo-directions-results\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n/>\n", styles: [":host{display:block;padding:16px}.directions-options{display:flex;flex-flow:column;align-items:center;row-gap:8px;margin-bottom:16px}.directions-options mat-slide-toggle{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-form-field{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-label{margin-left:0;margin-right:auto;width:auto;padding-right:0}.directions-options mat-slide-toggle ::ng-deep .mdc-slide-toggle{margin-left:auto;margin-right:0}\n"] }]
17413
+ ], template: "<div class=\"directions-options\">\n @if (sources.length > 1) {\n <mat-form-field subscriptSizing=\"dynamic\">\n <mat-label>{{\n 'igo.geo.directions.results.routingSource' | translate\n }}</mat-label>\n <mat-select\n [matTooltip]=\"\n 'igo.geo.directions.results.routingSourceTooltip' | translate\n \"\n [value]=\"activeSource.getSourceId()\"\n (selectionChange)=\"onSourceChange($event.value)\"\n >\n @for (source of sources; track source) {\n <mat-option [value]=\"source.getSourceId()\">{{\n source.getSourceName()\n }}</mat-option>\n }\n </mat-select>\n </mat-form-field>\n }\n\n <mat-slide-toggle\n [checked]=\"directionControlIsActive\"\n [labelPosition]=\"'before'\"\n (change)=\"onToggleDirectionsControl($event.checked)\"\n >\n {{ 'igo.geo.directions.toggle.activateControl' | translate }}\n </mat-slide-toggle>\n</div>\n\n<igo-directions-inputs\n (stopInputHasFocus)=\"onStopInputHasFocusChange($event)\"\n [coordRoundedDecimals]=\"coordRoundedDecimals()\"\n [projection]=\"projection\"\n [stopsFeatureStore]=\"stopsFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n [debounce]=\"debounce()\"\n [length]=\"length()\"\n/>\n\n@if (routesFeatureStore().all().length > 0) {\n <igo-directions-buttons\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [contextUri]=\"contextUri()\"\n (zoomOnActiveRoute)=\"zoomOnActiveRoute()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n [stopsStore]=\"stopsStore()\"\n />\n}\n\n<igo-directions-results\n [stepsFeatureStore]=\"stepsFeatureStore()\"\n [routesFeatureStore]=\"routesFeatureStore()\"\n/>\n", styles: [":host{display:block;padding:16px}.directions-options{display:flex;flex-flow:column;align-items:center;row-gap:8px;margin-bottom:16px}.directions-options mat-slide-toggle{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-form-field{width:100%}.directions-options mat-slide-toggle ::ng-deep .mdc-label{margin-left:0;margin-right:auto;width:auto;padding-right:0}.directions-options mat-slide-toggle ::ng-deep .mdc-slide-toggle{margin-left:auto;margin-right:0}\n"] }]
17404
17414
  }], ctorParameters: () => [], propDecorators: { contextUri: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextUri", required: false }] }], stopsStore: [{ type: i0.Input, args: [{ isSignal: true, alias: "stopsStore", required: true }] }], stopsFeatureStore: [{ type: i0.Input, args: [{ isSignal: true, alias: "stopsFeatureStore", required: true }] }], routesFeatureStore: [{ type: i0.Input, args: [{ isSignal: true, alias: "routesFeatureStore", required: true }] }], stepsFeatureStore: [{ type: i0.Input, args: [{ isSignal: true, alias: "stepsFeatureStore", required: true }] }], debounce: [{ type: i0.Input, args: [{ isSignal: true, alias: "debounce", required: false }] }], length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], coordRoundedDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "coordRoundedDecimals", required: false }] }], zoomToActiveRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "zoomToActiveRoute", required: true }] }], authenticated$: [{ type: i0.Input, args: [{ isSignal: true, alias: "authenticated$", required: true }] }] } });
17405
17415
 
17406
17416
  class IgoDirectionsModule {