From 4780f71c915216b96d4d5e6b3e3062a921d3b411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 25 Jan 2018 12:51:56 -0500 Subject: [PATCH 1/4] Fix polygon ((NaN,...)) for html getfeatureinfo --- src/lib/query/shared/query.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/query/shared/query.service.ts b/src/lib/query/shared/query.service.ts index 9853edbbeb..7c1198c044 100644 --- a/src/lib/query/shared/query.service.ts +++ b/src/lib/query/shared/query.service.ts @@ -134,7 +134,10 @@ export class QueryService { y_position = parseInt(searchParams.get('y'), 10); } - const bbox = bbox_raw.split(','); + let bbox = bbox_raw.split(','); + if (bbox.length === 1) { + bbox = bbox_raw.split('%2c'); + } let threshold = (Math.abs(parseFloat(bbox[0])) - Math.abs(parseFloat(bbox[2]))) * (0.1); // for context in degree (EPSG:4326,4269...) From fd526790b46fa2997a306aac443acf1c26a5f765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 25 Jan 2018 13:52:08 -0500 Subject: [PATCH 2/4] Fix url decoding --- src/lib/query/shared/query.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/query/shared/query.service.ts b/src/lib/query/shared/query.service.ts index 7c1198c044..02ae52e8ea 100644 --- a/src/lib/query/shared/query.service.ts +++ b/src/lib/query/shared/query.service.ts @@ -136,7 +136,7 @@ export class QueryService { let bbox = bbox_raw.split(','); if (bbox.length === 1) { - bbox = bbox_raw.split('%2c'); + bbox = decodeURIComponent(bbox_raw).split(','); } let threshold = (Math.abs(parseFloat(bbox[0])) - Math.abs(parseFloat(bbox[2]))) * (0.1); From ddeb090a5308e2c96e31731fd21153a0944ca682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 25 Jan 2018 14:00:33 -0500 Subject: [PATCH 3/4] fix html polygon nan --- src/lib/query/shared/query.service.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/query/shared/query.service.ts b/src/lib/query/shared/query.service.ts index 02ae52e8ea..33e4ccf8e8 100644 --- a/src/lib/query/shared/query.service.ts +++ b/src/lib/query/shared/query.service.ts @@ -134,10 +134,8 @@ export class QueryService { y_position = parseInt(searchParams.get('y'), 10); } - let bbox = bbox_raw.split(','); - if (bbox.length === 1) { - bbox = decodeURIComponent(bbox_raw).split(','); - } + const bbox = decodeURIComponent(bbox_raw).split(','); + let threshold = (Math.abs(parseFloat(bbox[0])) - Math.abs(parseFloat(bbox[2]))) * (0.1); // for context in degree (EPSG:4326,4269...) From e72082be8197549b8f62790fd06abeb0e95519c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-=C3=89tienne=20Lord?= <7397743+pelord@users.noreply.github.com> Date: Thu, 25 Jan 2018 14:01:07 -0500 Subject: [PATCH 4/4] lint --- src/lib/query/shared/query.service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/query/shared/query.service.ts b/src/lib/query/shared/query.service.ts index 33e4ccf8e8..7d8cbdcfcf 100644 --- a/src/lib/query/shared/query.service.ts +++ b/src/lib/query/shared/query.service.ts @@ -135,7 +135,6 @@ export class QueryService { } const bbox = decodeURIComponent(bbox_raw).split(','); - let threshold = (Math.abs(parseFloat(bbox[0])) - Math.abs(parseFloat(bbox[2]))) * (0.1); // for context in degree (EPSG:4326,4269...)