Skip to content

Commit

Permalink
fix: 린트 수정 #124
Browse files Browse the repository at this point in the history
#preview
  • Loading branch information
1119wj committed Nov 28, 2024
1 parent 039d164 commit 575bcb3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/src/store/googleMapSlice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,33 +158,33 @@ class cMarkerClusterer extends MarkerClusterer {
});

// Allow algorithms to return flag on whether the clusters/markers have changed.
if (changed || changed == undefined) {
if (changed || changed === undefined) {
// Accumulate the markers of the clusters composed of a single marker.
// Those clusters directly use the marker.
// Clusters with more than one markers use a group marker generated by a renderer.
const singleMarker = new Set<Marker>();
for (const cluster of clusters) {
if (cluster.markers?.length == 1) {
if (cluster.markers?.length === 1) {
singleMarker.add(cluster.markers[0]);
}
}

const groupMarkers: Marker[] = [];
// Iterate the clusters that are currently rendered.
for (const cluster of this.clusters) {
if (cluster.marker == null) {
if (cluster.marker === null) {
continue;
}
if (cluster.markers?.length == 1) {
if (!singleMarker.has(cluster.marker)) {
if (cluster.markers?.length === 1) {
if (!singleMarker.has(cluster.marker!)) {
// The marker:
// - was previously rendered because it is from a cluster with 1 marker,
// - should no more be rendered as it is not in singleMarker.
MarkerUtils.setMap(cluster.marker, null);
MarkerUtils.setMap(cluster.marker!, null);
}
} else {
// Delay the removal of old group markers to avoid flickering.
groupMarkers.push(cluster.marker);
groupMarkers.push(cluster.marker!);
// cluster.markers?.forEach((marker) => {
// MarkerUtils.setMap(marker, null);
// });
Expand Down

0 comments on commit 575bcb3

Please sign in to comment.