From e84be3873a98d42eabcab19c82cb3fa5c2d0b5fe Mon Sep 17 00:00:00 2001 From: Lukas Martinelli Date: Fri, 16 Dec 2016 17:35:09 +0100 Subject: [PATCH] Show basic tilesets modal --- src/modals/tilesets.jsx | 82 +++++++++++++++++++++++++++++++++++++++++ src/tilesets.json | 9 +++++ src/toolbar.jsx | 14 ++++++- 3 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 src/modals/tilesets.jsx create mode 100644 src/tilesets.json diff --git a/src/modals/tilesets.jsx b/src/modals/tilesets.jsx new file mode 100644 index 0000000..13f876a --- /dev/null +++ b/src/modals/tilesets.jsx @@ -0,0 +1,82 @@ +import React from 'react' +import Immutable from 'immutable' + +import Overlay from 'rebass/dist/Overlay' +import Panel from 'rebass/dist/Panel' +import PanelHeader from 'rebass/dist/PanelHeader' +import PanelFooter from 'rebass/dist/PanelFooter' +import Button from 'rebass/dist/Button' +import Text from 'rebass/dist/Text' +import Media from 'rebass/dist/Media' +import Close from 'rebass/dist/Close' +import Space from 'rebass/dist/Space' +import Input from 'rebass/dist/Input' +import Toolbar from 'rebass/dist/Toolbar' +import NavItem from 'rebass/dist/NavItem' + +import publicTilesets from '../tilesets.json' +import theme from '../theme.js' + +class TilesetsModal extends React.Component { + static propTypes = { + mapStyle: React.PropTypes.instanceOf(Immutable.Map).isRequired, + onStyleChanged: React.PropTypes.func.isRequired, + open: React.PropTypes.bool.isRequired, + toggle: React.PropTypes.func.isRequired, + } + + constructor(props) { + super(props); + } + + onChange(property, e) { + const changedStyle = this.props.mapStyle.set(property, e.target.value) + this.props.onStyleChanged(changedStyle) + } + + render() { + const tilesetOptions = publicTilesets.map(tileset => { + return
+ + + #{tileset.id} + + + + {tileset.url} +
+ }) + + return + + + Tilesets + + + +
+ +

Choose Public Tileset

+ {tilesetOptions} + + + +