Skip to content

Commit

Permalink
fix(journey-maps): changed POI V3 style default visibility to visible (
Browse files Browse the repository at this point in the history
  • Loading branch information
mstankala authored and github-actions committed Sep 12, 2024
1 parent 7209b80 commit f364d60
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/journey-maps/angular/services/map/map-poi-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ export class SbbMapPoiService {
}

private _handleV3StylePoiLayers(map: MaplibreMap, poiOptions?: SbbPointsOfInterestOptions): void {
const poiPinLayerVisible = !!poiOptions?.categories?.length;
[...poiLayerTypes.PIN.defaultLayer, ...poiLayerTypes.PIN.interactiveLayer].forEach(
(layerId) => {
this._updateCategoryFilter(map, layerId, poiOptions, 'replace');
this._updateLayerVisibility(map, layerId, poiPinLayerVisible);
},
);
poiLayerTypes.SQUARE.defaultLayer.forEach((layerId) => {
Expand All @@ -80,11 +82,6 @@ export class SbbMapPoiService {
poiLayerTypes.SQUARE.interactiveLayer.forEach((layerId) => {
this._updateCategoryFilter(map, layerId, poiOptions, 'replace', true);
});
[...poiLayerTypes.PIN.defaultLayer, ...poiLayerTypes.PIN.interactiveLayer].forEach(
(layerId) => {
this._updateLayerVisibility(map, layerId, !!poiOptions?.categories?.length);
},
);
}

getPoiLayerIds(map: MaplibreMap): string[] {
Expand Down Expand Up @@ -123,7 +120,7 @@ export class SbbMapPoiService {
categories: SbbPointsOfInterestCategoryType[] | undefined,
updateType: 'replace' | 'update',
exclude: boolean | undefined,
): false | any[] {
): boolean | any[] {
const filterByCategoryExpression: boolean | any[] = categories
? this._getCategoryExpressionDef(
[
Expand All @@ -132,7 +129,7 @@ export class SbbMapPoiService {
],
exclude,
)
: false;
: true;

if (updateType === 'replace' || this._invalidFilterDef(currentFilterDef)) {
return filterByCategoryExpression;
Expand Down

0 comments on commit f364d60

Please sign in to comment.