import React from 'react' import PropTypes from 'prop-types' import {latest} from '@mapbox/mapbox-gl-style-spec' import InputBlock from '../inputs/InputBlock' import ArrayInput from '../inputs/ArrayInput' import NumberInput from '../inputs/NumberInput' import StringInput from '../inputs/StringInput' import UrlInput from '../inputs/UrlInput' import SelectInput from '../inputs/SelectInput' import EnumInput from '../inputs/EnumInput' import ColorField from '../fields/ColorField' import Modal from './Modal' import fieldSpecAdditional from '../../libs/field-spec-additional' class SettingsModal extends React.Component { static propTypes = { mapStyle: PropTypes.object.isRequired, onStyleChanged: PropTypes.func.isRequired, onChangeMetadataProperty: PropTypes.func.isRequired, isOpen: PropTypes.bool.isRequired, onOpenToggle: PropTypes.func.isRequired, } changeTransitionProperty(property, value) { const transition = { ...this.props.mapStyle.transition, } if (value === undefined) { delete transition[property]; } else { transition[property] = value; } this.props.onStyleChanged({ ...this.props.mapStyle, transition, }); } changeLightProperty(property, value) { const light = { ...this.props.mapStyle.light, } if (value === undefined) { delete light[property]; } else { light[property] = value; } this.props.onStyleChanged({ ...this.props.mapStyle, light, }); } changeStyleProperty(property, value) { const changedStyle = { ...this.props.mapStyle, }; if (value === undefined) { delete changedStyle[property]; } else { changedStyle[property] = value; } this.props.onStyleChanged(changedStyle); } render() { const metadata = this.props.mapStyle.metadata || {} const {onChangeMetadataProperty, mapStyle} = this.props; const inputProps = { } const light = this.props.mapStyle.light || {}; const transition = this.props.mapStyle.transition || {}; return
} } export default SettingsModal