mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-15 09:01:20 +01:00
Add raster XYZ and TileJSON options #57
This commit is contained in:
parent
7b24cbf39b
commit
7c3906fa40
2 changed files with 20 additions and 6 deletions
|
@ -130,16 +130,26 @@ class AddSource extends React.Component {
|
||||||
type: 'geojson',
|
type: 'geojson',
|
||||||
data: source.data || 'http://localhost:3000/geojson.json'
|
data: source.data || 'http://localhost:3000/geojson.json'
|
||||||
}
|
}
|
||||||
case 'tilejson': return {
|
case 'tilejson_vector': return {
|
||||||
type: 'vector',
|
type: 'vector',
|
||||||
url: source.url || 'http://localhost:3000/tilejson.json'
|
url: source.url || 'http://localhost:3000/tilejson.json'
|
||||||
}
|
}
|
||||||
case 'tilexyz': return {
|
case 'tilexyz_vector': return {
|
||||||
type: 'vector',
|
type: 'vector',
|
||||||
tiles: source.tiles || ['http://localhost:3000/{x}/{y}/{z}.pbf'],
|
tiles: source.tiles || ['http://localhost:3000/{x}/{y}/{z}.pbf'],
|
||||||
minZoom: source.minZoom || 0,
|
minZoom: source.minZoom || 0,
|
||||||
maxZoom: source.maxZoom || 14
|
maxZoom: source.maxZoom || 14
|
||||||
}
|
}
|
||||||
|
case 'tilejson_raster': return {
|
||||||
|
type: 'raster',
|
||||||
|
url: source.url || 'http://localhost:3000/tilejson.json'
|
||||||
|
}
|
||||||
|
case 'tilexyz_raster': return {
|
||||||
|
type: 'raster',
|
||||||
|
tiles: source.tiles || ['http://localhost:3000/{x}/{y}/{z}.pbf'],
|
||||||
|
minZoom: source.minZoom || 0,
|
||||||
|
maxZoom: source.maxZoom || 14
|
||||||
|
}
|
||||||
default: return {}
|
default: return {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,8 +172,10 @@ class AddSource extends React.Component {
|
||||||
<SelectInput
|
<SelectInput
|
||||||
options={[
|
options={[
|
||||||
['geojson', 'GeoJSON'],
|
['geojson', 'GeoJSON'],
|
||||||
['tilejson', 'Vector (TileJSON URL)'],
|
['tilejson_vector', 'Vector (TileJSON URL)'],
|
||||||
['tilexyz', 'Vector (XYZ URLs)'],
|
['tilexyz_vector', 'Vector (XYZ URLs)'],
|
||||||
|
['tilejson_raster', 'Raster (TileJSON URL)'],
|
||||||
|
['tilexyz_raster', 'Raster (XYZ URL)'],
|
||||||
]}
|
]}
|
||||||
onChange={mode => this.setState({mode: mode, source: this.defaultSource(mode)})}
|
onChange={mode => this.setState({mode: mode, source: this.defaultSource(mode)})}
|
||||||
value={this.state.mode}
|
value={this.state.mode}
|
||||||
|
|
|
@ -99,8 +99,10 @@ class SourceTypeEditor extends React.Component {
|
||||||
}
|
}
|
||||||
switch(this.props.mode) {
|
switch(this.props.mode) {
|
||||||
case 'geojson': return <GeoJSONSourceEditor {...commonProps} />
|
case 'geojson': return <GeoJSONSourceEditor {...commonProps} />
|
||||||
case 'tilejson': return <TileJSONSourceEditor {...commonProps} />
|
case 'tilejson_vector': return <TileJSONSourceEditor {...commonProps} />
|
||||||
case 'tilexyz': return <TileURLSourceEditor {...commonProps} />
|
case 'tilexyz_vector': return <TileURLSourceEditor {...commonProps} />
|
||||||
|
case 'tilejson_raster': return <TileJSONSourceEditor {...commonProps} />
|
||||||
|
case 'tilexyz_raster': return <TileURLSourceEditor {...commonProps} />
|
||||||
default: return null
|
default: return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue