@evergis/react 2.0.46 → 2.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.esm.js CHANGED
@@ -3169,13 +3169,26 @@ function useLayerVisibility(layer, isDisplayed) {
3169
3169
  });
3170
3170
  }
3171
3171
 
3172
+ function useLayerOpacity(layer, opacity) {
3173
+ if (opacity === void 0) {
3174
+ opacity = 1;
3175
+ }
3176
+
3177
+ useUpdate({
3178
+ shouldUpdate: () => layer.opacity !== opacity,
3179
+ onUpdate: () => layer.opacity = opacity,
3180
+ deps: [opacity, layer]
3181
+ });
3182
+ }
3183
+
3172
3184
  function useEvergisDynamicLayer(_ref) {
3173
3185
  let {
3174
3186
  name,
3175
3187
  zIndex,
3176
3188
  style,
3177
3189
  condition,
3178
- isDisplayed
3190
+ isDisplayed,
3191
+ opacity
3179
3192
  } = _ref;
3180
3193
  const api = useEvergisContext();
3181
3194
  const {
@@ -3197,6 +3210,7 @@ function useEvergisDynamicLayer(_ref) {
3197
3210
  }, [name, style, condition]);
3198
3211
  useLayerOrder(layer, zIndex);
3199
3212
  useLayerVisibility(layer, isDisplayed);
3213
+ useLayerOpacity(layer, opacity);
3200
3214
  return layer;
3201
3215
  }
3202
3216