From 5476c93c640d229482fbee78e1e530098ef842ec Mon Sep 17 00:00:00 2001 From: Mohammadreza Ataei <90499633+mohammadrezaataeii@users.noreply.github.com> Date: Tue, 8 Nov 2022 09:24:50 +0330 Subject: [PATCH] Fix Show Layer Styles we don't need to use this.openPopup() && this.closePopUp and we should use layer.setStyle instade of this.setStyle --- src/pages/geoJson-extended-action.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/geoJson-extended-action.js b/src/pages/geoJson-extended-action.js index 7092217..4771e6b 100644 --- a/src/pages/geoJson-extended-action.js +++ b/src/pages/geoJson-extended-action.js @@ -17,10 +17,8 @@ function onEachFeature(feature, layer) { getVoivodeshipName(feature, layer); - this.openPopup(); - // style - this.setStyle({ + layer.setStyle({ fillColor: '#eb4034', weight: 2, color: '#eb4034', @@ -28,9 +26,8 @@ function onEachFeature(feature, layer) { }); }); layer.on('mouseout', function () { - this.closePopup(); // style - this.setStyle({ + layer.setStyle({ fillColor: '#3388ff', weight: 2, color: '#3388ff', @@ -73,4 +70,4 @@ const MapWrapper = () => { ) } -export default MapWrapper; \ No newline at end of file +export default MapWrapper;