From 26dc388596335b7cf6d91918147b4d38a2bae2b3 Mon Sep 17 00:00:00 2001 From: Pablo Lopez Date: Mon, 12 May 2025 11:06:20 -0300 Subject: [PATCH] fix duplicated attribution as well as disabled setAttributionFromService --- src/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index b8b787e..35a6c92 100644 --- a/src/main.js +++ b/src/main.js @@ -437,11 +437,11 @@ export default class FeatureService { const attributionController = this._map._controls.find(c => '_attribHTML' in c) - if (!attributionController) return + if (!attributionController || !this._esriServiceOptions.setAttributionFromService) return const customAttribution = attributionController.options.customAttribution - - if (typeof customAttribution === 'string') { + + if (typeof customAttribution === 'string' && !customAttribution.includes(POWERED_BY_ESRI_ATTRIBUTION_STRING)) { attributionController.options.customAttribution = `${customAttribution} | ${POWERED_BY_ESRI_ATTRIBUTION_STRING}` } else if (customAttribution === undefined) { attributionController.options.customAttribution = POWERED_BY_ESRI_ATTRIBUTION_STRING