mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 20:11:16 +01:00
Save chang event on XYZ editor #85
This commit is contained in:
parent
121a95cee8
commit
a111599850
1 changed files with 10 additions and 0 deletions
|
@ -29,6 +29,15 @@ class TileURLSourceEditor extends React.Component {
|
|||
onChange: React.PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
changeTileUrl(idx, value) {
|
||||
const tiles = this.props.source.tiles.slice(0)
|
||||
tiles[idx] = value
|
||||
this.props.onChange({
|
||||
...this.props.source,
|
||||
tiles: tiles
|
||||
})
|
||||
}
|
||||
|
||||
renderTileUrls() {
|
||||
const prefix = ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th']
|
||||
const tiles = this.props.source.tiles || []
|
||||
|
@ -36,6 +45,7 @@ class TileURLSourceEditor extends React.Component {
|
|||
return <InputBlock key={tileIndex} label={prefix[tileIndex] + " Tile URL"} doc={GlSpec.source_tile.tiles.doc}>
|
||||
<StringInput
|
||||
value={tileUrl}
|
||||
onChange={this.changeTileUrl.bind(this, tileIndex)}
|
||||
/>
|
||||
</InputBlock>
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue