Skip to content

[bug] MapMarker가 지도를 움직이기 전까지 업데이트 되지 않는 버그 #77

@gomjellie

Description

@gomjellie
<MarkerClusterer
  averageCenter={true}
  minLevel={5}
>
  {stores.map((store) => ( // 👈 react state인 stores가 변경되면 Mapmarker 가 새로 그려지게 구성함
    <MapMarker
      key={`${store.name}-${store.lat}-${store.lng}`}
      position={{ lat: store.lat, lng: store.lng }}
      title={store.name}
      onClick={() => void onSelectStore(store)}
      image={{
        src: 'https://t1.daumcdn.net/localimg/localimages/07/mapapidoc/markerStar.png',
        size: { width: 24, height: 35 },
      }}
    />
  ))}
</MarkerClusterer>

지도 바깥 부분의 인터랙션에 의해서 stores가 변경되어 MapMarker가 새로 그려지게되는데, 변경된 MapMarker가 지도 이동전까지 그려지지 않는 문제가 있습니다.

Screen.Recording.2025-04-26.at.12.23.27.PM.mov

강제로 새로 그리게하는 방법을 못찾아서 map.panBy(-1, -1)를 호출해서 지도를 살짝 이동시키면 MapMarker가 그려지는것까지 확인했습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions