MCPcopy
hub / github.com/PaulLeCam/react-leaflet / updateGridLayer

Function updateGridLayer

packages/core/src/grid-layer.ts:3–14  ·  view source on GitHub ↗
(layer: E, props: P, prevProps: P)

Source from the content-addressed store, hash-verified

1import type { GridLayer, GridLayerOptions } from 'leaflet'
2
3export function updateGridLayer<
4 E extends GridLayer,
5 P extends GridLayerOptions,
6>(layer: E, props: P, prevProps: P) {
7 const { opacity, zIndex } = props
8 if (opacity != null && opacity !== prevProps.opacity) {
9 layer.setOpacity(opacity)
10 }
11 if (zIndex != null && zIndex !== prevProps.zIndex) {
12 layer.setZIndex(zIndex)
13 }
14}

Callers 3

grid-layer.tsFile · 0.90
TileLayer.tsxFile · 0.90
WMSTileLayer.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…