From e7dbf41fd63addf13d74a00cd3f76a5153e4af57 Mon Sep 17 00:00:00 2001 From: Antoine Abt Date: Wed, 4 Nov 2020 15:34:06 +0100 Subject: [PATCH] fix: avoid errors due to ngeo update --- .../static-ngeo/js/measure/MeasureController.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/geoportal/geoportailv3_geoportal/static-ngeo/js/measure/MeasureController.js b/geoportal/geoportailv3_geoportal/static-ngeo/js/measure/MeasureController.js index 67fd4c7a7..33426e9ca 100644 --- a/geoportal/geoportailv3_geoportal/static-ngeo/js/measure/MeasureController.js +++ b/geoportal/geoportailv3_geoportal/static-ngeo/js/measure/MeasureController.js @@ -153,11 +153,16 @@ const exports = function($scope, $q, $http, $compile, gettext, return style } - let text = (this[ - geomType === 'LineString' ? 'measureLength' : - geomType === 'Polygon' ? 'measureArea' : - geomType === 'GeometryCollection' ? 'measureAzimut' : '' - ].getTooltipElement() || this['measureProfile'].getTooltipElement()).innerHTML + let text + try { + text = (this[ + geomType === 'LineString' ? 'measureLength' : + geomType === 'Polygon' ? 'measureArea' : + geomType === 'GeometryCollection' ? 'measureAzimut' : '' + ].getTooltipElement() || this['measureProfile'].getTooltipElement()).innerHTML + } catch { + text = '' + } style.getText().setText(clearText(text)) if (geomType === 'GeometryCollection') {