Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/maps/src/tmap/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export default class TMapService extends BaseMapService<TMap.Map> {
this.map.on('rotate', this.handleCameraChanged);
this.map.on('pitch', this.handleCameraChanged);
this.map.on('zoom', this.handleCameraChanged);
this.map.on('resize', this.handleCameraChanged);// FIX #2751: handle window resize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This inline comment is redundant, as the code is self-explanatory and the rationale for the change is well-documented in the commit message and pull request. Removing it will improve code consistency with the other event listener registrations in this block.

Suggested change
this.map.on('resize', this.handleCameraChanged);// FIX #2751: handle window resize
this.map.on('resize', this.handleCameraChanged);
References
  1. Code should be self-documenting. Avoid comments that just repeat what the code does. The 'why' behind a change, especially for a bug fix, is best captured in commit messages and pull request descriptions, not as inline comments.


// Trigger camera change after init
this.handleCameraChanged();
Expand Down Expand Up @@ -464,3 +465,4 @@ export default class TMapService extends BaseMapService<TMap.Map> {
DOM.addClass(container, 'tmap-contianer--hide-logo');
}
}

Loading