diff --git a/app/component/map/tile-layer/ParkAndRide.js b/app/component/map/tile-layer/ParkAndRide.js index 3c04a60bef..b88c9d1ea9 100644 --- a/app/component/map/tile-layer/ParkAndRide.js +++ b/app/component/map/tile-layer/ParkAndRide.js @@ -7,7 +7,33 @@ import { fetchWithLanguageAndSubscription } from '../../../util/fetchUtils'; import { ParkTypes } from '../../../constants'; import { getLayerBaseUrl } from '../../../util/mapLayerUtils'; -const showParking = 17; +const showParking = 15; +const iconSizeMap = { + 12: { + width: 12, + height: 12, + }, + 13: { + width: 12, + height: 12, + }, + 14: { + width: 18, + height: 18, + }, + 15: { + width: 24, + height: 24, + }, + 16: { + width: 28, + height: 28, + }, + 17: { + width: 30, + height: 30, + }, +}; export default class ParkAndRide { constructor(tile, config, relayEnvironment) { @@ -15,8 +41,11 @@ export default class ParkAndRide { this.config = config; this.relayEnvironment = relayEnvironment; const scaleratio = window.devicePixelRatio || 1; - this.width = 24 * scaleratio; - this.height = 24 * scaleratio; + const zoom = tile.coords.z; + // limit index between min and max values of lookup map + const zoomIndex = Math.min(Math.max(zoom, 12), 17); + this.width = iconSizeMap[zoomIndex].width * scaleratio; + this.height = iconSizeMap[zoomIndex].height * scaleratio; } fetchAndDrawParks(parkType, lang) { diff --git a/app/configurations/config.oulu.js b/app/configurations/config.oulu.js index 7099f7d0dc..b29dc8c4f7 100644 --- a/app/configurations/config.oulu.js +++ b/app/configurations/config.oulu.js @@ -189,4 +189,10 @@ export default configMerger(walttiConfig, { showTicketPrice: true, ticketLinkOperatorCode: 50229, appName: 'oslapp', + + parkAndRide: { + showParkAndRide: true, + showParkAndRideForBikes: true, + parkAndRideMinZoom: 14, + }, }); diff --git a/app/configurations/config.tampere.js b/app/configurations/config.tampere.js index 9bc359c033..f2a3c6fb80 100644 --- a/app/configurations/config.tampere.js +++ b/app/configurations/config.tampere.js @@ -378,6 +378,7 @@ export default configMerger(walttiConfig, { parkAndRide: { showParkAndRide: true, showParkAndRideForBikes: true, + parkAndRideMinZoom: 14, }, defaultSettings: { diff --git a/app/configurations/config.turku.js b/app/configurations/config.turku.js index 65d5d789ba..4e38657ac2 100644 --- a/app/configurations/config.turku.js +++ b/app/configurations/config.turku.js @@ -284,6 +284,11 @@ export default configMerger(walttiConfig, { FUNICULAR: 0.1, }, + parkAndRide: { + showParkAndRide: true, + showParkAndRideForBikes: true, + parkAndRideMinZoom: 14, + }, realTime: undefined, realTimePatch: undefined, });