import React from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' import {detect} from 'detect-browser'; import {MdFileDownload, MdOpenInBrowser, MdSettings, MdLayers, MdHelpOutline, MdFindInPage, MdAssignmentTurnedIn} from 'react-icons/md' import logoImage from 'maputnik-design/logos/logo-color.svg' import pkgJson from '../../package.json' // This is required because of , there isn't another way to detect support that I'm aware of. const browser = detect(); const colorAccessibilityFiltersEnabled = ['chrome', 'firefox'].indexOf(browser.name) > -1; class IconText extends React.Component { static propTypes = { children: PropTypes.node, } render() { return {this.props.children} } } class ToolbarLink extends React.Component { static propTypes = { className: PropTypes.string, children: PropTypes.node, href: PropTypes.string, onToggleModal: PropTypes.func, } render() { return {this.props.children} } } class ToolbarLinkHighlighted extends React.Component { static propTypes = { className: PropTypes.string, children: PropTypes.node, href: PropTypes.string, onToggleModal: PropTypes.func } render() { return {this.props.children} } } class ToolbarSelect extends React.Component { static propTypes = { children: PropTypes.node, wdKey: PropTypes.string } render() { return
{this.props.children}
} } class ToolbarAction extends React.Component { static propTypes = { children: PropTypes.node, onClick: PropTypes.func, wdKey: PropTypes.string } render() { return } } export default class Toolbar extends React.Component { static propTypes = { mapStyle: PropTypes.object.isRequired, inspectModeEnabled: PropTypes.bool.isRequired, onStyleChanged: PropTypes.func.isRequired, // A new style has been uploaded onStyleOpen: PropTypes.func.isRequired, // A dict of source id's and the available source layers sources: PropTypes.object.isRequired, children: PropTypes.node, onToggleModal: PropTypes.func, onSetMapState: PropTypes.func, mapState: PropTypes.string, renderer: PropTypes.string, } state = { isOpen: { settings: false, sources: false, open: false, add: false, export: false, } } handleSelection(val) { this.props.onSetMapState(val); } render() { const views = [ { id: "map", title: "Map", }, { id: "inspect", title: "Inspect", disabled: this.props.renderer !== 'mbgljs', }, { id: "filter-deuteranopia", title: "Map (deuteranopia)", disabled: !colorAccessibilityFiltersEnabled, }, { id: "filter-protanopia", title: "Map (protanopia)", disabled: !colorAccessibilityFiltersEnabled, }, { id: "filter-tritanopia", title: "Map (tritanopia)", disabled: !colorAccessibilityFiltersEnabled, }, { id: "filter-achromatopsia", title: "Map (achromatopsia)", disabled: !colorAccessibilityFiltersEnabled, }, ]; const currentView = views.find((view) => { return view.id === this.props.mapState; }); return
Skip navigation Maputnik

{pkgJson.name} v{pkgJson.version}

Open Export Data Sources Style Settings View Help Take the Maputnik Survey
} }