Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
height: this.mapContainer.current.offsetHeight,
...currentViewport
};
const { longitude, latitude, zoom } = new WebMercatorViewport(viewport).fitBounds(
[[bbox[0], bbox[1]], [bbox[2], bbox[3]]],
options
);
const newViewport = {
...currentViewport,
longitude,
latitude,
zoom,
...fitBoundsOptions,
transitionInterruption: TRANSITION_EVENTS.UPDATE
};
this.setState({
flying: true,
viewport: newViewport
});
onViewportChange(newViewport);
setTimeout(() => {
this.setState({ flying: false });
}, 1500);
};
};
const { longitude, latitude, zoom } = new WebMercatorViewport(v).fitBounds(
[[bbox[0], bbox[1]], [bbox[2], bbox[3]]],
{ padding: this.props.padding }
);
if (this.mounted) {
this.setState({
viewport: {
...this.state.viewport,
longitude,
latitude,
zoom,
transitionDuration: 0,
transitionInterruption: TRANSITION_EVENTS.UPDATE
}
});
}
};