You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
551 B
14 lines
551 B
2 years ago
|
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);
|
||
|
}
|
||
|
}
|