Skip to main content

useSelectAnnotation

function CustomFeature() {
const selectedAnnotation = useSelectAnnotation();

return <></>;
}

<div>
<MapContainer center={[126.841784, 35.191406]} width="100%" height="500px">
<CustomFeature />
</MapContainer>
</div>;
  • useSelectAnnotation 을 사용하게 되면 openlayers 이벤트중 "singleclick" 이벤트가 추가됩니다.
  • 클릭한 어노테이션을 상태로 반환합니다.