componentDidMount() { super.componentDidMount() if (this.props.play === true) { this.leafletElement.getElement().play() } }
updateLeafletElement(fromProps: Props, toProps: Props) { if (toProps.url !== fromProps.url) { this.leafletElement.setUrl(toProps.url) } if (toProps.bounds !== fromProps.bounds) { this.leafletElement.setBounds(latLngBounds(toProps.bounds)) } if (toProps.opacity !== fromProps.opacity) { this.leafletElement.setOpacity(toProps.opacity) } if (toProps.zIndex !== fromProps.zIndex) { this.leafletElement.setZIndex(toProps.zIndex) } // flowlint-next-line sketchy-null-bool:off if (toProps.play === true && !fromProps.play) { this.leafletElement.getElement().play() // flowlint-next-line sketchy-null-bool:off } else if (!toProps.play && fromProps.play === true) { this.leafletElement.getElement().pause() } }