(overlay: E, props: P, prevProps: P)
| 16 | } |
| 17 | |
| 18 | export 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…