From 6f37684adc809c82b185556719daac4bace0eea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Wed, 9 Oct 2019 09:24:22 -0400 Subject: [PATCH] fix(wms) Datasource url containing ? crash getlegendgraphic recomposition. (#462) --- .../src/lib/datasource/shared/datasources/wms-datasource.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/geo/src/lib/datasource/shared/datasources/wms-datasource.ts b/packages/geo/src/lib/datasource/shared/datasources/wms-datasource.ts index 11769ccd32..5fe2986d59 100644 --- a/packages/geo/src/lib/datasource/shared/datasources/wms-datasource.ts +++ b/packages/geo/src/lib/datasource/shared/datasources/wms-datasource.ts @@ -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 };