Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode boolean values as uppercase string in WMS request. #1132

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibrierley @stou Ah yes, I see now :)


/// 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