Skip to content

Commit

Permalink
Merge pull request #2548 from HSLdevcom/citybike-maplayers-default
Browse files Browse the repository at this point in the history
Citybike map visibility defaults to transportmode availabilility
  • Loading branch information
optionsome authored Oct 31, 2018
2 parents da7017a + 97c7413 commit c2763c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/store/MapLayerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { setMapLayerSettings, getMapLayerSettings } from './localStorage';

class MapLayerStore extends Store {
static defaultLayers = {
citybike: false, // TODO: set back to true when stations open again
parkAndRide: true,
stop: {
bus: true,
Expand Down Expand Up @@ -35,6 +34,12 @@ class MapLayerStore extends Store {

constructor(dispatcher) {
super(dispatcher);

const { config } = dispatcher.getContext();
this.mapLayers.citybike =
config.transportModes.citybike &&
config.transportModes.citybike.availableForSelection;

const storedMapLayers = getMapLayerSettings();
if (Object.keys(storedMapLayers).length > 0) {
this.mapLayers = { ...storedMapLayers };
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"engineStrict": true,
"engines": {
"node": ">=8.0",
"node": ">=8.11.2",
"npm": ">=3.0"
},
"browserslist": [
Expand Down

0 comments on commit c2763c2

Please sign in to comment.