diff --git a/src/components/App.jsx b/src/components/App.jsx index 7817503..5e2ee06 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -3,6 +3,7 @@ import Mousetrap from 'mousetrap' import cloneDeep from 'lodash.clonedeep' import clamp from 'lodash.clamp' import {arrayMove} from 'react-sortable-hoc'; +import url from 'url' import MapboxGlMap from './map/MapboxGlMap' import OpenLayers3Map from './map/OpenLayers3Map' @@ -74,6 +75,8 @@ export default class App extends React.Component { Debug.set("maputnik", "styleStore", this.styleStore); } + const queryObj = url.parse(window.location.href, true).query; + this.state = { errors: [], infos: [], @@ -83,6 +86,7 @@ export default class App extends React.Component { vectorLayers: {}, inspectModeEnabled: false, spec: styleSpec.latest, + mapFilter: queryObj["color-blindness-emulation"], } this.layerWatcher = new LayerWatcher({ @@ -321,15 +325,25 @@ export default class App extends React.Component { const metadata = this.state.mapStyle.metadata || {} const renderer = metadata['maputnik:renderer'] || 'mbgljs' + let mapElement; + // Check if OL3 code has been loaded? if(renderer === 'ol3') { - return + mapElement = } else { - return } + + const elementStyle = { + "filter": `url('#${this.state.mapFilter}')` + }; + + return
+ {mapElement} +
} onLayerSelect(layerId) { diff --git a/src/components/Toolbar.jsx b/src/components/Toolbar.jsx index caa1c5e..f53996a 100644 --- a/src/components/Toolbar.jsx +++ b/src/components/Toolbar.jsx @@ -135,9 +135,13 @@ export default class Toolbar extends React.Component { />
+ + Skip navigation + Maputnik

Maputnik v{pkgJson.version} diff --git a/src/components/layers/LayerList.jsx b/src/components/layers/LayerList.jsx index 1b50b89..83ebe33 100644 --- a/src/components/layers/LayerList.jsx +++ b/src/components/layers/LayerList.jsx @@ -178,6 +178,7 @@ class LayerListContainer extends React.Component {