Skip to content

Commit

Permalink
Encode boolean values as uppercase string in WMS request. (#1132)
Browse files Browse the repository at this point in the history
Handle WMS server that only accepts boolean values as uppercase strings.

Co-authored-by: Rasmus Stougaard <[email protected]>
  • Loading branch information
stou and Rasmus Stougaard committed Feb 3, 2022
1 parent 52dc38e commit 85d979a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/layer/tile_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ class WMSTileLayerOptions {
/// tile transparency flag
final bool transparent;

/// Encode boolean values as uppercase in request
final bool uppercaseBoolValue;

// TODO find a way to implicit pass of current map [Crs]
final Crs crs;

Expand All @@ -366,6 +369,7 @@ class WMSTileLayerOptions {
this.format = 'image/png',
this.version = '1.1.1',
this.transparent = true,
this.uppercaseBoolValue = false,
this.crs = const Epsg3857(),
this.otherParameters = const {},
}) {
Expand All @@ -383,7 +387,8 @@ class WMSTileLayerOptions {
..write('&format=${Uri.encodeComponent(format)}')
..write('&$projectionKey=${Uri.encodeComponent(crs.code)}')
..write('&version=${Uri.encodeComponent(version)}')
..write('&transparent=$transparent');
..write(
'&transparent=${uppercaseBoolValue ? transparent.toString().toUpperCase() : transparent}');
otherParameters
.forEach((k, v) => buffer.write('&$k=${Uri.encodeComponent(v)}'));
return buffer.toString();
Expand Down

0 comments on commit 85d979a

Please sign in to comment.