Skip to content

Commit 85d979a

Browse files
stouRasmus Stougaard
andauthored
Encode boolean values as uppercase string in WMS request. (#1132)
Handle WMS server that only accepts boolean values as uppercase strings. Co-authored-by: Rasmus Stougaard <rst@eucnordvest.dk>
1 parent 52dc38e commit 85d979a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/layer/tile_layer.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,9 @@ class WMSTileLayerOptions {
349349
/// tile transparency flag
350350
final bool transparent;
351351

352+
/// Encode boolean values as uppercase in request
353+
final bool uppercaseBoolValue;
354+
352355
// TODO find a way to implicit pass of current map [Crs]
353356
final Crs crs;
354357

@@ -366,6 +369,7 @@ class WMSTileLayerOptions {
366369
this.format = 'image/png',
367370
this.version = '1.1.1',
368371
this.transparent = true,
372+
this.uppercaseBoolValue = false,
369373
this.crs = const Epsg3857(),
370374
this.otherParameters = const {},
371375
}) {
@@ -383,7 +387,8 @@ class WMSTileLayerOptions {
383387
..write('&format=${Uri.encodeComponent(format)}')
384388
..write('&$projectionKey=${Uri.encodeComponent(crs.code)}')
385389
..write('&version=${Uri.encodeComponent(version)}')
386-
..write('&transparent=$transparent');
390+
..write(
391+
'&transparent=${uppercaseBoolValue ? transparent.toString().toUpperCase() : transparent}');
387392
otherParameters
388393
.forEach((k, v) => buffer.write('&$k=${Uri.encodeComponent(v)}'));
389394
return buffer.toString();

0 commit comments

Comments
 (0)