Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions app/component/map/tile-layer/ParkAndRide.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,45 @@ 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) {
this.tile = tile;
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) {
Expand Down
6 changes: 6 additions & 0 deletions app/configurations/config.oulu.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,10 @@ export default configMerger(walttiConfig, {
showTicketPrice: true,
ticketLinkOperatorCode: 50229,
appName: 'oslapp',

parkAndRide: {
showParkAndRide: true,
showParkAndRideForBikes: true,
parkAndRideMinZoom: 14,
},
});
1 change: 1 addition & 0 deletions app/configurations/config.tampere.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ export default configMerger(walttiConfig, {
parkAndRide: {
showParkAndRide: true,
showParkAndRideForBikes: true,
parkAndRideMinZoom: 14,
},

defaultSettings: {
Expand Down
5 changes: 5 additions & 0 deletions app/configurations/config.turku.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ export default configMerger(walttiConfig, {
FUNICULAR: 0.1,
},

parkAndRide: {
showParkAndRide: true,
showParkAndRideForBikes: true,
parkAndRideMinZoom: 14,
},
realTime: undefined,
realTimePatch: undefined,
});