Skip to content

Commit

Permalink
fix(wms) Datasource url containing ? crash getlegendgraphic recomposi…
Browse files Browse the repository at this point in the history
…tion. (#462)
  • Loading branch information
pelord authored and mbarbeau committed Oct 9, 2019
1 parent f3b6235 commit 6f37684
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ export class WMSDataSource extends DataSource {
}

legend = layers.map((layer: string) => {
const separator = baseUrl.match( /\?/m) ? '&' : '?'
return {
url: `${baseUrl}?${params.join('&')}&LAYER=${layer}`,
url: `${baseUrl}${separator}${params.join('&')}&LAYER=${layer}`,
title: layers.length > 1 ? layer : undefined,
currentStyle: !style ? undefined : style as string
};
Expand Down

0 comments on commit 6f37684

Please sign in to comment.