mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 18:41:16 +01:00
Add source component
This commit is contained in:
parent
044cdf5332
commit
6c69a91f2f
1 changed files with 37 additions and 3 deletions
|
@ -3,6 +3,7 @@ import Modal from './Modal'
|
||||||
import Heading from '../Heading'
|
import Heading from '../Heading'
|
||||||
import InputBlock from '../inputs/InputBlock'
|
import InputBlock from '../inputs/InputBlock'
|
||||||
import StringInput from '../inputs/StringInput'
|
import StringInput from '../inputs/StringInput'
|
||||||
|
import SelectInput from '../inputs/SelectInput'
|
||||||
import SourceTypeEditor from '../sources/SourceTypeEditor'
|
import SourceTypeEditor from '../sources/SourceTypeEditor'
|
||||||
|
|
||||||
import publicSources from '../../config/tilesets.json'
|
import publicSources from '../../config/tilesets.json'
|
||||||
|
@ -97,6 +98,40 @@ class SourceEditorLayout extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AddSource extends React.Component {
|
||||||
|
static propTypes = {
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return <div>
|
||||||
|
<InputBlock label={"Source ID"}>
|
||||||
|
<StringInput
|
||||||
|
value={'blubid'}
|
||||||
|
/>
|
||||||
|
</InputBlock>
|
||||||
|
<InputBlock label={"Source Type"}>
|
||||||
|
<SelectInput
|
||||||
|
options={[
|
||||||
|
['geojson', 'GeoJSON'],
|
||||||
|
['tilejson', 'Vector (TileJSON URL)'],
|
||||||
|
['tileurls', 'Vector (Direct URLs)'],
|
||||||
|
]}
|
||||||
|
value={'geojson'}
|
||||||
|
/>
|
||||||
|
</InputBlock>
|
||||||
|
<a style={{
|
||||||
|
fontSize: fontSizes[4],
|
||||||
|
cursor: 'pointer',
|
||||||
|
backgroundColor: colors.midgray,
|
||||||
|
color: colors.lowgray,
|
||||||
|
padding: margins[1],
|
||||||
|
borderRadius: 2,
|
||||||
|
}}>
|
||||||
|
Add Source
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SourcesModal extends React.Component {
|
class SourcesModal extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -130,9 +165,8 @@ class SourcesModal extends React.Component {
|
||||||
{activeSources}
|
{activeSources}
|
||||||
|
|
||||||
<Heading level={4}>Add New Source</Heading>
|
<Heading level={4}>Add New Source</Heading>
|
||||||
<InputBlock label={"TileJSON URL"}>
|
<AddSource />
|
||||||
<StringInput {...inputProps} />
|
|
||||||
</InputBlock>
|
|
||||||
<Heading level={4}>Choose Public Source</Heading>
|
<Heading level={4}>Choose Public Source</Heading>
|
||||||
<p style={{color: colors.lowgray, fontSize: fontSizes[5]}}>Add one of the publicly availble sources to your style.</p>
|
<p style={{color: colors.lowgray, fontSize: fontSizes[5]}}>Add one of the publicly availble sources to your style.</p>
|
||||||
<div style={{maxwidth: 500}}>
|
<div style={{maxwidth: 500}}>
|
||||||
|
|
Loading…
Reference in a new issue