From fc311a09d4bfbb2df65f6b66cc852f2f05f3ad92 Mon Sep 17 00:00:00 2001 From: 100pah Date: Thu, 1 Apr 2021 12:58:55 +0800 Subject: [PATCH] fix: geoJSON focus-blur --- src/component/helper/MapDraw.ts | 12 ++++- test/geo-svg.html | 85 ++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 3 deletions(-) diff --git a/src/component/helper/MapDraw.ts b/src/component/helper/MapDraw.ts index 22caaebdd..22d2caaf7 100644 --- a/src/component/helper/MapDraw.ts +++ b/src/component/helper/MapDraw.ts @@ -399,6 +399,13 @@ class MapDraw { }, this); + this._enableBlurEntireSVG(focusSelf, viewBuildCtx); + } + + private _enableBlurEntireSVG( + focusSelf: boolean, + viewBuildCtx: ViewBuildContext + ): void { // It's a little complicated to support blurring the entire geoSVG in series-map. // So do not suport it until some requirements come. // At present, in series-map, only regions can be blurred. @@ -417,8 +424,7 @@ class MapDraw { if (style.opacity == null && opacity != null) { style.opacity = opacity; } - // If opacity not set, but `ensureState('blur').style` set, there will - // be default opacity. + // If `ensureState('blur').style = {}`, there will be default opacity. // Enable `stateTransition` (animation). (el as Displayable).ensureState('emphasis'); @@ -638,6 +644,8 @@ function applyOptionStyleForRegion( el.ensureState('emphasis').style = emphasisStyle; el.ensureState('select').style = selectStyle; el.ensureState('blur').style = blurStyle; + // Enable blur + setDefaultStateProxy(el); } function resetLabelForRegion( diff --git a/test/geo-svg.html b/test/geo-svg.html index 45ec6e426..38a625109 100644 --- a/test/geo-svg.html +++ b/test/geo-svg.html @@ -39,6 +39,7 @@ under the License.
+
@@ -199,6 +200,86 @@ under the License. + + + + + + + + + +