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

Function updateMediaOverlay

packages/core/src/media-overlay.ts:18–35  ·  view source on GitHub ↗
(overlay: E, props: P, prevProps: P)

Source from the content-addressed store, hash-verified

16}
17
18export function updateMediaOverlay<
19 E extends LeafletImageOverlay | LeafletSVGOverlay | LeafletVideoOverlay,
20 P extends MediaOverlayProps,
21>(overlay: E, props: P, prevProps: P) {
22 if (
23 props.bounds instanceof LatLngBounds &&
24 props.bounds !== prevProps.bounds
25 ) {
26 overlay.setBounds(props.bounds)
27 }
28 if (props.opacity != null && props.opacity !== prevProps.opacity) {
29 overlay.setOpacity(props.opacity)
30 }
31 if (props.zIndex != null && props.zIndex !== prevProps.zIndex) {
32 // @ts-ignore missing in definition but inherited from ImageOverlay
33 overlay.setZIndex(props.zIndex)
34 }
35}

Callers 3

media-overlay.tsFile · 0.90
ImageOverlay.tsxFile · 0.90
VideoOverlay.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…