diff --git a/src/components/App.jsx b/src/components/App.jsx
index eda2f05..d070dfa 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'
@@ -153,6 +154,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: [],
@@ -168,7 +171,8 @@ export default class App extends React.Component {
open: false,
shortcuts: false,
export: false,
- }
+ },
+ mapFilter: queryObj["color-blindness-emulation"],
}
this.layerWatcher = new LayerWatcher({
@@ -407,15 +411,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 4e83d66..2f7002d 100644
--- a/src/components/Toolbar.jsx
+++ b/src/components/Toolbar.jsx
@@ -99,9 +99,13 @@ export default class Toolbar extends React.Component {
return
+
+ Skip navigation
+
Maputnik
v{pkgJson.version}
diff --git a/src/components/layers/LayerEditor.jsx b/src/components/layers/LayerEditor.jsx
index 6f6f44c..7d7291d 100644
--- a/src/components/layers/LayerEditor.jsx
+++ b/src/components/layers/LayerEditor.jsx
@@ -48,6 +48,13 @@ export default class LayerEditor extends React.Component {
spec: PropTypes.object.isRequired,
onLayerChanged: PropTypes.func,
onLayerIdChange: PropTypes.func,
+ onMoveLayer: PropTypes.func,
+ onLayerDestroy: PropTypes.func,
+ onLayerCopy: PropTypes.func,
+ onLayerVisibilityToggle: PropTypes.func,
+ isFirstLayer: PropTypes.bool,
+ isLastLayer: PropTypes.bool,
+ layerIndex: PropTypes.number,
}
static defaultProps = {
@@ -202,6 +209,7 @@ export default class LayerEditor extends React.Component {
})
+ const layout = this.props.layer.layout || {}
const items = {
delete: {
@@ -213,7 +221,7 @@ export default class LayerEditor extends React.Component {
handler: () => this.props.onLayerCopy(this.props.layer.id)
},
hide: {
- text: "Hide",
+ text: (layout.visibility === "none") ? "Show" : "Hide",
handler: () => this.props.onLayerVisibilityToggle(this.props.layer.id)
},
moveLayerUp: {
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 {