File size: 551 Bytes
391a73c
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { LatLngBounds } from 'leaflet';
export function updateMediaOverlay(overlay, props, prevProps) {
    if (props.bounds instanceof LatLngBounds && props.bounds !== prevProps.bounds) {
        overlay.setBounds(props.bounds);
    }
    if (props.opacity != null && props.opacity !== prevProps.opacity) {
        overlay.setOpacity(props.opacity);
    }
    if (props.zIndex != null && props.zIndex !== prevProps.zIndex) {
        // @ts-ignore missing in definition but inherited from ImageOverlay
        overlay.setZIndex(props.zIndex);
    }
}