@@ -42,15 +42,15 @@ class PublicSource extends React.Component<PublicSourceProps> {
42
42
43
43
function editorMode ( source : SourceSpecification ) {
44
44
if ( source . type === 'raster' ) {
45
- if ( source . tiles ) return 'tilexyz_raster '
45
+ if ( source . tiles ) return 'tile_raster '
46
46
return 'tilejson_raster'
47
47
}
48
48
if ( source . type === 'raster-dem' ) {
49
49
if ( source . tiles ) return 'tilexyz_raster-dem'
50
50
return 'tilejson_raster-dem'
51
51
}
52
52
if ( source . type === 'vector' ) {
53
- if ( source . tiles ) return 'tilexyz_vector '
53
+ if ( source . tiles ) return 'tile_vector '
54
54
return 'tilejson_vector'
55
55
}
56
56
if ( source . type === 'geojson' ) {
@@ -142,21 +142,23 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
142
142
type : 'vector' ,
143
143
url : ( source as VectorSourceSpecification ) . url || `${ protocol } //localhost:3000/tilejson.json`
144
144
}
145
- case 'tilexyz_vector ' : return {
145
+ case 'tile_vector ' : return {
146
146
type : 'vector' ,
147
147
tiles : ( source as VectorSourceSpecification ) . tiles || [ `${ protocol } //localhost:3000/{x}/{y}/{z}.pbf` ] ,
148
148
minzoom : ( source as VectorSourceSpecification ) . minzoom || 0 ,
149
- maxzoom : ( source as VectorSourceSpecification ) . maxzoom || 14
149
+ maxzoom : ( source as VectorSourceSpecification ) . maxzoom || 14 ,
150
+ scheme : ( source as VectorSourceSpecification ) . scheme || 'xyz'
150
151
}
151
152
case 'tilejson_raster' : return {
152
153
type : 'raster' ,
153
154
url : ( source as RasterSourceSpecification ) . url || `${ protocol } //localhost:3000/tilejson.json`
154
155
}
155
- case 'tilexyz_raster ' : return {
156
+ case 'tile_raster ' : return {
156
157
type : 'raster' ,
157
158
tiles : ( source as RasterSourceSpecification ) . tiles || [ `${ protocol } //localhost:3000/{x}/{y}/{z}.pbf` ] ,
158
159
minzoom : ( source as RasterSourceSpecification ) . minzoom || 0 ,
159
- maxzoom : ( source as RasterSourceSpecification ) . maxzoom || 14
160
+ maxzoom : ( source as RasterSourceSpecification ) . maxzoom || 14 ,
161
+ scheme : ( source as RasterSourceSpecification ) . scheme || 'xyz'
160
162
}
161
163
case 'tilejson_raster-dem' : return {
162
164
type : 'raster-dem' ,
@@ -222,6 +224,7 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
222
224
fieldSpec = { { doc : t ( "Unique ID that identifies the source and is used in the layer to reference the source." ) } }
223
225
value = { this . state . sourceId }
224
226
onChange = { ( v : string ) => this . setState ( { sourceId : v } ) }
227
+ data-wd-key = "modal:sources.add.source_id"
225
228
/>
226
229
< FieldSelect
227
230
label = { t ( "Source Type" ) }
@@ -230,16 +233,17 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
230
233
[ 'geojson_json' , t ( 'GeoJSON (JSON)' ) ] ,
231
234
[ 'geojson_url' , t ( 'GeoJSON (URL)' ) ] ,
232
235
[ 'tilejson_vector' , t ( 'Vector (TileJSON URL)' ) ] ,
233
- [ 'tilexyz_vector ' , t ( 'Vector (XYZ URLs)' ) ] ,
236
+ [ 'tile_vector ' , t ( 'Vector (Tile URLs)' ) ] ,
234
237
[ 'tilejson_raster' , t ( 'Raster (TileJSON URL)' ) ] ,
235
- [ 'tilexyz_raster ' , t ( 'Raster (XYZ URL )' ) ] ,
238
+ [ 'tile_raster ' , t ( 'Raster (Tile URLs )' ) ] ,
236
239
[ 'tilejson_raster-dem' , t ( 'Raster DEM (TileJSON URL)' ) ] ,
237
240
[ 'tilexyz_raster-dem' , t ( 'Raster DEM (XYZ URLs)' ) ] ,
238
241
[ 'image' , t ( 'Image' ) ] ,
239
242
[ 'video' , t ( 'Video' ) ] ,
240
243
] }
241
244
onChange = { mode => this . setState ( { mode : mode as EditorMode , source : this . defaultSource ( mode as EditorMode ) } ) }
242
245
value = { this . state . mode as string }
246
+ data-wd-key = "modal:sources.add.source_type"
243
247
/>
244
248
< ModalSourcesTypeEditor
245
249
onChange = { this . onChangeSource }
@@ -249,6 +253,7 @@ class AddSource extends React.Component<AddSourceProps, AddSourceState> {
249
253
< InputButton
250
254
className = "maputnik-add-source-button"
251
255
onClick = { this . onAdd }
256
+ data-wd-key = "modal:sources.add.add_source"
252
257
>
253
258
{ t ( "Add Source" ) }
254
259
</ InputButton >
0 commit comments