Skip to content

Commit

Permalink
🐛 wo #43: fixed a problem with a double drawing of the animation (cur…
Browse files Browse the repository at this point in the history
…rentZoom !== mapRef.getZoom()
  • Loading branch information
helllth committed Jul 6, 2020
1 parent ea309f0 commit 25cf199
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/containers/Starkregen.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ export class Starkregen_ extends React.Component {
return undefined;
}
render() {
console.log('bughunt: this.props.match.params.mode', this.props.match.params.mode);
console.log(
'bughunt: this.props.starkregen.displayMode',
this.props.starkregen.displayMode
);

let currentZoom = new URLSearchParams(this.props.routing.location.search).get('zoom') || 8;
let titleContent;
if (this.props.starkregen.displayMode === starkregenConstants.SHOW_HEIGHTS) {
Expand Down Expand Up @@ -296,6 +290,9 @@ export class Starkregen_ extends React.Component {
if (mapRef !== undefined) {
const bounds = mapRef.getBounds();

console.log('bughunt: currentZoom', currentZoom);
console.log('bughunt: mapref.getZoom()', mapRef.getZoom());

if (currentZoom >= MIN_ANIMATION_ZOOM) {
currentBBox = [
bounds._southWest.lng,
Expand Down Expand Up @@ -546,6 +543,7 @@ export class Starkregen_ extends React.Component {
{mapRef !== undefined &&
this.props.starkregen.displayMode !== undefined &&
this.props.starkregen.animationEnabled === true &&
mapRef.getZoom() === parseInt(currentZoom) &&
mapRef.getZoom() >= MIN_ANIMATION_ZOOM && ( //use mapRef.getZoom() to avoid rasie conditions due to animations
<VectorFieldAnimation
key={
Expand Down

0 comments on commit 25cf199

Please sign in to comment.